Пример #1
0
 public bool them(KHO pmh)
 {
     try
     {
         da.KHOs.InsertOnSubmit(pmh);
         da.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #2
0
 public bool sua(KHO pmh)
 {
     try
     {
         KHO thanhvien = da.KHOs.Where(t => t.MASP == pmh.MASP.ToString()).FirstOrDefault();
         thanhvien.SOLUONG = pmh.SOLUONG;
         da.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #3
0
        public bool them(KHO kho)
        {
            try
            {
                ketNoi.KHOs.InsertOnSubmit(kho);
                ketNoi.SubmitChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Пример #4
0
        public bool ktkc(KHO pmh)
        {
            int r = da.KHOs.Count(t => t.MASP == pmh.MASP.ToString());

            try
            {
                if (r == 0)
                {
                    return(true);
                }
                return(false);
            }
            catch
            {
                return(false);
            }
        }
Пример #5
0
        public bool CapNhat(KHO kho)
        {
            try
            {
                var ketQua = (from item in ketNoi.KHOs
                              where item.MaNguyenLieu == kho.MaNguyenLieu
                              select item).FirstOrDefault();
                ketQua.SoLuongTon = kho.SoLuongTon;
                ketNoi.SubmitChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }