public static void Run(string prRegionName) { RegionForm lcRegionForm; if (string.IsNullOrEmpty(prRegionName) || !_RegionFormList.TryGetValue(prRegionName, out lcRegionForm)) { lcRegionForm = new RegionForm(); if (string.IsNullOrEmpty(prRegionName)) { lcRegionForm.SetDetails(new ClsRegion()); } else { _RegionFormList.Add(prRegionName, lcRegionForm); lcRegionForm.refreshFormFromDB(prRegionName); } } else { lcRegionForm.Show(); lcRegionForm.Activate(); } }
private void btnEditProperty_Click(object sender, EventArgs e) { int lcKey = lstProperty.SelectedIndex; if (lcKey > 0) { try { RegionForm.Run(lstProperty.SelectedItem as string); } catch (Exception ex) { MessageBox.Show(ex.Message, "This should never occur"); } } }
private void btnViewProp_Click(object sender, EventArgs e) { string lcKey; lcKey = Convert.ToString(lstRegion.SelectedItem); if (lcKey != null) { try { RegionForm.Run(lcKey); } catch (Exception ex) { MessageBox.Show(ex.Message, "This should never occur"); } } }