private void btnAddNewSiteAddress_Click(object sender, EventArgs e) { try { if (cboBillingClient.SelectedItem == null) { MessageBox.Show("Select a Valid party to add its Site address.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } int selPartyID = ((SelectListItem)cboSiteClient.SelectedItem).ID; if (selPartyID == 0) { MessageBox.Show("Select a Valid party to add its Site address.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frmAddEditAddress frm = new frmAddEditAddress(); frm.SelectedPartyType = "C"; frm.SelectedPartyID = selPartyID; if (frm.ShowDialog() == DialogResult.OK) { PopulateSiteClientAddresses(); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditProject::btnAddNewSiteAddress_Click", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEditAddress_Click(object sender, EventArgs e) { try { frmAddEditAddress frm = new frmAddEditAddress(this.SelectedAddressID); frm.SelectedPartyType = this.SelectedPartyType; if (frm.ShowDialog() == DialogResult.OK) { PopulatePartyAddresses(); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "PageParties::btnEditAddress_Click", MessageBoxButtons.OK, MessageBoxIcon.Error); } }