Пример #1
0
 public virtual void Create(KT_CTuGoc user)
 {
     try
     {
         this.db.KT_CTuGocs.InsertOnSubmit(user);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Пример #2
0
 public virtual void Update(KT_CTuGoc user)
 {
     try
     {
         KT_CTuGoc userOld = this.GetById(user.ID);
         userOld = user;
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Пример #3
0
 public virtual void Remove(KT_CTuGoc user)
 {
     try
     {
         db.KT_CTuGocs.DeleteOnSubmit(user);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Пример #4
0
 public virtual int Delete(KT_CTuGoc user)
 {
     try
     {
         //user.IsDelete = true;
         db.SubmitChanges();
         return 0;
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Пример #5
0
 public virtual bool InsertLuongTheoPhongBan(string loaiCT, string soCT, DateTime ngayCT, string dienGiai, string tkNo, string tkCo, double tongTien, string maPB)
 {
     try
     {
         KT_CTuGoc obj = new KT_CTuGoc();
         obj.MA_CTU = loaiCT;
         obj.SO_CTU = soCT;
         obj.NGAY_CTU = ngayCT;
         obj.DIEN_GIAI = dienGiai;
         obj.TK_NO = tkNo;
         obj.TK_CO = tkCo;
         obj.MA_DTPN_NO = maPB;
         obj.MA_DTPN_CO = maPB;
         obj.TONG_TIEN_VND = tongTien;
         db.KT_CTuGocs.InsertOnSubmit(obj);
         db.SubmitChanges();
         return true;
     }
     catch { return false; }
 }