예제 #1
0
        public PHIEUNHAPHANGCHINHANH createNHCN(TAIKHOAN tk)
        {
            db = new CMART8Entities();
            PHIEUNHAPHANGCHINHANH pnh = new PHIEUNHAPHANGCHINHANH();

            pnh.SOPHIEU  = autoID();
            pnh.NGAYNHAP = DateTime.Now;
            pnh.MATK     = tk.MATK;
            db.PHIEUNHAPHANGCHINHANHs.Add(pnh);
            db.SaveChanges();
            return(pnh);
        }
예제 #2
0
 public bool deletePN(PHIEUNHAPHANGCHINHANH PN)
 {
     try
     {
         db = new CMART8Entities();
         PHIEUNHAPHANGCHINHANH pn = db.PHIEUNHAPHANGCHINHANHs.Find(PN.SOPHIEU);
         db.PHIEUNHAPHANGCHINHANHs.Remove(pn);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #3
0
 //Update Phiếu nhập hàng chi nhánh
 public bool updatePNHTS(PHIEUNHAPHANGCHINHANH PN, string sophieuTS, string chinhanh)
 {
     try
     {
         db = new CMART8Entities();
         PHIEUNHAPHANGCHINHANH pn = db.PHIEUNHAPHANGCHINHANHs.Find(PN.SOPHIEU);
         pn.SOPHIEUNHTS     = sophieuTS;
         pn.CHINHANH        = chinhanh;
         db.Entry(pn).State = System.Data.EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }