| @ -0,0 +1,21 @@ | |||
| using BWP.B3Frameworks.BO; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Data; | |||
| using System.Linq; | |||
| using System.Text; | |||
| namespace BWP.B3ClientService.BO | |||
| { | |||
| [Serializable] | |||
| public class BeforeDeathDetail : Base | |||
| { | |||
| public long Main_ID { get; set; } | |||
| public int Number { get; set; } | |||
| [DbColumn(DbType = SqlDbType.DateTime)] | |||
| public DateTime Time { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,49 @@ | |||
| using BWP.B3ClientService.BO; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.EnterpriseServices.JsonRpc; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Web.Script.Serialization; | |||
| using TSingSoft.WebPluginFramework; | |||
| namespace BWP.B3ClientService.Rpcs.BillRpc | |||
| { | |||
| [Rpc] | |||
| public static class BeforeDeathRpc | |||
| { | |||
| static JavaScriptSerializer serializer = new JavaScriptSerializer(); | |||
| [Rpc] | |||
| public static int InsertBeforeDeathDetail(string json) | |||
| { | |||
| var entity = serializer.Deserialize<BeforeDeathDetail>(json); | |||
| entity.Time = DateTime.Now; | |||
| using (var session = Dmo.NewSession()) | |||
| { | |||
| session.Insert(entity); | |||
| session.Commit(); | |||
| } | |||
| return 1; | |||
| } | |||
| [Rpc] | |||
| public static string GetBeforeDeathDetails(long main_id) | |||
| { | |||
| var query = new DmoQuery(typeof(BeforeDeathDetail)); | |||
| query.Where.Conditions.Add(DQCondition.EQ("Main_ID", main_id)); | |||
| var r = query.EExecuteList(); | |||
| return serializer.Serialize(r); | |||
| } | |||
| [Rpc] | |||
| public static int DeleteBeforeDeathDetail(long id) | |||
| { | |||
| var delete = new DQDeleteDom(typeof(BeforeDeathDetail)); | |||
| delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); | |||
| delete.EExecute(); | |||
| return 1; | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,62 @@ | |||
| using BWP.B3ClientService.BO; | |||
| using BWP.B3ClientService.Rpcs.RpcBO; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.EnterpriseServices.JsonRpc; | |||
| using Forks.EnterpriseServices.SqlDoms; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Web.Script.Serialization; | |||
| using TSingSoft.WebPluginFramework; | |||
| namespace BWP.B3ClientService.Rpcs.BillRpc | |||
| { | |||
| [Rpc] | |||
| public static class OutHouseRpc | |||
| { | |||
| static JavaScriptSerializer serializer = new JavaScriptSerializer(); | |||
| [Rpc] | |||
| public static string GetUnFinishList(string fieldName) | |||
| { | |||
| var query = new DQueryDom(new JoinAlias(typeof(OrderDetail))); | |||
| query.Columns.Add(DQSelectColumn.Field("ID")); | |||
| query.Columns.Add(DQSelectColumn.Field("Order")); | |||
| query.Columns.Add(DQSelectColumn.Field("PlanNumber")); | |||
| query.Columns.Add(DQSelectColumn.Field("LiveColonyHouse_Name")); | |||
| query.Range = SelectRange.Top(6); | |||
| query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Order")); | |||
| query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.EQ("IsHurryButcher", false), DQCondition.EQ(fieldName, false))); | |||
| var list = new List<OutHouseObj>(); | |||
| using (var session = Dmo.NewSession()) | |||
| { | |||
| using (var reader = session.ExecuteReader(query)) | |||
| { | |||
| while (reader.Read()) | |||
| { | |||
| var entity = new OutHouseObj(); | |||
| entity.ID = (long)reader[0]; | |||
| entity.Order = (int)reader[1]; | |||
| entity.Number = (int)reader[2]; | |||
| entity.LiveColonyHouse_Name = (string)reader[3]; | |||
| list.Add(entity); | |||
| } | |||
| } | |||
| } | |||
| return serializer.Serialize(list); | |||
| } | |||
| [Rpc] | |||
| public static int SetOrderFinish(long id, string fieldName) | |||
| { | |||
| var update = new DQUpdateDom(typeof(OrderDetail)); | |||
| update.Where.Conditions.Add(DQCondition.EQ("ID", id)); | |||
| update.Columns.Add(new DQUpdateColumn(fieldName, true)); | |||
| update.EExecute(); | |||
| return 1; | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,15 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| namespace BWP.B3ClientService.Rpcs.RpcBO | |||
| { | |||
| public class OutHouseObj | |||
| { | |||
| public long ID { get; set; } | |||
| public int Order { get; set; } | |||
| public int Number { get; set; } | |||
| public string LiveColonyHouse_Name { get; set; } | |||
| } | |||
| } | |||