示例#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);
     }
 }