Пример #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                DataGridViewRow dgr = dataGridView1.CurrentRow;
                dgr.Cells["Address"].Value          = this.tbxHouseAddress.Text;
                dgr.Cells["CompactNumber"].Value    = this.tbxHouseCompactNumber.Text;
                dgr.Cells["Area"].Value             = this.tbxHouseArea.Text;
                dgr.Cells["RegisterDate"].Value     = this.tbxHouseRegisterDate.Text;
                dgr.Cells["InsuranceDate"].Value    = this.tbxHouseInsuranceDate.Text;
                dgr.Cells["NotarizationDate"].Value = this.tbxHouseNotarizationDate.Text;

                DDHouseInfo newHouse = new DDHouseInfo("HouseID", Convert.ToInt32(dgr.Cells["HouseID"].Value));
                newHouse.Address          = this.tbxHouseAddress.Text;
                newHouse.CompactNumber    = this.tbxHouseCompactNumber.Text;
                newHouse.Area             = this.tbxHouseArea.Text;
                newHouse.RegisterDate     = this.tbxHouseRegisterDate.Text;
                newHouse.InsuranceDate    = this.tbxHouseInsuranceDate.Text;
                newHouse.NotarizationDate = this.tbxHouseNotarizationDate.Text;
                newHouse.Save();
                MessageBox.Show("信息更新成功!", "提示信息");
            }
            catch
            {
                MessageBox.Show("信息更新错误,请检查数据库是否连接正确!", "提示信息");
            }
        }
Пример #2
0
        public void Update(int HouseID, string Address, string CompactNumber, string Area, string RegisterDate, string InsuranceDate, string NotarizationDate, int?PawnageID)
        {
            DDHouseInfo item = new DDHouseInfo();

            item.MarkOld();
            item.IsLoaded = true;

            item.HouseID = HouseID;

            item.Address = Address;

            item.CompactNumber = CompactNumber;

            item.Area = Area;

            item.RegisterDate = RegisterDate;

            item.InsuranceDate = InsuranceDate;

            item.NotarizationDate = NotarizationDate;

            item.PawnageID = PawnageID;

            item.Save(UserName);
        }