Esempio n. 1
0
 public bool deleteCTPhieuNhap(string mpn)
 {
     try
     {
         ct_phieunhap ct = db.ct_phieunhaps.Single(m => m.mapn == mpn);
         db.ct_phieunhaps.DeleteOnSubmit(ct);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 2
0
 public bool updateCTPhieuNhap(int id, string mpn, string msp, int sl, float gia, float tien)
 {
     try
     {
         ct_phieunhap ct = db.ct_phieunhaps.Single(m => m.id == id);
         ct.mapn      = mpn;
         ct.masp      = msp;
         ct.soluong   = sl;
         ct.gia       = gia;
         ct.thanhtien = tien;
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 3
0
 public bool insertCTPhieuNhap(string mpn, string msp, int sl, float gia, float tien)
 {
     try
     {
         ct_phieunhap ct = new ct_phieunhap();
         ct.mapn      = mpn;
         ct.masp      = msp;
         ct.soluong   = sl;
         ct.gia       = gia;
         ct.thanhtien = tien;
         db.ct_phieunhaps.InsertOnSubmit(ct);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }