Beispiel #1
0
        void Accept()
        {
            try
            {
                if (Building_Checkvalidate() == false)
                {
                    return;
                }

                MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn sửa thông tin tòa nhà hay không?", "Thông báo", NoteBoxLevel.Question);
                if (MessageBoxResult.Yes != result)
                {
                    return;
                }

                Building_Info _Building_Info = new Building_Info();
                _Building_Info.Building_Code = txt_Building_Code.Text;
                _Building_Info.Building_Name = txt_Building_Code.Text;
                _Building_Info.Address       = txtAddress.Text;
                _Building_Info.Notes         = txtNote.Text;
                decimal _building_id = c_BuildingController.Building_Update(c_Building_Info.Building_Id, _Building_Info);

                if (_building_id == -1)
                {
                    NoteBox.Show("Lỗi sửa thông tin tòa nhà", "", NoteBoxLevel.Error);
                    return;
                }

                c_id_insert = c_Building_Info.Building_Id;

                NoteBox.Show("Sửa dữ liệu thành công", "");
                this.Close();
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }