public bool ThemKhuVucPhong(string tenkv, string tang, string tenday, int soluongphong, string tinhtrang, string diachikhuvuc)
 {
     try
     {
         KhuVucPhong kvp = new KhuVucPhong();
         kvp.TenKV        = tenkv;
         kvp.Tang         = tang;
         kvp.TenDayPhong  = tenday;
         kvp.SoLuongPhong = soluongphong;
         kvp.TinhTrang    = tinhtrang;
         kvp.DiaChiKhuVuc = diachikhuvuc;
         QUANLYNHATRO1DataContext context = new QUANLYNHATRO1DataContext();
         context.KhuVucPhongs.InsertOnSubmit(kvp);
         context.SubmitChanges();
         return(true);
     }
     catch
     {
     }
     return(false);
 }
 public bool XoaKhuVucPhong(int makv)
 {
     try
     {
         QUANLYNHATRO1DataContext context = new QUANLYNHATRO1DataContext();
         KhuVucPhong kvp = context.KhuVucPhongs.FirstOrDefault(x => x.MaKV == makv);
         if (kvp.PhongTros.Count > 0)
         {
             return(false);
         }
         else
         {
             context.KhuVucPhongs.DeleteOnSubmit(kvp);
             context.SubmitChanges();
             return(true);
         }
     }
     catch
     {
     }
     return(true);
 }
 public bool SuaKhuVucPhong(int makvp, string tenkv, string tang, string tenday, int soluongphong, string tinhtrang, string diachikhuvuc)
 {
     try
     {
         QUANLYNHATRO1DataContext context = new QUANLYNHATRO1DataContext();
         KhuVucPhong kvp = context.KhuVucPhongs.FirstOrDefault(x => x.MaKV == makvp);
         if (kvp != null)
         {
             kvp.TenKV        = tenkv;
             kvp.Tang         = tang;
             kvp.TenDayPhong  = tenday;
             kvp.SoLuongPhong = soluongphong;
             kvp.TinhTrang    = tinhtrang;
             kvp.DiaChiKhuVuc = diachikhuvuc;
             context.SubmitChanges();
             return(true);
         }
         return(false);
     }
     catch
     {
     }
     return(false);
 }