Exemple #1
0
 public void Update(OutStoreBillHd hd)
 {
     using (DCC dcc = DBMLFty.Dcc)
     {
         DALFty.Create <OutStoreBillDAL>().Update(dcc, hd);
         dcc.Save();
     }
 }
Exemple #2
0
 public void Insert(OutStoreBillHd hd, List <OutStoreBillDtl> dtl)
 {
     using (DCC dcc = DBMLFty.Dcc)
     {
         DALFty.Create <OutStoreBillDAL>().Insert(dcc, hd, dtl);
         dcc.Save();
     }
 }
Exemple #3
0
 public void Insert(DCC dcc, OutStoreBillHd hd, List <OutStoreBillDtl> dtl)
 {
     using (TransactionScope ts = new TransactionScope())
     {
         dcc.OutStoreBillHd.InsertOnSubmit(hd);
         dcc.OutStoreBillDtl.InsertAllOnSubmit(dtl);
         dcc.SubmitChanges();
         ts.Complete();
     }
 }
Exemple #4
0
 public void Update(DCC dcc, OutStoreBillHd hd, List <OutStoreBillDtl> dtl)
 {
     using (TransactionScope ts = new TransactionScope())
     {
         dcc.OutStoreBillHd.Attach(hd);
         dcc.Refresh(System.Data.Linq.RefreshMode.KeepCurrentValues, hd);
         //更新明细可能有新增记录,所有先将原有记录删除再全部添加
         var lstHd = dcc.OutStoreBillDtl.Where(o => o.HdID == hd.ID);
         dcc.OutStoreBillDtl.DeleteAllOnSubmit(lstHd);
         foreach (OutStoreBillDtl item in dtl)
         {
             item.ID   = Guid.NewGuid();
             item.HdID = hd.ID;
         }
         dcc.OutStoreBillDtl.InsertAllOnSubmit(dtl);
         dcc.SubmitChanges();
         ts.Complete();
     }
 }
Exemple #5
0
 public void Update(DCC dcc, OutStoreBillHd hd)
 {
     dcc.OutStoreBillHd.Attach(hd);
     dcc.Refresh(System.Data.Linq.RefreshMode.KeepCurrentValues, hd);
 }