コード例 #1
0
        void Accept()
        {
            try
            {
                if (Estate_Checkvalidate() == false)
                {
                    return;
                }

                Estate_Object_Info _Estate_Object_Info = new Estate_Object_Info();
                _Estate_Object_Info.Estate_Name = txt_Estate_Name.Text;
                _Estate_Object_Info.Note        = txtNote.Text;
                _Estate_Object_Info.Area        = txt_Estate_Area.Text;
                _Estate_Object_Info.Estate_Type = Convert.ToDecimal(cboType.SelectedValue);
                _Estate_Object_Info.Status      = Convert.ToDecimal(cboStatus.SelectedValue);
                _Estate_Object_Info.Building_Id = c_Building_Info_Search.Building_Id;
                _Estate_Object_Info.Estate_Code = txt_Estate_Code.Text;
                decimal _estate_id = c_Estate_Object_Controller.Estate_Object_Insert(_Estate_Object_Info);

                if (_estate_id == -1)
                {
                    NoteBox.Show("Lỗi thêm mới đối tượng bất động sản", "", NoteBoxLevel.Error);
                    return;
                }

                c_id_insert = _estate_id;

                NoteBox.Show("Thêm mới dữ liệu thành công", "");
                this.Close();
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }