public bool them(KHO pmh) { try { da.KHOs.InsertOnSubmit(pmh); da.SubmitChanges(); return(true); } catch { return(false); } }
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); } }
public bool them(KHO kho) { try { ketNoi.KHOs.InsertOnSubmit(kho); ketNoi.SubmitChanges(); return(true); } catch (Exception) { return(false); } }
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); } }
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); } }