internal void updateHouseTypeInHouse() { try { int maNha = SelectedHouse.MANHA; int newLoaiNha = SelectedHouse.LOAINHA.MALOAI; using (QUANLYNHADATEntities db = new QUANLYNHADATEntities()) { db.USP_UpdateHouseTypeInHouse(maNha, newLoaiNha); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void UpdateHouseCategory(NHA Nha) { if (Nha is null) { throw new System.ArgumentNullException(nameof(Nha)); } using (var db = new QUANLYNHADATEntities()) { try { db.USP_UpdateHouseTypeInHouse(Nha.MANHA, Nha.MALOAI); db.SaveChanges(); this.Reset(); } catch (System.Exception ex) { MessageBox.Show(ex.ToString()); } } }