public bool them_ThietBiphong(THIETBI_PHONG tb) { try { data.THIETBI_PHONGs.InsertOnSubmit(tb); data.SubmitChanges(); return(true); } catch { return(false); } }
//Xóa public bool xoa_ThietBiphong(string pMaTB, string pmaphong) { try { THIETBI_PHONG tb = data.THIETBI_PHONGs.Where(t => t.MATHIETBI == pMaTB && t.MAPHONG == pmaphong).FirstOrDefault(); data.THIETBI_PHONGs.DeleteOnSubmit(tb); data.SubmitChanges(); return(true); } catch { return(false); } }
public bool sua_ThietBiphong(THIETBI_PHONG pThietBi) { try { THIETBI_PHONG nv = data.THIETBI_PHONGs.Where(t => t.MATHIETBI == pThietBi.MATHIETBI && t.MAPHONG == pThietBi.MAPHONG).FirstOrDefault(); if (nv != null) { nv.TRANGTHAI = pThietBi.TRANGTHAI; data.SubmitChanges(); } return(true); } catch { return(false); } }
//Thêm public bool them_ThietBiphong(THIETBI_PHONG pThietBi) { return(thietbi.them_ThietBiphong(pThietBi)); }
//Sửa public bool sua_ThietBiphong(THIETBI_PHONG pThietBi) { return(thietbi.sua_ThietBiphong(pThietBi)); }