Esempio n. 1
0
        void Delete()
        {
            try
            {
                c_row_select = dgrRenter.SelectedIndex;
                Building_Info _Building_Info = (Building_Info)dgrRenter.SelectedItem;

                if (_Building_Info == null)
                {
                    return;
                }

                bool _ck = c_BuildingController.Check_Exit_EstateInBuilding(_Building_Info.Building_Id);
                if (_ck == true)
                {
                    NoteBox.Show("Đối tượng BĐS thuộc toà nhà không thể xóa", "", NoteBoxLevel.Error);
                    return;
                }

                MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn xóa tòa nhà này hay không?", "Thông báo", NoteBoxLevel.Question);
                if (MessageBoxResult.Yes == result)
                {
                    if (c_BuildingController.Building_Delete(_Building_Info.Building_Id))
                    {
                        NoteBox.Show("Xóa dữ liệu thành công");
                        LoadData();
                    }
                }
                else
                {
                    DataGridHelper.NVSFocus(dgrRenter, c_row_select, 0);
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }