Beispiel #1
0
 public bool ThemDSHangNhapKho(DSHANGNHAP ds)
 {
     try
     {
         qlkho.DSHANGNHAPs.InsertOnSubmit(ds);
         qlkho.SubmitChanges();
         return(true);
     }
     catch { return(false); }
 }
Beispiel #2
0
 public bool SuaSoLuongSP(DSHANGNHAP ds)
 {
     try
     {
         DSHANGNHAP k = qlkho.DSHANGNHAPs.Where(t => t.MAPN == ds.MAPN).Where(t => t.MASP == ds.MASP).FirstOrDefault();
         k.SL = ds.SL;
         int n = (int)k.SL;
         k.ThanhTien = ThanhTien(n, ds.MASP.ToString());
         qlkho.SubmitChanges();
         return(true);
     }
     catch { return(false); }
 }
Beispiel #3
0
        public bool KTTonTaiSPdsPhieuNhap(string mapn)
        {
            DSHANGNHAP p = qlkho.DSHANGNHAPs.Single(t => t.MAPN == mapn);

            if (p != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #4
0
 public void XoaDSPhieuNhap(string mapn, int dem)
 {
     for (int i = 0; i <= dem; i++)
     {
         DSHANGNHAP p = qlkho.DSHANGNHAPs.Where(t => t.MAPN == mapn).FirstOrDefault();
         if (p == null)
         {
             return;
         }
         else
         {
             qlkho.DSHANGNHAPs.DeleteOnSubmit(p);
             qlkho.SubmitChanges();
         }
     }
 }
Beispiel #5
0
 public bool SuaTTDSPhieuNhap(DSHANGNHAP ds)
 {
     try
     {
         DSHANGNHAP k = qlkho.DSHANGNHAPs.Where(t => t.MAPN == ds.MAPN).Where(t => t.MASP == ds.MASP).FirstOrDefault();
         ds.SL = k.SL + 1;
         int    n  = (int)ds.SL;
         string ma = ds.MASP.ToString();
         ds.ThanhTien = ThanhTien(n, ma);
         k.SL         = ds.SL;
         k.ThanhTien  = ds.ThanhTien;
         qlkho.SubmitChanges();
         return(true);
     }
     catch { return(false); }
 }