Beispiel #1
0
 public bool deleteCTHoaDon(int id)
 {
     try
     {
         ct_hoadon ct = db.ct_hoadons.Single(m => m.id == id);
         db.ct_hoadons.DeleteOnSubmit(ct);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Beispiel #2
0
 public bool updateCTHoaDon(int id, string mhd, string msp, int sl, float tien)
 {
     try
     {
         ct_hoadon ct = db.ct_hoadons.Single(m => m.id == id);
         ct.mahd      = mhd;
         ct.masp      = msp;
         ct.soluong   = sl;
         ct.thanhtien = tien;
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Beispiel #3
0
 public bool insertCTHoaDon(string mhd, string msp, int sl, float tien)
 {
     try
     {
         ct_hoadon ct = new ct_hoadon();
         ct.mahd      = mhd;
         ct.masp      = msp;
         ct.soluong   = sl;
         ct.thanhtien = tien;
         db.ct_hoadons.InsertOnSubmit(ct);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }