예제 #1
0
 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); }
 }
예제 #2
0
 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); }
 }
예제 #3
0
 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); }
 }