コード例 #1
0
 //Tao phieu nhap
 public bool TaoPhieuNhap(int pMaPN, int pMaNCC, string pNgayNhap)
 {
     try
     {
         receipt_import check = _Coffee.receipt_imports.Where(t => t.ID.Equals(pMaPN)).FirstOrDefault();
         if (check != null)
         {
             return(false);//ton tai ma pn
         }
         else
         {
             DateTime       dt  = new DateTime();
             receipt_import add = new receipt_import();
             add.ID          = pMaPN;
             add.ID_SUPPLIER = pMaNCC;
             add.CREATE_AT   = Convert.ToDateTime(pNgayNhap);
             _Coffee.receipt_imports.InsertOnSubmit(add);
             _Coffee.SubmitChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
コード例 #2
0
 public receipt_import LoadTTPN(int pMaPN)
 {
     try
     {
         receipt_import check = _Coffee.receipt_imports.Where(t => t.ID.Equals(pMaPN)).FirstOrDefault();
         return(check);
     }
     catch
     {
         return(null);
     }
 }
コード例 #3
0
 //Cap nhat thanh tien
 public bool CapNhatThanhTien(int pMaPN, double pSum)
 {
     try
     {
         receipt_import check = _Coffee.receipt_imports.Where(t => t.ID.Equals(pMaPN)).FirstOrDefault();
         check.SUM_MONEY = pSum;
         _Coffee.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #4
0
 public bool DeleteImport(int pID)
 {
     try
     {
         receipt_import sp = _Coffee.receipt_imports.Where(t => t.ID.Equals(pID)).FirstOrDefault();
         _Coffee.receipt_imports.DeleteOnSubmit(sp);
         _Coffee.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #5
0
 public bool EditImport(int pId, int pItem, string pCreate, int pNum)
 {
     try
     {
         receipt_import sp = _Coffee.receipt_imports.Where(t => t.ID.Equals(pId)).FirstOrDefault();
         sp.SUM_MONEY = sp.NUMBER * sp.PRICE_PURCHASE;
         sp.NUMBER    = pNum;
         sp.ID_ITEM   = pItem;
         sp.CREATE_AT = Convert.ToDateTime(pCreate);
         _Coffee.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #6
0
 public bool AddNewImport(int pItem, string pCreate, int pNum)
 {
     try
     {
         receipt_import sp = new receipt_import();
         sp.ID        = MaxID() + 1;
         sp.SUM_MONEY = sp.NUMBER * sp.PRICE_PURCHASE;
         sp.NUMBER    = pNum;
         sp.ID_ITEM   = pItem;
         sp.CREATE_AT = Convert.ToDateTime(pCreate);
         sp.STATUS    = 1;
         _Coffee.receipt_imports.InsertOnSubmit(sp);
         _Coffee.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }