public bool DeleteLoaiKH(string maLoaiKH) { try { LoaiKH lkh = context.LoaiKHs.Single(s => s.MaLoaiKH.Equals(maLoaiKH)); context.LoaiKHs.Remove(lkh); context.SaveChanges(); return(true); } catch { return(false); } }
public bool UpdateLoaiKH(string maLoaiKH, string tenLoaiKH, int chietKhau) { try { LoaiKH lkh = context.LoaiKHs.Single(s => s.MaLoaiKH.Equals(maLoaiKH)); lkh.TenLoaiKH = tenLoaiKH; lkh.ChietKhau = chietKhau; context.SaveChanges(); return(true); } catch { return(false); } }
public bool InsertLoaiKH(string maLoaiKH, string tenLoaiKH, int chietKhau) { try { LoaiKH lkh = new LoaiKH { MaLoaiKH = maLoaiKH, TenLoaiKH = tenLoaiKH, ChietKhau = chietKhau }; context.LoaiKHs.Add(lkh); context.SaveChanges(); return(true); } catch { return(false); } }