private void mnuShowBuilding_Click(object sender, EventArgs e) { try { if (DGrid.RowCount <= 0) { return; } if (DGrid.CurrentRow == null) { return; } var guid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; var req = BuildingRequestBussines.Get(guid); if (req == null) { return; } var type = EnRequestType.Rahn; decimal fPrice1 = 0, sPrice1 = 0, fPrice2 = 0, sPrice2 = 0; if (req.SellPrice1 > 0) { type = EnRequestType.Forush; } if (req.RahnPrice1 > 0) { type = EnRequestType.Rahn; } if (type == EnRequestType.Forush) { fPrice1 = req.SellPrice1; fPrice2 = req.SellPrice2; } else { fPrice1 = req.RahnPrice1; fPrice2 = req.RahnPrice2; sPrice1 = req.EjarePrice1; sPrice2 = req.EjarePrice2; } var frm = new frmFilterForm(type, req.BuildingTypeGuid, req.BuildingAccountTypeGuid, req.RoomCount, req.Masahat1, req.Masahat2, fPrice1, sPrice1, fPrice2, sPrice2, req.RegionList.Select(q => q.RegionGuid).ToList()); frm.ShowDialog(this); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
public frmRequestMain(Guid guid, bool isShowMode) { InitializeComponent(); cls = BuildingRequestBussines.Get(guid); asker = PeoplesBussines.Get(cls.AskerGuid); ucHeader.Text = !isShowMode ? $"ویرایش تقاضای {cls.AskerName}" : $"مشاهده تقاضای {cls.AskerGuid}"; ucHeader.IsModified = cls.IsModified; superTabControlPanel1.Enabled = !isShowMode; superTabControlPanel2.Enabled = !isShowMode; superTabControlPanel3.Enabled = !isShowMode; btnFinish.Enabled = !isShowMode; superTabControl1.SelectedTab = superTabItem1; WindowState = FormWindowState.Maximized; }