日期:2014-05-17 浏览次数:20406 次
[ServiceContract] interface TransOrderPross { [OperationContract] void Add(TransOrder data); [OperationContract] List<TransOrder> FindAll(); [OperationContract] void Update(Guid transorderid); [OperationContract] void Delete(Guid transorderid); }
[DataContract] public class OperationPross:TransOrderPross { #region 初始化 public Guid TransOrderID { get; set; } public DateTime InputTime { get; set; } public string Updater { get; set; } public DateTime UpdateTime { get; set; } public int Status { get; set; } public int IsCancel { get; set; } public string Remark { get; set; } public string Inputer { get; set; } public string TransOrderNO { get; set; } public string ConsignMan { get; set; } public string ReceiveMan { get; set; } public string OrderTotalFee { get; set; } public DateTime ConsignDate { get; set; } public string OrderLoading { get; set; } public string OrderUnloading { get; set; } #endregion DataTransOrderDataContext db = new DataTransOrderDataContext(); public void Add(TransOrder data) { data.TransOrderID = TransOrderID; data.InputTime = InputTime; data.Updater = Updater; data.UpdateTime = UpdateTime; data.Status = Status; data.IsCancel = IsCancel; data.Remark = Remark; data.Inputer = Inputer; data.TransOrderNO = TransOrderNO; data.ConsignMan = ConsignMan; data.ReceiveMan = ReceiveMan; data.OrderTotalFee = OrderTotalFee; data.OrderLoading = OrderLoading; data.OrderTotalFee = OrderTotalFee; data.OrderUnloading = OrderUnloading; db.TransOrder.InsertOnSubmit(data); db.SubmitChanges(); } public List<TransOrder> FindAll() { var result = from u in db.TransOrder select u; List<TransOrder> list = result.ToList<TransOrder>(); return list; } public void Update(Guid transorderid) { var result = from u in db.TransOrder where u.TransOrderID == transorderid select u; foreach (TransOrder data in result) { data.TransOrderID = TransOrderID; data.InputTime = InputTime; data.Updater = Updater; data.UpdateTime = UpdateTime; data.Status = Status; data.IsCancel = IsCancel; data.Remark = Remark; data.Inputer = Inputer; data.TransOrderNO = TransOrderNO; data.ConsignMan = ConsignMan; data.ReceiveMan = ReceiveMan; data.OrderTotalFee = OrderT