using Forks.EnterpriseServices.DomainObjects2; using Forks.EnterpriseServices.DomainObjects2.DQuery; using System; using System.Collections.Generic; using System.Linq; using System.Text; using TSingSoft.WebPluginFramework; namespace BWP.B3ClientService.BO { [Serializable] [BOClass] public class WeightBillCheck { public long B3ID { get; set; } /// /// 单据创建人用户名 /// public string Creator { get; set; } /// /// 同步状态 /// public bool Sync { get; set; } public DateTime ModifyTime { get; set; } public static void Insert(long id, string creator) { if (Exist(id)) return; var entity = new WeightBillCheck(); entity.B3ID = id; entity.Creator = creator; entity.ModifyTime = DateTime.Now; using (var session = Dmo.NewSession()) { session.Insert(entity); session.Commit(); } } static bool Exist(long id) { var query = new DQueryDom(new JoinAlias(typeof(WeightBillCheck))); query.Where.Conditions.Add(DQCondition.EQ("B3ID", id)); return query.EExists(); } public static void SetSynced(long id) { var update = new DQUpdateDom(typeof(WeightBillCheck)); update.Columns.Add(new DQUpdateColumn("Sync", true)); update.Where.Conditions.Add(DQCondition.EQ("B3ID", id)); update.EExecute(); } } }