| @ -0,0 +1,69 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using BWP.B3Frameworks.BO; | |||
| namespace BWP.B3ClientService.BO | |||
| { | |||
| public class ClientSyncBase:Base | |||
| { | |||
| /// <summary> | |||
| /// 是否同步到中间服务器上 | |||
| /// </summary> | |||
| public bool IsSynced { get; set; } | |||
| /// <summary> | |||
| /// 客户端ID | |||
| /// </summary> | |||
| public long? Client_ID { get; set; } | |||
| /// <summary> | |||
| /// B3服务器ID | |||
| /// </summary> | |||
| public long? B3_ID { get; set; } | |||
| /// <summary> | |||
| /// 上传中间服务器时间 | |||
| /// </summary> | |||
| public DateTime? SyncTime { get; set; } | |||
| /// <summary> | |||
| /// 是否要在服务器上删除 此字段为了删除服务器上的数据用的 | |||
| /// </summary> | |||
| public bool WillBeDeleted { get; set; } | |||
| /// <summary> | |||
| /// 是否要在服务器上修改 此字段为了修改服务器上的数据用的 | |||
| /// </summary> | |||
| public bool WillBeUpdated { get; set; } | |||
| //已经删除的记录 相当于作废的记录 查询的时候要过滤 为了保存原始的记录 用删除标记 | |||
| public bool IsDeleted { get; set; } | |||
| /// <summary> | |||
| /// 设置删除的时间 | |||
| /// </summary> | |||
| public DateTime? DeleteTime { get; set; } | |||
| protected DateTime mCreateTime = DateTime.Now; | |||
| /// <summary> | |||
| /// 每条记录都要记录创建时间 | |||
| /// </summary> | |||
| public DateTime CreateTime | |||
| { | |||
| get { return mCreateTime; } | |||
| set { mCreateTime = value; } | |||
| } | |||
| /// <summary> | |||
| /// 每条记录都要记录创建人 将来可可以记录标识用 | |||
| /// </summary> | |||
| public string CreateUserName { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Security.AccessControl; | |||
| using System.Text; | |||
| namespace BWP.B3ClientService.BO | |||
| { | |||
| public class ClientSyncBaseDto | |||
| { | |||
| public long? Service_ID { get; set; } | |||
| public long? Client_ID { get; set; } | |||
| public long? B3_ID { get; set; } | |||
| public string CreateUserName { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| namespace BWP.B3ClientService.BO | |||
| { | |||
| [Serializable] | |||
| public class TrunksIousOutInStoreRecord: ClientSyncBase | |||
| { | |||
| public string BarCode { get; set; } | |||
| public long? Goods_ID { get; set; } | |||
| public string Goods_Name { get; set; } | |||
| private int mNumber = 1; | |||
| public int Number | |||
| { | |||
| get { return mNumber; } | |||
| set { mNumber = value; } | |||
| } | |||
| public decimal? Weight { get; set; } | |||
| public string CarcassStatus { get; set; }// 胴体状态 | |||
| } | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using BWP.B3ClientService.BO; | |||
| using Forks.EnterpriseServices.DataForm; | |||
| namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_ | |||
| { | |||
| [Serializable,DFClass] | |||
| public class TrunksIousOutInStoreRecordDto: ClientSyncBaseDto | |||
| { | |||
| public string BarCode { get; set; } | |||
| public long? Goods_ID { get; set; } | |||
| public string Goods_Name { get; set; } | |||
| private int mNumber = 1; | |||
| public int Number | |||
| { | |||
| get { return mNumber; } | |||
| set { mNumber = value; } | |||
| } | |||
| public decimal? Weight { get; set; } | |||
| public string CarcassStatus { get; set; }// 胴体状态 | |||
| } | |||
| } | |||
| @ -0,0 +1,57 @@ | |||
| | |||
| using BWP.B3ClientService.BO; | |||
| using BWP.B3Frameworks.Utils; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.EnterpriseServices.JsonRpc; | |||
| using Newtonsoft.Json; | |||
| namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_ | |||
| { | |||
| //todo 这里需要维护大表 | |||
| [Rpc] | |||
| public static class TrunksIousOutInStoreRecordRpc | |||
| { | |||
| [Rpc] | |||
| public static long Insert(string json) | |||
| { | |||
| var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json); | |||
| using (var session=Dmo.NewSession()) | |||
| { | |||
| var record = new TrunksIousOutInStoreRecord(); | |||
| DmoUtil.CopyDmoFields(clientRecord, record, "ID", "B3_ID"); | |||
| session.Insert(record); | |||
| session.Commit(); | |||
| return record.ID; | |||
| } | |||
| } | |||
| [Rpc] | |||
| public static int Update(string json) | |||
| { | |||
| var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json); | |||
| using (var session=Dmo.NewSession()) | |||
| { | |||
| var record = session.Load(new DmoIdentity(typeof(TrunksIousOutInStoreRecord), clientRecord.Service_ID??0)); | |||
| DmoUtil.CopyDmoFields(clientRecord,record,"ID", "B3_ID"); | |||
| session.Update(record); | |||
| } | |||
| return 1; | |||
| } | |||
| [Rpc] | |||
| public static int Delete(long id) | |||
| { | |||
| var delDom = new DQDeleteDom(typeof(TrunksIousOutInStoreRecord)); | |||
| delDom.Where.Conditions.Add(DQCondition.EQ("ID",id)); | |||
| using (var session=Dmo.NewSession()) | |||
| { | |||
| session.Update(delDom); | |||
| } | |||
| return 1; | |||
| } | |||
| } | |||
| } | |||