/// <summary> /// Event handler for the Add button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, System.EventArgs e) { // Unit object used to add the adminisrator BusinessServices.Unit objUnit; // The userif from the previous form int intUserID; // boolean flag indicating if the SubUnit option was checked bool blnAdminSubUnit; // Gather variables if (Request.Form["UserID"] == null) { this.lblMessage.Text = ResourceManager.GetString("lblMessage.NoUser");//"You did not select a user!"; this.lblMessage.CssClass = "WarningMessage"; } else { intUserID = int.Parse(Request.Form["UserID"]); blnAdminSubUnit = this.chkAdminSub.Checked; objUnit = new BusinessServices.Unit(); // Add Administrator to new unit objUnit.AddAdministrator(this.m_intUnitID, intUserID, blnAdminSubUnit, UserContext.UserID); Response.Redirect("UnitAdministrators.aspx?UnitID=" + m_intUnitID.ToString()); } }