Пример #1
0
 internal void updateHousePriceInHouseRent()
 {
     try
     {
         int maNha    = SelectedHouse.MANHA;
         int newPrice = (int)SelectedHouseForRent.GIATHUE;
         using (QUANLYNHADATEntities db = new QUANLYNHADATEntities())
         {
             db.USP_UpdateHousePrice(MACN, maNha, newPrice);
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.ToString()); }
 }
Пример #2
0
        private void UpdateHouseRentalPrice(CHITIETNHATHUE ChiTietNhaThue)
        {
            if (ChiTietNhaThue is null)
            {
                throw new System.ArgumentNullException(nameof(ChiTietNhaThue));
            }

            using (var db = new QUANLYNHADATEntities())
            {
                try
                {
                    db.USP_UpdateHousePrice(ChiTietNhaThue.MACN, ChiTietNhaThue.MANHA, ChiTietNhaThue.GIATHUE);
                    db.SaveChanges();
                    this.Reset();
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
Пример #3
0
        public void UpdateHouseRentalPrice(object[] keys)
        {
            var maNha = (int)keys[0];
            var maCN  = (int)keys[1];
            var price = (int?)keys[2];

            using (var db = new QUANLYNHADATEntities())
            {
                var rentalhouseDetail = db.CHITIETNHATHUEs.Find(maNha, maCN);
                if (rentalhouseDetail != null)
                {
                    try
                    {
                        db.USP_UpdateHousePrice(maCN, maNha, price);
                        db.SaveChanges();
                        this.Reset();
                    }
                    catch (System.Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }
                }
            }
        }