protected void AddClientButton_Click(object sender, EventArgs e) { // Add client data to DB AddClients clients = new AddClients(); bool addSuccess = clients.AddClient(AddFirstNationName.Text); if (addSuccess) { string pageUrl = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.Count() - Request.Url.Query.Count()); Response.Redirect(pageUrl + "?ClientAdd=add"); } else { LabelStatus.Text = "Unable to add new client to database"; } }
/// <summary> /// Opens the NewCustomer form as a dialog box, /// which returns focus to the calling form when it is closed. /// </summary> private void btnGoToAdd_Click(object sender, EventArgs e) { Form frm = new AddClients(); frm.Show(); }