Ejemplo n.º 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); }
 }
Ejemplo n.º 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); }
 }
Ejemplo n.º 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); }
 }