public static Tbl_KyLuatNV toTbl_KyLuat(KyLuat kyluat) { Tbl_KyLuatNV record = new Tbl_KyLuatNV(); record.maKyLuat = kyluat.MaKL; record.hinhThucKL = kyluat.HinhThucKL; record.ghiChu = kyluat.GhiChu; return(record); }
public bool Delete(string deleteID) { try { Tbl_KyLuatNV deleteRecord = DB.Tbl_KyLuatNVs.Single(record => record.maKyLuat == deleteID); DB.Tbl_KyLuatNVs.DeleteOnSubmit(deleteRecord); DB.SubmitChanges(); return(true); } catch { return(false); } }
public bool Add(KyLuat newKL) { try { Tbl_KyLuatNV newRecord = MyConvert.toTbl_KyLuat(newKL); DB.Tbl_KyLuatNVs.InsertOnSubmit(newRecord); DB.SubmitChanges(); return(true); } catch { return(false); } }
public bool UpDate(KyLuat updateKL) { try { Tbl_KyLuatNV updateRecord = DB.Tbl_KyLuatNVs.Single(record => record.maKyLuat == updateKL.MaKL); updateRecord.maKyLuat = updateKL.MaKL; updateRecord.hinhThucKL = updateKL.HinhThucKL; updateRecord.ghiChu = updateKL.GhiChu; DB.SubmitChanges(); return(true); } catch { return(false); } }
public static KyLuat ToKyLuat(Tbl_KyLuatNV record) { return(new KyLuat(record.maKyLuat, record.hinhThucKL, record.ghiChu)); }