protected void DvItemCommand(object sender, DetailsViewCommandEventArgs e)
        {
            string returnURL = "Default.aspx";
            if (e.CommandName.ToLower() == "back")
            {
                Response.Redirect(returnURL);
            }
            if (e.CommandName.ToLower() == "refresh")
            {
                try
                {
                    odsData.DataBind();
                    dv.DataBind();
                    dv.ChangeMode(DetailsViewMode.Edit);

                    var masterPage = (IControlRoomMaster)Master;
                    if (masterPage != null) masterPage.PageMessage = SRPResources.RefreshOK;
                }
                catch (Exception ex)
                {
                    var masterPage = (IControlRoomMaster)Master;
                    masterPage.PageError = String.Format(SRPResources.ApplicationError1, ex.Message);
                }
            }
            if (e.CommandName.ToLower() == "add" || e.CommandName.ToLower() == "addandback")
            {
                try
                {
                    var obj = new RegistrationSettings();
                    //obj.GenNotificationFlag = ((CheckBox)((DetailsView)sender).FindControl("TabContainer1").FindControl("TabPanel2").FindControl("GenNotificationFlag")).Checked;

                    obj.Literacy1Label = ((TextBox)((DetailsView)sender).FindControl("Literacy1Label")).Text;
                    obj.Literacy2Label = ((TextBox)((DetailsView)sender).FindControl("Literacy2Label")).Text;
                    obj.DOB_Prompt = ((CheckBox)((DetailsView)sender).FindControl("DOB_Prompt")).Checked;
                    obj.Age_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Age_Prompt")).Checked;
                    obj.SchoolGrade_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Prompt")).Checked;
                    obj.FirstName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Prompt")).Checked;
                    obj.MiddleName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Prompt")).Checked;
                    obj.LastName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LastName_Prompt")).Checked;
                    obj.Gender_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Gender_Prompt")).Checked;
                    obj.EmailAddress_Prompt = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Prompt")).Checked;
                    obj.PhoneNumber_Prompt = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Prompt")).Checked;
                    obj.StreetAddress1_Prompt = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Prompt")).Checked;
                    obj.StreetAddress2_Prompt = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Prompt")).Checked;
                    obj.City_Prompt = ((CheckBox)((DetailsView)sender).FindControl("City_Prompt")).Checked;
                    obj.State_Prompt = ((CheckBox)((DetailsView)sender).FindControl("State_Prompt")).Checked;
                    obj.ZipCode_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Prompt")).Checked;
                    obj.Country_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Country_Prompt")).Checked;
                    obj.County_Prompt = ((CheckBox)((DetailsView)sender).FindControl("County_Prompt")).Checked;
                    obj.ParentGuardianFirstName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Prompt")).Checked;
                    obj.ParentGuardianLastName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Prompt")).Checked;
                    obj.ParentGuardianMiddleName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Prompt")).Checked;
                    obj.PrimaryLibrary_Prompt = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Prompt")).Checked;
                    obj.LibraryCard_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Prompt")).Checked;
                    obj.SchoolName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Prompt")).Checked;
                    obj.District_Prompt = ((CheckBox)((DetailsView)sender).FindControl("District_Prompt")).Checked;
                    obj.SDistrict_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Prompt")).Checked;
                    obj.Teacher_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Prompt")).Checked;
                    obj.GroupTeamName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Prompt")).Checked;
                    obj.SchoolType_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Prompt")).Checked;
                    obj.LiteracyLevel1_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Prompt")).Checked;
                    obj.LiteracyLevel2_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Prompt")).Checked;
                    obj.ParentPermFlag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Prompt")).Checked;
                    obj.Over18Flag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Prompt")).Checked;
                    obj.ShareFlag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Prompt")).Checked;
                    obj.TermsOfUseflag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Prompt")).Checked;
                    obj.Custom1_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Prompt")).Checked;
                    obj.Custom2_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Prompt")).Checked;
                    obj.Custom3_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Prompt")).Checked;
                    obj.Custom4_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Prompt")).Checked;
                    obj.Custom5_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Prompt")).Checked;
                    obj.DOB_Req = ((CheckBox)((DetailsView)sender).FindControl("DOB_Req")).Checked;
                    obj.Age_Req = ((CheckBox)((DetailsView)sender).FindControl("Age_Req")).Checked;
                    obj.SchoolGrade_Req = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Req")).Checked;
                    obj.FirstName_Req = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Req")).Checked;
                    obj.MiddleName_Req = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Req")).Checked;
                    obj.LastName_Req = ((CheckBox)((DetailsView)sender).FindControl("LastName_Req")).Checked;
                    obj.Gender_Req = ((CheckBox)((DetailsView)sender).FindControl("Gender_Req")).Checked;
                    obj.EmailAddress_Req = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Req")).Checked;
                    obj.PhoneNumber_Req = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Req")).Checked;
                    obj.StreetAddress1_Req = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Req")).Checked;
                    obj.StreetAddress2_Req = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Req")).Checked;
                    obj.City_Req = ((CheckBox)((DetailsView)sender).FindControl("City_Req")).Checked;
                    obj.State_Req = ((CheckBox)((DetailsView)sender).FindControl("State_Req")).Checked;
                    obj.ZipCode_Req = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Req")).Checked;
                    obj.Country_Req = ((CheckBox)((DetailsView)sender).FindControl("Country_Req")).Checked;
                    obj.County_Req = ((CheckBox)((DetailsView)sender).FindControl("County_Req")).Checked;
                    obj.ParentGuardianFirstName_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Req")).Checked;
                    obj.ParentGuardianLastName_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Req")).Checked;
                    obj.ParentGuardianMiddleName_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Req")).Checked;
                    obj.PrimaryLibrary_Req = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Req")).Checked;
                    obj.LibraryCard_Req = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Req")).Checked;
                    obj.SchoolName_Req = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Req")).Checked;
                    obj.District_Req = ((CheckBox)((DetailsView)sender).FindControl("District_Req")).Checked;
                    obj.SDistrict_Req = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Req")).Checked;
                    obj.Teacher_Req = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Req")).Checked;
                    obj.GroupTeamName_Req = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Req")).Checked;
                    obj.SchoolType_Req = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Req")).Checked;
                    obj.LiteracyLevel1_Req = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Req")).Checked;
                    obj.LiteracyLevel2_Req = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Req")).Checked;
                    obj.ParentPermFlag_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Req")).Checked;
                    obj.Over18Flag_Req = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Req")).Checked;
                    obj.ShareFlag_Req = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Req")).Checked;
                    obj.TermsOfUseflag_Req = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Req")).Checked;
                    obj.Custom1_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Req")).Checked;
                    obj.Custom2_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Req")).Checked;
                    obj.Custom3_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Req")).Checked;
                    obj.Custom4_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Req")).Checked;
                    obj.Custom5_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Req")).Checked;
                    obj.DOB_Show = ((CheckBox)((DetailsView)sender).FindControl("DOB_Show")).Checked;
                    obj.Age_Show = ((CheckBox)((DetailsView)sender).FindControl("Age_Show")).Checked;
                    obj.SchoolGrade_Show = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Show")).Checked;
                    obj.FirstName_Show = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Show")).Checked;
                    obj.MiddleName_Show = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Show")).Checked;
                    obj.LastName_Show = ((CheckBox)((DetailsView)sender).FindControl("LastName_Show")).Checked;
                    obj.Gender_Show = ((CheckBox)((DetailsView)sender).FindControl("Gender_Show")).Checked;
                    obj.EmailAddress_Show = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Show")).Checked;
                    obj.PhoneNumber_Show = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Show")).Checked;
                    obj.StreetAddress1_Show = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Show")).Checked;
                    obj.StreetAddress2_Show = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Show")).Checked;
                    obj.City_Show = ((CheckBox)((DetailsView)sender).FindControl("City_Show")).Checked;
                    obj.State_Show = ((CheckBox)((DetailsView)sender).FindControl("State_Show")).Checked;
                    obj.ZipCode_Show = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Show")).Checked;
                    obj.Country_Show = ((CheckBox)((DetailsView)sender).FindControl("Country_Show")).Checked;
                    obj.County_Show = ((CheckBox)((DetailsView)sender).FindControl("County_Show")).Checked;
                    obj.ParentGuardianFirstName_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Show")).Checked;
                    obj.ParentGuardianLastName_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Show")).Checked;
                    obj.ParentGuardianMiddleName_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Show")).Checked;
                    obj.PrimaryLibrary_Show = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Show")).Checked;
                    obj.LibraryCard_Show = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Show")).Checked;
                    obj.SchoolName_Show = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Show")).Checked;
                    obj.District_Show = ((CheckBox)((DetailsView)sender).FindControl("District_Show")).Checked;
                    obj.SDistrict_Show = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Show")).Checked;
                    obj.Teacher_Show = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Show")).Checked;
                    obj.GroupTeamName_Show = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Show")).Checked;
                    obj.SchoolType_Show = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Show")).Checked;
                    obj.LiteracyLevel1_Show = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Show")).Checked;
                    obj.LiteracyLevel2_Show = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Show")).Checked;
                    obj.ParentPermFlag_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Show")).Checked;
                    obj.Over18Flag_Show = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Show")).Checked;
                    obj.ShareFlag_Show = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Show")).Checked;
                    obj.TermsOfUseflag_Show = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Show")).Checked;
                    obj.Custom1_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Show")).Checked;
                    obj.Custom2_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Show")).Checked;
                    obj.Custom3_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Show")).Checked;
                    obj.Custom4_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Show")).Checked;
                    obj.Custom5_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Show")).Checked;
                    obj.DOB_Edit = ((CheckBox)((DetailsView)sender).FindControl("DOB_Edit")).Checked;
                    obj.Age_Edit = ((CheckBox)((DetailsView)sender).FindControl("Age_Edit")).Checked;
                    obj.SchoolGrade_Edit = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Edit")).Checked;
                    obj.FirstName_Edit = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Edit")).Checked;
                    obj.MiddleName_Edit = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Edit")).Checked;
                    obj.LastName_Edit = ((CheckBox)((DetailsView)sender).FindControl("LastName_Edit")).Checked;
                    obj.Gender_Edit = ((CheckBox)((DetailsView)sender).FindControl("Gender_Edit")).Checked;
                    obj.EmailAddress_Edit = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Edit")).Checked;
                    obj.PhoneNumber_Edit = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Edit")).Checked;
                    obj.StreetAddress1_Edit = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Edit")).Checked;
                    obj.StreetAddress2_Edit = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Edit")).Checked;
                    obj.City_Edit = ((CheckBox)((DetailsView)sender).FindControl("City_Edit")).Checked;
                    obj.State_Edit = ((CheckBox)((DetailsView)sender).FindControl("State_Edit")).Checked;
                    obj.ZipCode_Edit = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Edit")).Checked;
                    obj.Country_Edit = ((CheckBox)((DetailsView)sender).FindControl("Country_Edit")).Checked;
                    obj.County_Edit = ((CheckBox)((DetailsView)sender).FindControl("County_Edit")).Checked;
                    obj.ParentGuardianFirstName_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Edit")).Checked;
                    obj.ParentGuardianLastName_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Edit")).Checked;
                    obj.ParentGuardianMiddleName_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Edit")).Checked;
                    obj.PrimaryLibrary_Edit = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Edit")).Checked;
                    obj.LibraryCard_Edit = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Edit")).Checked;
                    obj.SchoolName_Edit = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Edit")).Checked;
                    obj.District_Edit = ((CheckBox)((DetailsView)sender).FindControl("District_Edit")).Checked;
                    obj.SDistrict_Edit = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Edit")).Checked;
                    obj.Teacher_Edit = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Edit")).Checked;
                    obj.GroupTeamName_Edit = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Edit")).Checked;
                    obj.SchoolType_Edit = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Edit")).Checked;
                    obj.LiteracyLevel1_Edit = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Edit")).Checked;
                    obj.LiteracyLevel2_Edit = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Edit")).Checked;
                    obj.ParentPermFlag_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Edit")).Checked;
                    obj.Over18Flag_Edit = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Edit")).Checked;
                    obj.ShareFlag_Edit = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Edit")).Checked;
                    obj.TermsOfUseflag_Edit = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Edit")).Checked;
                    obj.Custom1_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Edit")).Checked;
                    obj.Custom2_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Edit")).Checked;
                    obj.Custom3_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Edit")).Checked;
                    obj.Custom4_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Edit")).Checked;
                    obj.Custom5_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Edit")).Checked;

                    obj.AddedDate = DateTime.Now;
                    obj.AddedUser = ((SRPUser)Session[SessionData.UserProfile.ToString()]).Username;  //"N/A";  // Get from session
                    obj.LastModDate = obj.AddedDate;
                    obj.LastModUser = obj.AddedUser;

                    if (obj.IsValid(BusinessRulesValidationMode.INSERT))
                    {
                        obj.Insert();
                        if (e.CommandName.ToLower() == "addandback")
                        {
                            Response.Redirect(returnURL);
                        }

                        lblPK.Text = obj.RID.ToString();

                        odsData.DataBind();
                        dv.DataBind();
                        dv.ChangeMode(DetailsViewMode.Edit);

                        var masterPage = (IControlRoomMaster)Master;
                        masterPage.PageMessage = SRPResources.AddedOK;
                    }
                    else
                    {
                        var masterPage = (IControlRoomMaster)Master;
                        string message = String.Format(SRPResources.ApplicationError1, "<ul>");
                        foreach (BusinessRulesValidationMessage m in obj.ErrorCodes)
                        {
                            message = string.Format(String.Format("{0}<li>{{0}}</li>", message), m.ErrorMessage);
                        }
                        message = string.Format("{0}</ul>", message);
                        masterPage.PageError = message;
                    }
                }
                catch (Exception ex)
                {
                    var masterPage = (IControlRoomMaster)Master;
                    masterPage.PageError = String.Format(SRPResources.ApplicationError1, ex.Message);
                }
            }
            if (e.CommandName.ToLower() == "save" || e.CommandName.ToLower() == "saveandback")
            {
                try
                {
                    var obj = new RegistrationSettings();
                    //int pk = 0;// int.Parse(((DetailsView)sender).Rows[0].Cells[1].Text);
                    obj.Fetch();

                    obj.Literacy1Label = ((TextBox)((DetailsView)sender).FindControl("Literacy1Label")).Text;
                    obj.Literacy2Label = ((TextBox)((DetailsView)sender).FindControl("Literacy2Label")).Text;
                    obj.DOB_Prompt = ((CheckBox)((DetailsView)sender).FindControl("DOB_Prompt")).Checked;
                    obj.Age_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Age_Prompt")).Checked;
                    obj.SchoolGrade_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Prompt")).Checked;
                    obj.FirstName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Prompt")).Checked;
                    obj.MiddleName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Prompt")).Checked;
                    obj.LastName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LastName_Prompt")).Checked;
                    obj.Gender_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Gender_Prompt")).Checked;
                    obj.EmailAddress_Prompt = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Prompt")).Checked;
                    obj.PhoneNumber_Prompt = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Prompt")).Checked;
                    obj.StreetAddress1_Prompt = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Prompt")).Checked;
                    obj.StreetAddress2_Prompt = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Prompt")).Checked;
                    obj.City_Prompt = ((CheckBox)((DetailsView)sender).FindControl("City_Prompt")).Checked;
                    obj.State_Prompt = ((CheckBox)((DetailsView)sender).FindControl("State_Prompt")).Checked;
                    obj.ZipCode_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Prompt")).Checked;
                    obj.Country_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Country_Prompt")).Checked;
                    obj.County_Prompt = ((CheckBox)((DetailsView)sender).FindControl("County_Prompt")).Checked;
                    obj.ParentGuardianFirstName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Prompt")).Checked;
                    obj.ParentGuardianLastName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Prompt")).Checked;
                    obj.ParentGuardianMiddleName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Prompt")).Checked;
                    obj.PrimaryLibrary_Prompt = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Prompt")).Checked;
                    obj.LibraryCard_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Prompt")).Checked;
                    obj.SchoolName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Prompt")).Checked;
                    obj.District_Prompt = ((CheckBox)((DetailsView)sender).FindControl("District_Prompt")).Checked;
                    obj.SDistrict_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Prompt")).Checked;
                    obj.Teacher_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Prompt")).Checked;
                    obj.GroupTeamName_Prompt = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Prompt")).Checked;
                    obj.SchoolType_Prompt = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Prompt")).Checked;
                    obj.LiteracyLevel1_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Prompt")).Checked;
                    obj.LiteracyLevel2_Prompt = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Prompt")).Checked;
                    obj.ParentPermFlag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Prompt")).Checked;
                    obj.Over18Flag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Prompt")).Checked;
                    obj.ShareFlag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Prompt")).Checked;
                    obj.TermsOfUseflag_Prompt = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Prompt")).Checked;
                    obj.Custom1_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Prompt")).Checked;
                    obj.Custom2_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Prompt")).Checked;
                    obj.Custom3_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Prompt")).Checked;
                    obj.Custom4_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Prompt")).Checked;
                    obj.Custom5_Prompt = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Prompt")).Checked;
                    obj.DOB_Req = ((CheckBox)((DetailsView)sender).FindControl("DOB_Req")).Checked;
                    obj.Age_Req = ((CheckBox)((DetailsView)sender).FindControl("Age_Req")).Checked;
                    obj.SchoolGrade_Req = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Req")).Checked;
                    obj.FirstName_Req = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Req")).Checked;
                    obj.MiddleName_Req = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Req")).Checked;
                    obj.LastName_Req = ((CheckBox)((DetailsView)sender).FindControl("LastName_Req")).Checked;
                    obj.Gender_Req = ((CheckBox)((DetailsView)sender).FindControl("Gender_Req")).Checked;
                    obj.EmailAddress_Req = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Req")).Checked;
                    obj.PhoneNumber_Req = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Req")).Checked;
                    obj.StreetAddress1_Req = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Req")).Checked;
                    obj.StreetAddress2_Req = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Req")).Checked;
                    obj.City_Req = ((CheckBox)((DetailsView)sender).FindControl("City_Req")).Checked;
                    obj.State_Req = ((CheckBox)((DetailsView)sender).FindControl("State_Req")).Checked;
                    obj.ZipCode_Req = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Req")).Checked;
                    obj.Country_Req = ((CheckBox)((DetailsView)sender).FindControl("Country_Req")).Checked;
                    obj.County_Req = ((CheckBox)((DetailsView)sender).FindControl("County_Req")).Checked;
                    obj.ParentGuardianFirstName_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Req")).Checked;
                    obj.ParentGuardianLastName_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Req")).Checked;
                    obj.ParentGuardianMiddleName_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Req")).Checked;
                    obj.PrimaryLibrary_Req = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Req")).Checked;
                    obj.LibraryCard_Req = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Req")).Checked;
                    obj.SchoolName_Req = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Req")).Checked;
                    obj.District_Req = ((CheckBox)((DetailsView)sender).FindControl("District_Req")).Checked;
                    obj.SDistrict_Req = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Req")).Checked;
                    obj.Teacher_Req = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Req")).Checked;
                    obj.GroupTeamName_Req = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Req")).Checked;
                    obj.SchoolType_Req = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Req")).Checked;
                    obj.LiteracyLevel1_Req = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Req")).Checked;
                    obj.LiteracyLevel2_Req = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Req")).Checked;
                    obj.ParentPermFlag_Req = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Req")).Checked;
                    obj.Over18Flag_Req = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Req")).Checked;
                    obj.ShareFlag_Req = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Req")).Checked;
                    obj.TermsOfUseflag_Req = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Req")).Checked;
                    obj.Custom1_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Req")).Checked;
                    obj.Custom2_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Req")).Checked;
                    obj.Custom3_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Req")).Checked;
                    obj.Custom4_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Req")).Checked;
                    obj.Custom5_Req = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Req")).Checked;
                    obj.DOB_Show = ((CheckBox)((DetailsView)sender).FindControl("DOB_Show")).Checked;
                    obj.Age_Show = ((CheckBox)((DetailsView)sender).FindControl("Age_Show")).Checked;
                    obj.SchoolGrade_Show = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Show")).Checked;
                    obj.FirstName_Show = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Show")).Checked;
                    obj.MiddleName_Show = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Show")).Checked;
                    obj.LastName_Show = ((CheckBox)((DetailsView)sender).FindControl("LastName_Show")).Checked;
                    obj.Gender_Show = ((CheckBox)((DetailsView)sender).FindControl("Gender_Show")).Checked;
                    obj.EmailAddress_Show = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Show")).Checked;
                    obj.PhoneNumber_Show = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Show")).Checked;
                    obj.StreetAddress1_Show = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Show")).Checked;
                    obj.StreetAddress2_Show = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Show")).Checked;
                    obj.City_Show = ((CheckBox)((DetailsView)sender).FindControl("City_Show")).Checked;
                    obj.State_Show = ((CheckBox)((DetailsView)sender).FindControl("State_Show")).Checked;
                    obj.ZipCode_Show = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Show")).Checked;
                    obj.Country_Show = ((CheckBox)((DetailsView)sender).FindControl("Country_Show")).Checked;
                    obj.County_Show = ((CheckBox)((DetailsView)sender).FindControl("County_Show")).Checked;
                    obj.ParentGuardianFirstName_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Show")).Checked;
                    obj.ParentGuardianLastName_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Show")).Checked;
                    obj.ParentGuardianMiddleName_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Show")).Checked;
                    obj.PrimaryLibrary_Show = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Show")).Checked;
                    obj.LibraryCard_Show = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Show")).Checked;
                    obj.SchoolName_Show = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Show")).Checked;
                    obj.District_Show = ((CheckBox)((DetailsView)sender).FindControl("District_Show")).Checked;
                    obj.SDistrict_Show = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Show")).Checked;
                    obj.Teacher_Show = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Show")).Checked;
                    obj.GroupTeamName_Show = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Show")).Checked;
                    obj.SchoolType_Show = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Show")).Checked;
                    obj.LiteracyLevel1_Show = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Show")).Checked;
                    obj.LiteracyLevel2_Show = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Show")).Checked;
                    obj.ParentPermFlag_Show = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Show")).Checked;
                    obj.Over18Flag_Show = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Show")).Checked;
                    obj.ShareFlag_Show = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Show")).Checked;
                    obj.TermsOfUseflag_Show = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Show")).Checked;
                    obj.Custom1_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Show")).Checked;
                    obj.Custom2_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Show")).Checked;
                    obj.Custom3_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Show")).Checked;
                    obj.Custom4_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Show")).Checked;
                    obj.Custom5_Show = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Show")).Checked;
                    obj.DOB_Edit = ((CheckBox)((DetailsView)sender).FindControl("DOB_Edit")).Checked;
                    obj.Age_Edit = ((CheckBox)((DetailsView)sender).FindControl("Age_Edit")).Checked;
                    obj.SchoolGrade_Edit = ((CheckBox)((DetailsView)sender).FindControl("SchoolGrade_Edit")).Checked;
                    obj.FirstName_Edit = ((CheckBox)((DetailsView)sender).FindControl("FirstName_Edit")).Checked;
                    obj.MiddleName_Edit = ((CheckBox)((DetailsView)sender).FindControl("MiddleName_Edit")).Checked;
                    obj.LastName_Edit = ((CheckBox)((DetailsView)sender).FindControl("LastName_Edit")).Checked;
                    obj.Gender_Edit = ((CheckBox)((DetailsView)sender).FindControl("Gender_Edit")).Checked;
                    obj.EmailAddress_Edit = ((CheckBox)((DetailsView)sender).FindControl("EmailAddress_Edit")).Checked;
                    obj.PhoneNumber_Edit = ((CheckBox)((DetailsView)sender).FindControl("PhoneNumber_Edit")).Checked;
                    obj.StreetAddress1_Edit = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress1_Edit")).Checked;
                    obj.StreetAddress2_Edit = ((CheckBox)((DetailsView)sender).FindControl("StreetAddress2_Edit")).Checked;
                    obj.City_Edit = ((CheckBox)((DetailsView)sender).FindControl("City_Edit")).Checked;
                    obj.State_Edit = ((CheckBox)((DetailsView)sender).FindControl("State_Edit")).Checked;
                    obj.ZipCode_Edit = ((CheckBox)((DetailsView)sender).FindControl("ZipCode_Edit")).Checked;
                    obj.Country_Edit = ((CheckBox)((DetailsView)sender).FindControl("Country_Edit")).Checked;
                    obj.County_Edit = ((CheckBox)((DetailsView)sender).FindControl("County_Edit")).Checked;
                    obj.ParentGuardianFirstName_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianFirstName_Edit")).Checked;
                    obj.ParentGuardianLastName_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianLastName_Edit")).Checked;
                    obj.ParentGuardianMiddleName_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentGuardianMiddleName_Edit")).Checked;
                    obj.PrimaryLibrary_Edit = ((CheckBox)((DetailsView)sender).FindControl("PrimaryLibrary_Edit")).Checked;
                    obj.LibraryCard_Edit = ((CheckBox)((DetailsView)sender).FindControl("LibraryCard_Edit")).Checked;
                    obj.SchoolName_Edit = ((CheckBox)((DetailsView)sender).FindControl("SchoolName_Edit")).Checked;
                    obj.District_Edit = ((CheckBox)((DetailsView)sender).FindControl("District_Edit")).Checked;
                    obj.SDistrict_Edit = ((CheckBox)((DetailsView)sender).FindControl("SDistrict_Edit")).Checked;
                    obj.Teacher_Edit = ((CheckBox)((DetailsView)sender).FindControl("Teacher_Edit")).Checked;
                    obj.GroupTeamName_Edit = ((CheckBox)((DetailsView)sender).FindControl("GroupTeamName_Edit")).Checked;
                    obj.SchoolType_Edit = ((CheckBox)((DetailsView)sender).FindControl("SchoolType_Edit")).Checked;
                    obj.LiteracyLevel1_Edit = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel1_Edit")).Checked;
                    obj.LiteracyLevel2_Edit = ((CheckBox)((DetailsView)sender).FindControl("LiteracyLevel2_Edit")).Checked;
                    obj.ParentPermFlag_Edit = ((CheckBox)((DetailsView)sender).FindControl("ParentPermFlag_Edit")).Checked;
                    obj.Over18Flag_Edit = ((CheckBox)((DetailsView)sender).FindControl("Over18Flag_Edit")).Checked;
                    obj.ShareFlag_Edit = ((CheckBox)((DetailsView)sender).FindControl("ShareFlag_Edit")).Checked;
                    obj.TermsOfUseflag_Edit = ((CheckBox)((DetailsView)sender).FindControl("TermsOfUseflag_Edit")).Checked;
                    obj.Custom1_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom1_Edit")).Checked;
                    obj.Custom2_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom2_Edit")).Checked;
                    obj.Custom3_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom3_Edit")).Checked;
                    obj.Custom4_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom4_Edit")).Checked;
                    obj.Custom5_Edit = ((CheckBox)((DetailsView)sender).FindControl("Custom5_Edit")).Checked;

                    obj.LastModDate = DateTime.Now;
                    obj.LastModUser = ((SRPUser)Session[SessionData.UserProfile.ToString()]).Username;  //"N/A";  // Get from session

                    if (obj.IsValid(BusinessRulesValidationMode.UPDATE))
                    {
                        obj.Update();
                        if (e.CommandName.ToLower() == "saveandback")
                        {
                            Response.Redirect(returnURL);
                        }

                        odsData.DataBind();
                        dv.DataBind();
                        dv.ChangeMode(DetailsViewMode.Edit);

                        var masterPage = (IControlRoomMaster)Master;
                        masterPage.PageMessage = SRPResources.SaveOK;
                    }
                    else
                    {
                        var masterPage = (IControlRoomMaster)Master;
                        string message = String.Format(SRPResources.ApplicationError1, "<ul>");
                        foreach (BusinessRulesValidationMessage m in obj.ErrorCodes)
                        {
                            message = string.Format(String.Format("{0}<li>{{0}}</li>", message), m.ErrorMessage);
                        }
                        message = string.Format("{0}</ul>", message);
                        masterPage.PageError = message;
                    }
                }
                catch (Exception ex)
                {
                    var masterPage = (IControlRoomMaster)Master;
                    masterPage.PageError = String.Format(SRPResources.ApplicationError1, ex.Message);
                }
            }
        }
        protected void DvItemCommand(object sender, DetailsViewCommandEventArgs e)
        {
            string returnURL = "Default.aspx";
            if (e.CommandName.ToLower() == "back")
            {
                Response.Redirect(returnURL);
            }
            if (e.CommandName.ToLower() == "codes")
            {
                Response.Redirect("Codes.aspx");
            }

            if (e.CommandName.ToLower() == "refresh")
            {
                try
                {
                    odsData.DataBind();
                    dv.DataBind();
                    dv.ChangeMode(DetailsViewMode.Edit);

                    var masterPage = (IControlRoomMaster)Master;
                    if (masterPage != null) masterPage.PageMessage = SRPResources.RefreshOK;
                }
                catch (Exception ex)
                {
                    var masterPage = (IControlRoomMaster)Master;
                    masterPage.PageError = String.Format(SRPResources.ApplicationError1, ex.Message);
                }
            }
            
            if (e.CommandName.ToLower() == "save" || e.CommandName.ToLower() == "saveandback")
            {
                try
                {
                    var obj = DAL.CustomRegistrationFields.FetchObject();
                    //int pk = 1;

                    obj.Label1 = ((TextBox)((DetailsView)sender).FindControl("Label1")).Text;
                    obj.Label2 = ((TextBox)((DetailsView)sender).FindControl("Label2")).Text;
                    obj.Label3 = ((TextBox)((DetailsView)sender).FindControl("Label3")).Text;
                    obj.Label4 = ((TextBox)((DetailsView)sender).FindControl("Label4")).Text;
                    obj.Label5 = ((TextBox)((DetailsView)sender).FindControl("Label5")).Text;

                    obj.Use1 = ((CheckBox)((DetailsView)sender).FindControl("Use1")).Checked;
                    obj.Use2 = ((CheckBox)((DetailsView)sender).FindControl("Use2")).Checked;
                    obj.Use3 = ((CheckBox)((DetailsView)sender).FindControl("Use3")).Checked;
                    obj.Use4 = ((CheckBox)((DetailsView)sender).FindControl("Use4")).Checked;
                    obj.Use5 = ((CheckBox)((DetailsView)sender).FindControl("Use5")).Checked;

                    obj.DDValues1 = ((DropDownList)((DetailsView)sender).FindControl("DDValues1")).SelectedValue;
                    obj.DDValues2 = ((DropDownList)((DetailsView)sender).FindControl("DDValues2")).SelectedValue;
                    obj.DDValues3 = ((DropDownList)((DetailsView)sender).FindControl("DDValues3")).SelectedValue;
                    obj.DDValues4 = ((DropDownList)((DetailsView)sender).FindControl("DDValues4")).SelectedValue;
                    obj.DDValues5 = ((DropDownList)((DetailsView)sender).FindControl("DDValues5")).SelectedValue;

                    obj.LastModDate = DateTime.Now;
                    obj.LastModUser = ((SRPUser)Session[SessionData.UserProfile.ToString()]).Username;  //"N/A";  // Get from session

                    if (obj.IsValid(BusinessRulesValidationMode.UPDATE))
                    {
                        obj.Update();
                        if (!obj.Use1)
                        {
                            var o2 = new RegistrationSettings();
                            o2.Fetch(0);
                            o2.Custom1_Req = o2.Custom1_Edit = o2.Custom1_Prompt = o2.Custom1_Show = false;
                            o2.Update();
                        }
                        if (!obj.Use2)
                        {
                            var o2 = new RegistrationSettings();
                            o2.Fetch(0);
                            o2.Custom2_Req = o2.Custom2_Edit = o2.Custom2_Prompt = o2.Custom2_Show = false;
                            o2.Update();
                        }
                        if (!obj.Use3)
                        {
                            var o2 = new RegistrationSettings();
                            o2.Fetch(0);
                            o2.Custom3_Req = o2.Custom3_Edit = o2.Custom3_Prompt = o2.Custom3_Show = false;
                            o2.Update();
                        }
                        if (!obj.Use4)
                        {
                            var o2 = new RegistrationSettings();
                            o2.Fetch(0);
                            o2.Custom4_Req = o2.Custom4_Edit = o2.Custom4_Prompt = o2.Custom4_Show = false;
                            o2.Update();
                        }
                        if (!obj.Use5)
                        {
                            var o2 = new RegistrationSettings();
                            o2.Fetch(0);
                            o2.Custom5_Req = o2.Custom5_Edit = o2.Custom5_Prompt = o2.Custom5_Show = false;
                            o2.Update();
                        }


                        if (e.CommandName.ToLower() == "saveandback")
                        {
                            Response.Redirect(returnURL);
                        }

                        odsData.DataBind();
                        dv.DataBind();
                        dv.ChangeMode(DetailsViewMode.Edit);

                        var masterPage = (IControlRoomMaster)Master;
                        masterPage.PageMessage = SRPResources.SaveOK;
                    }
                    else
                    {
                        var masterPage = (IControlRoomMaster)Master;
                        string message = String.Format(SRPResources.ApplicationError1, "<ul>");
                        foreach (BusinessRulesValidationMessage m in obj.ErrorCodes)
                        {
                            message = string.Format(String.Format("{0}<li>{{0}}</li>", message), m.ErrorMessage);
                        }
                        message = string.Format("{0}</ul>", message);
                        masterPage.PageError = message;
                    }
                }
                catch (Exception ex)
                {
                    var masterPage = (IControlRoomMaster)Master;
                    masterPage.PageError = String.Format(SRPResources.ApplicationError1, ex.Message);
                }
            }
        }
        public static int Update(RegistrationSettings o)
        {

            int iReturn = -1; //assume the worst

            var arrParams = new List<SqlParameter>();

            arrParams.Add(new SqlParameter("@RID", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.RID, o.RID.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Literacy1Label", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Literacy1Label, o.Literacy1Label.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Literacy2Label", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Literacy2Label, o.Literacy2Label.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Prompt, o.DOB_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Prompt, o.Age_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Prompt, o.SchoolGrade_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Prompt, o.FirstName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Prompt, o.MiddleName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Prompt, o.LastName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Prompt, o.Gender_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Prompt, o.EmailAddress_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Prompt, o.PhoneNumber_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Prompt, o.StreetAddress1_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Prompt, o.StreetAddress2_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Prompt, o.City_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Prompt, o.State_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Prompt, o.ZipCode_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Prompt, o.Country_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Prompt, o.County_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Prompt, o.ParentGuardianFirstName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Prompt, o.ParentGuardianLastName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Prompt, o.ParentGuardianMiddleName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Prompt, o.PrimaryLibrary_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Prompt, o.LibraryCard_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Prompt, o.SchoolName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Prompt, o.District_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Prompt, o.Teacher_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Prompt, o.GroupTeamName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Prompt, o.SchoolType_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Prompt, o.LiteracyLevel1_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Prompt, o.LiteracyLevel2_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Prompt, o.ParentPermFlag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Prompt, o.Over18Flag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Prompt, o.ShareFlag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Prompt, o.TermsOfUseflag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Prompt, o.Custom1_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Prompt, o.Custom2_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Prompt, o.Custom3_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Prompt, o.Custom4_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Prompt, o.Custom5_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Req, o.DOB_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Req, o.Age_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Req, o.SchoolGrade_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Req, o.FirstName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Req, o.MiddleName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Req, o.LastName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Req, o.Gender_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Req, o.EmailAddress_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Req, o.PhoneNumber_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Req, o.StreetAddress1_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Req, o.StreetAddress2_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Req, o.City_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Req, o.State_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Req, o.ZipCode_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Req, o.Country_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Req, o.County_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Req, o.ParentGuardianFirstName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Req, o.ParentGuardianLastName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Req, o.ParentGuardianMiddleName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Req, o.PrimaryLibrary_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Req, o.LibraryCard_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Req, o.SchoolName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Req, o.District_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Req, o.Teacher_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Req, o.GroupTeamName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Req, o.SchoolType_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Req, o.LiteracyLevel1_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Req, o.LiteracyLevel2_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Req, o.ParentPermFlag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Req, o.Over18Flag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Req, o.ShareFlag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Req, o.TermsOfUseflag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Req, o.Custom1_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Req, o.Custom2_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Req, o.Custom3_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Req, o.Custom4_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Req, o.Custom5_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Show, o.DOB_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Show, o.Age_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Show, o.SchoolGrade_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Show, o.FirstName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Show, o.MiddleName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Show, o.LastName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Show, o.Gender_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Show, o.EmailAddress_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Show, o.PhoneNumber_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Show, o.StreetAddress1_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Show, o.StreetAddress2_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Show, o.City_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Show, o.State_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Show, o.ZipCode_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Show, o.Country_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Show, o.County_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Show, o.ParentGuardianFirstName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Show, o.ParentGuardianLastName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Show, o.ParentGuardianMiddleName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Show, o.PrimaryLibrary_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Show, o.LibraryCard_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Show, o.SchoolName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Show, o.District_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Show, o.Teacher_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Show, o.GroupTeamName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Show, o.SchoolType_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Show, o.LiteracyLevel1_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Show, o.LiteracyLevel2_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Show, o.ParentPermFlag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Show, o.Over18Flag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Show, o.ShareFlag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Show, o.TermsOfUseflag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Show, o.Custom1_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Show, o.Custom2_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Show, o.Custom3_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Show, o.Custom4_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Show, o.Custom5_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Edit, o.DOB_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Edit, o.Age_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Edit, o.SchoolGrade_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Edit, o.FirstName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Edit, o.MiddleName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Edit, o.LastName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Edit, o.Gender_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Edit, o.EmailAddress_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Edit, o.PhoneNumber_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Edit, o.StreetAddress1_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Edit, o.StreetAddress2_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Edit, o.City_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Edit, o.State_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Edit, o.ZipCode_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Edit, o.Country_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Edit, o.County_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Edit, o.ParentGuardianFirstName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Edit, o.ParentGuardianLastName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Edit, o.ParentGuardianMiddleName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Edit, o.PrimaryLibrary_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Edit, o.LibraryCard_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Edit, o.SchoolName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Edit, o.District_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Edit, o.Teacher_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Edit, o.GroupTeamName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Edit, o.SchoolType_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Edit, o.LiteracyLevel1_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Edit, o.LiteracyLevel2_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Edit, o.ParentPermFlag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Edit, o.Over18Flag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Edit, o.ShareFlag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Edit, o.TermsOfUseflag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Edit, o.Custom1_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Edit, o.Custom2_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Edit, o.Custom3_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Edit, o.Custom4_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Edit, o.Custom5_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastModDate", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastModDate, o.LastModDate.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastModUser", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastModUser, o.LastModUser.GetTypeCode())));
            arrParams.Add(new SqlParameter("@AddedDate", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.AddedDate, o.AddedDate.GetTypeCode())));
            arrParams.Add(new SqlParameter("@AddedUser", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.AddedUser, o.AddedUser.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SDistrict_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Prompt, o.SDistrict_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SDistrict_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Req, o.SDistrict_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SDistrict_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Show, o.SDistrict_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SDistrict_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Edit, o.SDistrict_Edit.GetTypeCode())));


            arrParams.Add(new SqlParameter("@Goal_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Prompt, o.Goal_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Goal_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Req, o.Goal_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Goal_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Show, o.Goal_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Goal_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Edit, o.Goal_Edit.GetTypeCode())));



            arrParams.Add(new SqlParameter("@TenID", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TenID, o.TenID.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldInt1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt1, o.FldInt1.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldInt2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt2, o.FldInt2.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldInt3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt3, o.FldInt3.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldBit1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit1, o.FldBit1.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldBit2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit2, o.FldBit2.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldBit3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit3, o.FldBit3.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldText1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText1, o.FldText1.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldText2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText2, o.FldText2.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldText3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText3, o.FldText3.GetTypeCode())));

	
            try
            {

                iReturn = SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, "app_RegistrationSettings_Update", arrParams.ToArray());

            }

            catch (SqlException exx)
            {

                System.Diagnostics.Debug.Write(exx.Message);

            }

            return iReturn;

        }
        public static int Insert(RegistrationSettings o)
        {

            var arrParams = new List<SqlParameter>();

            arrParams.Add(new SqlParameter("@Literacy1Label", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Literacy1Label, o.Literacy1Label.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Literacy2Label", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Literacy2Label, o.Literacy2Label.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Prompt, o.DOB_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Prompt, o.Age_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Prompt, o.SchoolGrade_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Prompt, o.FirstName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Prompt, o.MiddleName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Prompt, o.LastName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Prompt, o.Gender_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Prompt, o.EmailAddress_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Prompt, o.PhoneNumber_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Prompt, o.StreetAddress1_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Prompt, o.StreetAddress2_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Prompt, o.City_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Prompt, o.State_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Prompt, o.ZipCode_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Prompt, o.Country_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Prompt, o.County_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Prompt, o.ParentGuardianFirstName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Prompt, o.ParentGuardianLastName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Prompt, o.ParentGuardianMiddleName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Prompt, o.PrimaryLibrary_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Prompt, o.LibraryCard_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Prompt, o.SchoolName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Prompt, o.District_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Prompt, o.Teacher_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Prompt, o.GroupTeamName_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Prompt, o.SchoolType_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Prompt, o.LiteracyLevel1_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Prompt, o.LiteracyLevel2_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Prompt, o.ParentPermFlag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Prompt, o.Over18Flag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Prompt, o.ShareFlag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Prompt, o.TermsOfUseflag_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Prompt, o.Custom1_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Prompt, o.Custom2_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Prompt, o.Custom3_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Prompt, o.Custom4_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Prompt, o.Custom5_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Req, o.DOB_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Req, o.Age_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Req, o.SchoolGrade_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Req, o.FirstName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Req, o.MiddleName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Req, o.LastName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Req, o.Gender_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Req, o.EmailAddress_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Req, o.PhoneNumber_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Req, o.StreetAddress1_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Req, o.StreetAddress2_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Req, o.City_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Req, o.State_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Req, o.ZipCode_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Req, o.Country_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Req, o.County_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Req, o.ParentGuardianFirstName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Req, o.ParentGuardianLastName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Req, o.ParentGuardianMiddleName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Req, o.PrimaryLibrary_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Req, o.LibraryCard_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Req, o.SchoolName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Req, o.District_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Req, o.Teacher_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Req, o.GroupTeamName_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Req, o.SchoolType_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Req, o.LiteracyLevel1_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Req, o.LiteracyLevel2_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Req, o.ParentPermFlag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Req, o.Over18Flag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Req, o.ShareFlag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Req, o.TermsOfUseflag_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Req, o.Custom1_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Req, o.Custom2_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Req, o.Custom3_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Req, o.Custom4_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Req, o.Custom5_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Show, o.DOB_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Show, o.Age_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Show, o.SchoolGrade_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Show, o.FirstName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Show, o.MiddleName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Show, o.LastName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Show, o.Gender_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Show, o.EmailAddress_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Show, o.PhoneNumber_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Show, o.StreetAddress1_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Show, o.StreetAddress2_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Show, o.City_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Show, o.State_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Show, o.ZipCode_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Show, o.Country_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Show, o.County_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Show, o.ParentGuardianFirstName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Show, o.ParentGuardianLastName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Show, o.ParentGuardianMiddleName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Show, o.PrimaryLibrary_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Show, o.LibraryCard_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Show, o.SchoolName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Show, o.District_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Show, o.Teacher_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Show, o.GroupTeamName_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Show, o.SchoolType_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Show, o.LiteracyLevel1_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Show, o.LiteracyLevel2_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Show, o.ParentPermFlag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Show, o.Over18Flag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Show, o.ShareFlag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Show, o.TermsOfUseflag_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Show, o.Custom1_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Show, o.Custom2_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Show, o.Custom3_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Show, o.Custom4_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Show, o.Custom5_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@DOB_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Edit, o.DOB_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Age_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Edit, o.Age_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolGrade_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Edit, o.SchoolGrade_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FirstName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Edit, o.FirstName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@MiddleName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Edit, o.MiddleName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Edit, o.LastName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Gender_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Edit, o.Gender_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@EmailAddress_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Edit, o.EmailAddress_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PhoneNumber_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Edit, o.PhoneNumber_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Edit, o.StreetAddress1_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@StreetAddress2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Edit, o.StreetAddress2_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@City_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Edit, o.City_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@State_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Edit, o.State_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ZipCode_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Edit, o.ZipCode_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Country_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Edit, o.Country_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@County_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Edit, o.County_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianFirstName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Edit, o.ParentGuardianFirstName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianLastName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Edit, o.ParentGuardianLastName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentGuardianMiddleName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Edit, o.ParentGuardianMiddleName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@PrimaryLibrary_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Edit, o.PrimaryLibrary_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LibraryCard_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Edit, o.LibraryCard_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Edit, o.SchoolName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@District_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Edit, o.District_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Teacher_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Edit, o.Teacher_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@GroupTeamName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Edit, o.GroupTeamName_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SchoolType_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Edit, o.SchoolType_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Edit, o.LiteracyLevel1_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LiteracyLevel2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Edit, o.LiteracyLevel2_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ParentPermFlag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Edit, o.ParentPermFlag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Over18Flag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Edit, o.Over18Flag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@ShareFlag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Edit, o.ShareFlag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@TermsOfUseflag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Edit, o.TermsOfUseflag_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Edit, o.Custom1_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Edit, o.Custom2_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom3_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Edit, o.Custom3_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom4_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Edit, o.Custom4_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Custom5_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Edit, o.Custom5_Edit.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastModDate", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastModDate, o.LastModDate.GetTypeCode())));
            arrParams.Add(new SqlParameter("@LastModUser", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastModUser, o.LastModUser.GetTypeCode())));
            arrParams.Add(new SqlParameter("@AddedDate", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.AddedDate, o.AddedDate.GetTypeCode())));
            arrParams.Add(new SqlParameter("@AddedUser", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.AddedUser, o.AddedUser.GetTypeCode())));

            arrParams.Add(new SqlParameter("@SDistrict_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Prompt, o.SDistrict_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SDistrict_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Req, o.SDistrict_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SDistrict_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Show, o.SDistrict_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@SDistrict_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Edit, o.SDistrict_Edit.GetTypeCode())));

            arrParams.Add(new SqlParameter("@Goal_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Prompt, o.Goal_Prompt.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Goal_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Req, o.Goal_Req.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Goal_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Show, o.Goal_Show.GetTypeCode())));
            arrParams.Add(new SqlParameter("@Goal_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Goal_Edit, o.Goal_Edit.GetTypeCode())));

            arrParams.Add(new SqlParameter("@TenID", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TenID, o.TenID.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldInt1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt1, o.FldInt1.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldInt2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt2, o.FldInt2.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldInt3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt3, o.FldInt3.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldBit1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit1, o.FldBit1.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldBit2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit2, o.FldBit2.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldBit3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit3, o.FldBit3.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldText1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText1, o.FldText1.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldText2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText2, o.FldText2.GetTypeCode())));
            arrParams.Add(new SqlParameter("@FldText3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText3, o.FldText3.GetTypeCode())));

            var newIdParam = new SqlParameter("@RID", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.RID, o.RID.GetTypeCode()));
            newIdParam.Direction = ParameterDirection.Output;
            arrParams.Add(newIdParam);

            SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, "app_RegistrationSettings_Insert", arrParams.ToArray());

            o.RID = int.Parse(newIdParam.Value.ToString());

            return o.RID;

        }
        public bool Fetch(int aTenID)
        {

            // declare reader

            SqlDataReader dr;

            SqlParameter[] arrParams = new SqlParameter[1];

            if (aTenID == 0)
            {
                aTenID = (HttpContext.Current.Session["TenantID"] == null || HttpContext.Current.Session["TenantID"].ToString() == "" ? -1 : (int)HttpContext.Current.Session["TenantID"]);
            }

            arrParams[0] = new SqlParameter("@TenID", aTenID);

            dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, "app_RegistrationSettings_GetByID", arrParams);

            if (dr.Read())
            {

                // declare return value

                RegistrationSettings result = new RegistrationSettings();

                DateTime _datetime;

                int _int;

                //decimal _decimal;

                if (int.TryParse(dr["RID"].ToString(), out _int)) this.RID = _int;
                this.Literacy1Label = dr["Literacy1Label"].ToString();
                this.Literacy2Label = dr["Literacy2Label"].ToString();
                this.DOB_Prompt = bool.Parse(dr["DOB_Prompt"].ToString());
                this.Age_Prompt = bool.Parse(dr["Age_Prompt"].ToString());
                this.SchoolGrade_Prompt = bool.Parse(dr["SchoolGrade_Prompt"].ToString());
                this.FirstName_Prompt = bool.Parse(dr["FirstName_Prompt"].ToString());
                this.MiddleName_Prompt = bool.Parse(dr["MiddleName_Prompt"].ToString());
                this.LastName_Prompt = bool.Parse(dr["LastName_Prompt"].ToString());
                this.Gender_Prompt = bool.Parse(dr["Gender_Prompt"].ToString());
                this.EmailAddress_Prompt = bool.Parse(dr["EmailAddress_Prompt"].ToString());
                this.PhoneNumber_Prompt = bool.Parse(dr["PhoneNumber_Prompt"].ToString());
                this.StreetAddress1_Prompt = bool.Parse(dr["StreetAddress1_Prompt"].ToString());
                this.StreetAddress2_Prompt = bool.Parse(dr["StreetAddress2_Prompt"].ToString());
                this.City_Prompt = bool.Parse(dr["City_Prompt"].ToString());
                this.State_Prompt = bool.Parse(dr["State_Prompt"].ToString());
                this.ZipCode_Prompt = bool.Parse(dr["ZipCode_Prompt"].ToString());
                this.Country_Prompt = bool.Parse(dr["Country_Prompt"].ToString());
                this.County_Prompt = bool.Parse(dr["County_Prompt"].ToString());
                this.ParentGuardianFirstName_Prompt = bool.Parse(dr["ParentGuardianFirstName_Prompt"].ToString());
                this.ParentGuardianLastName_Prompt = bool.Parse(dr["ParentGuardianLastName_Prompt"].ToString());
                this.ParentGuardianMiddleName_Prompt = bool.Parse(dr["ParentGuardianMiddleName_Prompt"].ToString());
                this.PrimaryLibrary_Prompt = bool.Parse(dr["PrimaryLibrary_Prompt"].ToString());
                this.LibraryCard_Prompt = bool.Parse(dr["LibraryCard_Prompt"].ToString());
                this.SchoolName_Prompt = bool.Parse(dr["SchoolName_Prompt"].ToString());
                this.District_Prompt = bool.Parse(dr["District_Prompt"].ToString());
                this.SDistrict_Prompt = bool.Parse(dr["SDistrict_Prompt"].ToString());
                this.Teacher_Prompt = bool.Parse(dr["Teacher_Prompt"].ToString());
                this.GroupTeamName_Prompt = bool.Parse(dr["GroupTeamName_Prompt"].ToString());
                this.SchoolType_Prompt = bool.Parse(dr["SchoolType_Prompt"].ToString());
                this.LiteracyLevel1_Prompt = bool.Parse(dr["LiteracyLevel1_Prompt"].ToString());
                this.LiteracyLevel2_Prompt = bool.Parse(dr["LiteracyLevel2_Prompt"].ToString());
                this.ParentPermFlag_Prompt = bool.Parse(dr["ParentPermFlag_Prompt"].ToString());
                this.Over18Flag_Prompt = bool.Parse(dr["Over18Flag_Prompt"].ToString());
                this.ShareFlag_Prompt = bool.Parse(dr["ShareFlag_Prompt"].ToString());
                this.TermsOfUseflag_Prompt = bool.Parse(dr["TermsOfUseflag_Prompt"].ToString());
                this.Custom1_Prompt = bool.Parse(dr["Custom1_Prompt"].ToString());
                this.Custom2_Prompt = bool.Parse(dr["Custom2_Prompt"].ToString());
                this.Custom3_Prompt = bool.Parse(dr["Custom3_Prompt"].ToString());
                this.Custom4_Prompt = bool.Parse(dr["Custom4_Prompt"].ToString());
                this.Custom5_Prompt = bool.Parse(dr["Custom5_Prompt"].ToString());
                this.DOB_Req = bool.Parse(dr["DOB_Req"].ToString());
                this.Age_Req = bool.Parse(dr["Age_Req"].ToString());
                this.SchoolGrade_Req = bool.Parse(dr["SchoolGrade_Req"].ToString());
                this.FirstName_Req = bool.Parse(dr["FirstName_Req"].ToString());
                this.MiddleName_Req = bool.Parse(dr["MiddleName_Req"].ToString());
                this.LastName_Req = bool.Parse(dr["LastName_Req"].ToString());
                this.Gender_Req = bool.Parse(dr["Gender_Req"].ToString());
                this.EmailAddress_Req = bool.Parse(dr["EmailAddress_Req"].ToString());
                this.PhoneNumber_Req = bool.Parse(dr["PhoneNumber_Req"].ToString());
                this.StreetAddress1_Req = bool.Parse(dr["StreetAddress1_Req"].ToString());
                this.StreetAddress2_Req = bool.Parse(dr["StreetAddress2_Req"].ToString());
                this.City_Req = bool.Parse(dr["City_Req"].ToString());
                this.State_Req = bool.Parse(dr["State_Req"].ToString());
                this.ZipCode_Req = bool.Parse(dr["ZipCode_Req"].ToString());
                this.Country_Req = bool.Parse(dr["Country_Req"].ToString());
                this.County_Req = bool.Parse(dr["County_Req"].ToString());
                this.ParentGuardianFirstName_Req = bool.Parse(dr["ParentGuardianFirstName_Req"].ToString());
                this.ParentGuardianLastName_Req = bool.Parse(dr["ParentGuardianLastName_Req"].ToString());
                this.ParentGuardianMiddleName_Req = bool.Parse(dr["ParentGuardianMiddleName_Req"].ToString());
                this.PrimaryLibrary_Req = bool.Parse(dr["PrimaryLibrary_Req"].ToString());
                this.LibraryCard_Req = bool.Parse(dr["LibraryCard_Req"].ToString());
                this.SchoolName_Req = bool.Parse(dr["SchoolName_Req"].ToString());
                this.District_Req = bool.Parse(dr["District_Req"].ToString());
                this.SDistrict_Req = bool.Parse(dr["SDistrict_Req"].ToString());
                this.Teacher_Req = bool.Parse(dr["Teacher_Req"].ToString());
                this.GroupTeamName_Req = bool.Parse(dr["GroupTeamName_Req"].ToString());
                this.SchoolType_Req = bool.Parse(dr["SchoolType_Req"].ToString());
                this.LiteracyLevel1_Req = bool.Parse(dr["LiteracyLevel1_Req"].ToString());
                this.LiteracyLevel2_Req = bool.Parse(dr["LiteracyLevel2_Req"].ToString());
                this.ParentPermFlag_Req = bool.Parse(dr["ParentPermFlag_Req"].ToString());
                this.Over18Flag_Req = bool.Parse(dr["Over18Flag_Req"].ToString());
                this.ShareFlag_Req = bool.Parse(dr["ShareFlag_Req"].ToString());
                this.TermsOfUseflag_Req = bool.Parse(dr["TermsOfUseflag_Req"].ToString());
                this.Custom1_Req = bool.Parse(dr["Custom1_Req"].ToString());
                this.Custom2_Req = bool.Parse(dr["Custom2_Req"].ToString());
                this.Custom3_Req = bool.Parse(dr["Custom3_Req"].ToString());
                this.Custom4_Req = bool.Parse(dr["Custom4_Req"].ToString());
                this.Custom5_Req = bool.Parse(dr["Custom5_Req"].ToString());
                this.DOB_Show = bool.Parse(dr["DOB_Show"].ToString());
                this.Age_Show = bool.Parse(dr["Age_Show"].ToString());
                this.SchoolGrade_Show = bool.Parse(dr["SchoolGrade_Show"].ToString());
                this.FirstName_Show = bool.Parse(dr["FirstName_Show"].ToString());
                this.MiddleName_Show = bool.Parse(dr["MiddleName_Show"].ToString());
                this.LastName_Show = bool.Parse(dr["LastName_Show"].ToString());
                this.Gender_Show = bool.Parse(dr["Gender_Show"].ToString());
                this.EmailAddress_Show = bool.Parse(dr["EmailAddress_Show"].ToString());
                this.PhoneNumber_Show = bool.Parse(dr["PhoneNumber_Show"].ToString());
                this.StreetAddress1_Show = bool.Parse(dr["StreetAddress1_Show"].ToString());
                this.StreetAddress2_Show = bool.Parse(dr["StreetAddress2_Show"].ToString());
                this.City_Show = bool.Parse(dr["City_Show"].ToString());
                this.State_Show = bool.Parse(dr["State_Show"].ToString());
                this.ZipCode_Show = bool.Parse(dr["ZipCode_Show"].ToString());
                this.Country_Show = bool.Parse(dr["Country_Show"].ToString());
                this.County_Show = bool.Parse(dr["County_Show"].ToString());
                this.ParentGuardianFirstName_Show = bool.Parse(dr["ParentGuardianFirstName_Show"].ToString());
                this.ParentGuardianLastName_Show = bool.Parse(dr["ParentGuardianLastName_Show"].ToString());
                this.ParentGuardianMiddleName_Show = bool.Parse(dr["ParentGuardianMiddleName_Show"].ToString());
                this.PrimaryLibrary_Show = bool.Parse(dr["PrimaryLibrary_Show"].ToString());
                this.LibraryCard_Show = bool.Parse(dr["LibraryCard_Show"].ToString());
                this.SchoolName_Show = bool.Parse(dr["SchoolName_Show"].ToString());
                this.District_Show = bool.Parse(dr["District_Show"].ToString());
                this.SDistrict_Show = bool.Parse(dr["SDistrict_Show"].ToString());
                this.Teacher_Show = bool.Parse(dr["Teacher_Show"].ToString());
                this.GroupTeamName_Show = bool.Parse(dr["GroupTeamName_Show"].ToString());
                this.SchoolType_Show = bool.Parse(dr["SchoolType_Show"].ToString());
                this.LiteracyLevel1_Show = bool.Parse(dr["LiteracyLevel1_Show"].ToString());
                this.LiteracyLevel2_Show = bool.Parse(dr["LiteracyLevel2_Show"].ToString());
                this.ParentPermFlag_Show = bool.Parse(dr["ParentPermFlag_Show"].ToString());
                this.Over18Flag_Show = bool.Parse(dr["Over18Flag_Show"].ToString());
                this.ShareFlag_Show = bool.Parse(dr["ShareFlag_Show"].ToString());
                this.TermsOfUseflag_Show = bool.Parse(dr["TermsOfUseflag_Show"].ToString());
                this.Custom1_Show = bool.Parse(dr["Custom1_Show"].ToString());
                this.Custom2_Show = bool.Parse(dr["Custom2_Show"].ToString());
                this.Custom3_Show = bool.Parse(dr["Custom3_Show"].ToString());
                this.Custom4_Show = bool.Parse(dr["Custom4_Show"].ToString());
                this.Custom5_Show = bool.Parse(dr["Custom5_Show"].ToString());
                this.DOB_Edit = bool.Parse(dr["DOB_Edit"].ToString());
                this.Age_Edit = bool.Parse(dr["Age_Edit"].ToString());
                this.SchoolGrade_Edit = bool.Parse(dr["SchoolGrade_Edit"].ToString());
                this.FirstName_Edit = bool.Parse(dr["FirstName_Edit"].ToString());
                this.MiddleName_Edit = bool.Parse(dr["MiddleName_Edit"].ToString());
                this.LastName_Edit = bool.Parse(dr["LastName_Edit"].ToString());
                this.Gender_Edit = bool.Parse(dr["Gender_Edit"].ToString());
                this.EmailAddress_Edit = bool.Parse(dr["EmailAddress_Edit"].ToString());
                this.PhoneNumber_Edit = bool.Parse(dr["PhoneNumber_Edit"].ToString());
                this.StreetAddress1_Edit = bool.Parse(dr["StreetAddress1_Edit"].ToString());
                this.StreetAddress2_Edit = bool.Parse(dr["StreetAddress2_Edit"].ToString());
                this.City_Edit = bool.Parse(dr["City_Edit"].ToString());
                this.State_Edit = bool.Parse(dr["State_Edit"].ToString());
                this.ZipCode_Edit = bool.Parse(dr["ZipCode_Edit"].ToString());
                this.Country_Edit = bool.Parse(dr["Country_Edit"].ToString());
                this.County_Edit = bool.Parse(dr["County_Edit"].ToString());
                this.ParentGuardianFirstName_Edit = bool.Parse(dr["ParentGuardianFirstName_Edit"].ToString());
                this.ParentGuardianLastName_Edit = bool.Parse(dr["ParentGuardianLastName_Edit"].ToString());
                this.ParentGuardianMiddleName_Edit = bool.Parse(dr["ParentGuardianMiddleName_Edit"].ToString());
                this.PrimaryLibrary_Edit = bool.Parse(dr["PrimaryLibrary_Edit"].ToString());
                this.LibraryCard_Edit = bool.Parse(dr["LibraryCard_Edit"].ToString());
                this.SchoolName_Edit = bool.Parse(dr["SchoolName_Edit"].ToString());
                this.District_Edit = bool.Parse(dr["District_Edit"].ToString());
                this.SDistrict_Edit = bool.Parse(dr["SDistrict_Edit"].ToString());
                this.Teacher_Edit = bool.Parse(dr["Teacher_Edit"].ToString());
                this.GroupTeamName_Edit = bool.Parse(dr["GroupTeamName_Edit"].ToString());
                this.SchoolType_Edit = bool.Parse(dr["SchoolType_Edit"].ToString());
                this.LiteracyLevel1_Edit = bool.Parse(dr["LiteracyLevel1_Edit"].ToString());
                this.LiteracyLevel2_Edit = bool.Parse(dr["LiteracyLevel2_Edit"].ToString());
                this.ParentPermFlag_Edit = bool.Parse(dr["ParentPermFlag_Edit"].ToString());
                this.Over18Flag_Edit = bool.Parse(dr["Over18Flag_Edit"].ToString());
                this.ShareFlag_Edit = bool.Parse(dr["ShareFlag_Edit"].ToString());
                this.TermsOfUseflag_Edit = bool.Parse(dr["TermsOfUseflag_Edit"].ToString());
                this.Custom1_Edit = bool.Parse(dr["Custom1_Edit"].ToString());
                this.Custom2_Edit = bool.Parse(dr["Custom2_Edit"].ToString());
                this.Custom3_Edit = bool.Parse(dr["Custom3_Edit"].ToString());
                this.Custom4_Edit = bool.Parse(dr["Custom4_Edit"].ToString());
                this.Custom5_Edit = bool.Parse(dr["Custom5_Edit"].ToString());
                if (DateTime.TryParse(dr["LastModDate"].ToString(), out _datetime)) this.LastModDate = _datetime;
                this.LastModUser = dr["LastModUser"].ToString();
                if (DateTime.TryParse(dr["AddedDate"].ToString(), out _datetime)) this.AddedDate = _datetime;
                this.AddedUser = dr["AddedUser"].ToString();

                this.Goal_Prompt = bool.Parse(dr["Goal_Prompt"].ToString());
                this.Goal_Show = bool.Parse(dr["Goal_Show"].ToString());
                this.Goal_Edit = bool.Parse(dr["Goal_Edit"].ToString());
                this.Goal_Req = bool.Parse(dr["Goal_Req"].ToString());

                if (int.TryParse(dr["TenID"].ToString(), out _int)) this.TenID = _int;
                if (int.TryParse(dr["FldInt1"].ToString(), out _int)) this.FldInt1 = _int;
                if (int.TryParse(dr["FldInt2"].ToString(), out _int)) this.FldInt2 = _int;
                if (int.TryParse(dr["FldInt3"].ToString(), out _int)) this.FldInt3 = _int;
                this.FldBit1 = bool.Parse(dr["FldBit1"].ToString());
                this.FldBit2 = bool.Parse(dr["FldBit2"].ToString());
                this.FldBit3 = bool.Parse(dr["FldBit3"].ToString());
                this.FldText1 = dr["FldText1"].ToString();
                this.FldText2 = dr["FldText2"].ToString();
                this.FldText3 = dr["FldText3"].ToString();
                dr.Close();

                return true;

            }

            dr.Close();

            return false;

        }
        public static int Delete(RegistrationSettings o)
        {

            int iReturn = -1; //assume the worst

            SqlParameter[] arrParams = new SqlParameter[1];

            arrParams[0] = new SqlParameter("@RID", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.RID, o.RID.GetTypeCode()));

            try
            {

                iReturn = SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, "app_RegistrationSettings_Delete", arrParams);

            }

            catch (SqlException exx)
            {

                System.Diagnostics.Debug.Write(exx.Message);

            }

            return iReturn;

        }
        public static int Update(RegistrationSettings o)
        {
            int iReturn = -1; //assume the worst

            SqlParameter[] arrParams = new SqlParameter[169];

            arrParams[0] = new SqlParameter("@RID", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.RID, o.RID.GetTypeCode()));
            arrParams[1] = new SqlParameter("@Literacy1Label", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Literacy1Label, o.Literacy1Label.GetTypeCode()));
            arrParams[2] = new SqlParameter("@Literacy2Label", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Literacy2Label, o.Literacy2Label.GetTypeCode()));
            arrParams[3] = new SqlParameter("@DOB_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Prompt, o.DOB_Prompt.GetTypeCode()));
            arrParams[4] = new SqlParameter("@Age_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Prompt, o.Age_Prompt.GetTypeCode()));
            arrParams[5] = new SqlParameter("@SchoolGrade_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Prompt, o.SchoolGrade_Prompt.GetTypeCode()));
            arrParams[6] = new SqlParameter("@FirstName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Prompt, o.FirstName_Prompt.GetTypeCode()));
            arrParams[7] = new SqlParameter("@MiddleName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Prompt, o.MiddleName_Prompt.GetTypeCode()));
            arrParams[8] = new SqlParameter("@LastName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Prompt, o.LastName_Prompt.GetTypeCode()));
            arrParams[9] = new SqlParameter("@Gender_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Prompt, o.Gender_Prompt.GetTypeCode()));
            arrParams[10] = new SqlParameter("@EmailAddress_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Prompt, o.EmailAddress_Prompt.GetTypeCode()));
            arrParams[11] = new SqlParameter("@PhoneNumber_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Prompt, o.PhoneNumber_Prompt.GetTypeCode()));
            arrParams[12] = new SqlParameter("@StreetAddress1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Prompt, o.StreetAddress1_Prompt.GetTypeCode()));
            arrParams[13] = new SqlParameter("@StreetAddress2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Prompt, o.StreetAddress2_Prompt.GetTypeCode()));
            arrParams[14] = new SqlParameter("@City_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Prompt, o.City_Prompt.GetTypeCode()));
            arrParams[15] = new SqlParameter("@State_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Prompt, o.State_Prompt.GetTypeCode()));
            arrParams[16] = new SqlParameter("@ZipCode_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Prompt, o.ZipCode_Prompt.GetTypeCode()));
            arrParams[17] = new SqlParameter("@Country_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Prompt, o.Country_Prompt.GetTypeCode()));
            arrParams[18] = new SqlParameter("@County_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Prompt, o.County_Prompt.GetTypeCode()));
            arrParams[19] = new SqlParameter("@ParentGuardianFirstName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Prompt, o.ParentGuardianFirstName_Prompt.GetTypeCode()));
            arrParams[20] = new SqlParameter("@ParentGuardianLastName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Prompt, o.ParentGuardianLastName_Prompt.GetTypeCode()));
            arrParams[21] = new SqlParameter("@ParentGuardianMiddleName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Prompt, o.ParentGuardianMiddleName_Prompt.GetTypeCode()));
            arrParams[22] = new SqlParameter("@PrimaryLibrary_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Prompt, o.PrimaryLibrary_Prompt.GetTypeCode()));
            arrParams[23] = new SqlParameter("@LibraryCard_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Prompt, o.LibraryCard_Prompt.GetTypeCode()));
            arrParams[24] = new SqlParameter("@SchoolName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Prompt, o.SchoolName_Prompt.GetTypeCode()));
            arrParams[25] = new SqlParameter("@District_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Prompt, o.District_Prompt.GetTypeCode()));
            arrParams[26] = new SqlParameter("@Teacher_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Prompt, o.Teacher_Prompt.GetTypeCode()));
            arrParams[27] = new SqlParameter("@GroupTeamName_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Prompt, o.GroupTeamName_Prompt.GetTypeCode()));
            arrParams[28] = new SqlParameter("@SchoolType_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Prompt, o.SchoolType_Prompt.GetTypeCode()));
            arrParams[29] = new SqlParameter("@LiteracyLevel1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Prompt, o.LiteracyLevel1_Prompt.GetTypeCode()));
            arrParams[30] = new SqlParameter("@LiteracyLevel2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Prompt, o.LiteracyLevel2_Prompt.GetTypeCode()));
            arrParams[31] = new SqlParameter("@ParentPermFlag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Prompt, o.ParentPermFlag_Prompt.GetTypeCode()));
            arrParams[32] = new SqlParameter("@Over18Flag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Prompt, o.Over18Flag_Prompt.GetTypeCode()));
            arrParams[33] = new SqlParameter("@ShareFlag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Prompt, o.ShareFlag_Prompt.GetTypeCode()));
            arrParams[34] = new SqlParameter("@TermsOfUseflag_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Prompt, o.TermsOfUseflag_Prompt.GetTypeCode()));
            arrParams[35] = new SqlParameter("@Custom1_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Prompt, o.Custom1_Prompt.GetTypeCode()));
            arrParams[36] = new SqlParameter("@Custom2_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Prompt, o.Custom2_Prompt.GetTypeCode()));
            arrParams[37] = new SqlParameter("@Custom3_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Prompt, o.Custom3_Prompt.GetTypeCode()));
            arrParams[38] = new SqlParameter("@Custom4_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Prompt, o.Custom4_Prompt.GetTypeCode()));
            arrParams[39] = new SqlParameter("@Custom5_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Prompt, o.Custom5_Prompt.GetTypeCode()));
            arrParams[40] = new SqlParameter("@DOB_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Req, o.DOB_Req.GetTypeCode()));
            arrParams[41] = new SqlParameter("@Age_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Req, o.Age_Req.GetTypeCode()));
            arrParams[42] = new SqlParameter("@SchoolGrade_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Req, o.SchoolGrade_Req.GetTypeCode()));
            arrParams[43] = new SqlParameter("@FirstName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Req, o.FirstName_Req.GetTypeCode()));
            arrParams[44] = new SqlParameter("@MiddleName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Req, o.MiddleName_Req.GetTypeCode()));
            arrParams[45] = new SqlParameter("@LastName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Req, o.LastName_Req.GetTypeCode()));
            arrParams[46] = new SqlParameter("@Gender_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Req, o.Gender_Req.GetTypeCode()));
            arrParams[47] = new SqlParameter("@EmailAddress_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Req, o.EmailAddress_Req.GetTypeCode()));
            arrParams[48] = new SqlParameter("@PhoneNumber_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Req, o.PhoneNumber_Req.GetTypeCode()));
            arrParams[49] = new SqlParameter("@StreetAddress1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Req, o.StreetAddress1_Req.GetTypeCode()));
            arrParams[50] = new SqlParameter("@StreetAddress2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Req, o.StreetAddress2_Req.GetTypeCode()));
            arrParams[51] = new SqlParameter("@City_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Req, o.City_Req.GetTypeCode()));
            arrParams[52] = new SqlParameter("@State_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Req, o.State_Req.GetTypeCode()));
            arrParams[53] = new SqlParameter("@ZipCode_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Req, o.ZipCode_Req.GetTypeCode()));
            arrParams[54] = new SqlParameter("@Country_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Req, o.Country_Req.GetTypeCode()));
            arrParams[55] = new SqlParameter("@County_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Req, o.County_Req.GetTypeCode()));
            arrParams[56] = new SqlParameter("@ParentGuardianFirstName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Req, o.ParentGuardianFirstName_Req.GetTypeCode()));
            arrParams[57] = new SqlParameter("@ParentGuardianLastName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Req, o.ParentGuardianLastName_Req.GetTypeCode()));
            arrParams[58] = new SqlParameter("@ParentGuardianMiddleName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Req, o.ParentGuardianMiddleName_Req.GetTypeCode()));
            arrParams[59] = new SqlParameter("@PrimaryLibrary_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Req, o.PrimaryLibrary_Req.GetTypeCode()));
            arrParams[60] = new SqlParameter("@LibraryCard_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Req, o.LibraryCard_Req.GetTypeCode()));
            arrParams[61] = new SqlParameter("@SchoolName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Req, o.SchoolName_Req.GetTypeCode()));
            arrParams[62] = new SqlParameter("@District_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Req, o.District_Req.GetTypeCode()));
            arrParams[63] = new SqlParameter("@Teacher_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Req, o.Teacher_Req.GetTypeCode()));
            arrParams[64] = new SqlParameter("@GroupTeamName_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Req, o.GroupTeamName_Req.GetTypeCode()));
            arrParams[65] = new SqlParameter("@SchoolType_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Req, o.SchoolType_Req.GetTypeCode()));
            arrParams[66] = new SqlParameter("@LiteracyLevel1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Req, o.LiteracyLevel1_Req.GetTypeCode()));
            arrParams[67] = new SqlParameter("@LiteracyLevel2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Req, o.LiteracyLevel2_Req.GetTypeCode()));
            arrParams[68] = new SqlParameter("@ParentPermFlag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Req, o.ParentPermFlag_Req.GetTypeCode()));
            arrParams[69] = new SqlParameter("@Over18Flag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Req, o.Over18Flag_Req.GetTypeCode()));
            arrParams[70] = new SqlParameter("@ShareFlag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Req, o.ShareFlag_Req.GetTypeCode()));
            arrParams[71] = new SqlParameter("@TermsOfUseflag_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Req, o.TermsOfUseflag_Req.GetTypeCode()));
            arrParams[72] = new SqlParameter("@Custom1_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Req, o.Custom1_Req.GetTypeCode()));
            arrParams[73] = new SqlParameter("@Custom2_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Req, o.Custom2_Req.GetTypeCode()));
            arrParams[74] = new SqlParameter("@Custom3_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Req, o.Custom3_Req.GetTypeCode()));
            arrParams[75] = new SqlParameter("@Custom4_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Req, o.Custom4_Req.GetTypeCode()));
            arrParams[76] = new SqlParameter("@Custom5_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Req, o.Custom5_Req.GetTypeCode()));
            arrParams[77] = new SqlParameter("@DOB_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Show, o.DOB_Show.GetTypeCode()));
            arrParams[78] = new SqlParameter("@Age_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Show, o.Age_Show.GetTypeCode()));
            arrParams[79] = new SqlParameter("@SchoolGrade_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Show, o.SchoolGrade_Show.GetTypeCode()));
            arrParams[80] = new SqlParameter("@FirstName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Show, o.FirstName_Show.GetTypeCode()));
            arrParams[81] = new SqlParameter("@MiddleName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Show, o.MiddleName_Show.GetTypeCode()));
            arrParams[82] = new SqlParameter("@LastName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Show, o.LastName_Show.GetTypeCode()));
            arrParams[83] = new SqlParameter("@Gender_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Show, o.Gender_Show.GetTypeCode()));
            arrParams[84] = new SqlParameter("@EmailAddress_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Show, o.EmailAddress_Show.GetTypeCode()));
            arrParams[85] = new SqlParameter("@PhoneNumber_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Show, o.PhoneNumber_Show.GetTypeCode()));
            arrParams[86] = new SqlParameter("@StreetAddress1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Show, o.StreetAddress1_Show.GetTypeCode()));
            arrParams[87] = new SqlParameter("@StreetAddress2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Show, o.StreetAddress2_Show.GetTypeCode()));
            arrParams[88] = new SqlParameter("@City_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Show, o.City_Show.GetTypeCode()));
            arrParams[89] = new SqlParameter("@State_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Show, o.State_Show.GetTypeCode()));
            arrParams[90] = new SqlParameter("@ZipCode_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Show, o.ZipCode_Show.GetTypeCode()));
            arrParams[91] = new SqlParameter("@Country_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Show, o.Country_Show.GetTypeCode()));
            arrParams[92] = new SqlParameter("@County_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Show, o.County_Show.GetTypeCode()));
            arrParams[93] = new SqlParameter("@ParentGuardianFirstName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Show, o.ParentGuardianFirstName_Show.GetTypeCode()));
            arrParams[94] = new SqlParameter("@ParentGuardianLastName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Show, o.ParentGuardianLastName_Show.GetTypeCode()));
            arrParams[95] = new SqlParameter("@ParentGuardianMiddleName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Show, o.ParentGuardianMiddleName_Show.GetTypeCode()));
            arrParams[96] = new SqlParameter("@PrimaryLibrary_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Show, o.PrimaryLibrary_Show.GetTypeCode()));
            arrParams[97] = new SqlParameter("@LibraryCard_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Show, o.LibraryCard_Show.GetTypeCode()));
            arrParams[98] = new SqlParameter("@SchoolName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Show, o.SchoolName_Show.GetTypeCode()));
            arrParams[99] = new SqlParameter("@District_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Show, o.District_Show.GetTypeCode()));
            arrParams[100] = new SqlParameter("@Teacher_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Show, o.Teacher_Show.GetTypeCode()));
            arrParams[101] = new SqlParameter("@GroupTeamName_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Show, o.GroupTeamName_Show.GetTypeCode()));
            arrParams[102] = new SqlParameter("@SchoolType_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Show, o.SchoolType_Show.GetTypeCode()));
            arrParams[103] = new SqlParameter("@LiteracyLevel1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Show, o.LiteracyLevel1_Show.GetTypeCode()));
            arrParams[104] = new SqlParameter("@LiteracyLevel2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Show, o.LiteracyLevel2_Show.GetTypeCode()));
            arrParams[105] = new SqlParameter("@ParentPermFlag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Show, o.ParentPermFlag_Show.GetTypeCode()));
            arrParams[106] = new SqlParameter("@Over18Flag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Show, o.Over18Flag_Show.GetTypeCode()));
            arrParams[107] = new SqlParameter("@ShareFlag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Show, o.ShareFlag_Show.GetTypeCode()));
            arrParams[108] = new SqlParameter("@TermsOfUseflag_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Show, o.TermsOfUseflag_Show.GetTypeCode()));
            arrParams[109] = new SqlParameter("@Custom1_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Show, o.Custom1_Show.GetTypeCode()));
            arrParams[110] = new SqlParameter("@Custom2_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Show, o.Custom2_Show.GetTypeCode()));
            arrParams[111] = new SqlParameter("@Custom3_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Show, o.Custom3_Show.GetTypeCode()));
            arrParams[112] = new SqlParameter("@Custom4_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Show, o.Custom4_Show.GetTypeCode()));
            arrParams[113] = new SqlParameter("@Custom5_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Show, o.Custom5_Show.GetTypeCode()));
            arrParams[114] = new SqlParameter("@DOB_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.DOB_Edit, o.DOB_Edit.GetTypeCode()));
            arrParams[115] = new SqlParameter("@Age_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Age_Edit, o.Age_Edit.GetTypeCode()));
            arrParams[116] = new SqlParameter("@SchoolGrade_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolGrade_Edit, o.SchoolGrade_Edit.GetTypeCode()));
            arrParams[117] = new SqlParameter("@FirstName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FirstName_Edit, o.FirstName_Edit.GetTypeCode()));
            arrParams[118] = new SqlParameter("@MiddleName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.MiddleName_Edit, o.MiddleName_Edit.GetTypeCode()));
            arrParams[119] = new SqlParameter("@LastName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastName_Edit, o.LastName_Edit.GetTypeCode()));
            arrParams[120] = new SqlParameter("@Gender_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Gender_Edit, o.Gender_Edit.GetTypeCode()));
            arrParams[121] = new SqlParameter("@EmailAddress_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.EmailAddress_Edit, o.EmailAddress_Edit.GetTypeCode()));
            arrParams[122] = new SqlParameter("@PhoneNumber_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PhoneNumber_Edit, o.PhoneNumber_Edit.GetTypeCode()));
            arrParams[123] = new SqlParameter("@StreetAddress1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress1_Edit, o.StreetAddress1_Edit.GetTypeCode()));
            arrParams[124] = new SqlParameter("@StreetAddress2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.StreetAddress2_Edit, o.StreetAddress2_Edit.GetTypeCode()));
            arrParams[125] = new SqlParameter("@City_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.City_Edit, o.City_Edit.GetTypeCode()));
            arrParams[126] = new SqlParameter("@State_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.State_Edit, o.State_Edit.GetTypeCode()));
            arrParams[127] = new SqlParameter("@ZipCode_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ZipCode_Edit, o.ZipCode_Edit.GetTypeCode()));
            arrParams[128] = new SqlParameter("@Country_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Country_Edit, o.Country_Edit.GetTypeCode()));
            arrParams[129] = new SqlParameter("@County_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.County_Edit, o.County_Edit.GetTypeCode()));
            arrParams[130] = new SqlParameter("@ParentGuardianFirstName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianFirstName_Edit, o.ParentGuardianFirstName_Edit.GetTypeCode()));
            arrParams[131] = new SqlParameter("@ParentGuardianLastName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianLastName_Edit, o.ParentGuardianLastName_Edit.GetTypeCode()));
            arrParams[132] = new SqlParameter("@ParentGuardianMiddleName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentGuardianMiddleName_Edit, o.ParentGuardianMiddleName_Edit.GetTypeCode()));
            arrParams[133] = new SqlParameter("@PrimaryLibrary_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.PrimaryLibrary_Edit, o.PrimaryLibrary_Edit.GetTypeCode()));
            arrParams[134] = new SqlParameter("@LibraryCard_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LibraryCard_Edit, o.LibraryCard_Edit.GetTypeCode()));
            arrParams[135] = new SqlParameter("@SchoolName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolName_Edit, o.SchoolName_Edit.GetTypeCode()));
            arrParams[136] = new SqlParameter("@District_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.District_Edit, o.District_Edit.GetTypeCode()));
            arrParams[137] = new SqlParameter("@Teacher_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Teacher_Edit, o.Teacher_Edit.GetTypeCode()));
            arrParams[138] = new SqlParameter("@GroupTeamName_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.GroupTeamName_Edit, o.GroupTeamName_Edit.GetTypeCode()));
            arrParams[139] = new SqlParameter("@SchoolType_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SchoolType_Edit, o.SchoolType_Edit.GetTypeCode()));
            arrParams[140] = new SqlParameter("@LiteracyLevel1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel1_Edit, o.LiteracyLevel1_Edit.GetTypeCode()));
            arrParams[141] = new SqlParameter("@LiteracyLevel2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LiteracyLevel2_Edit, o.LiteracyLevel2_Edit.GetTypeCode()));
            arrParams[142] = new SqlParameter("@ParentPermFlag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ParentPermFlag_Edit, o.ParentPermFlag_Edit.GetTypeCode()));
            arrParams[143] = new SqlParameter("@Over18Flag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Over18Flag_Edit, o.Over18Flag_Edit.GetTypeCode()));
            arrParams[144] = new SqlParameter("@ShareFlag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.ShareFlag_Edit, o.ShareFlag_Edit.GetTypeCode()));
            arrParams[145] = new SqlParameter("@TermsOfUseflag_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TermsOfUseflag_Edit, o.TermsOfUseflag_Edit.GetTypeCode()));
            arrParams[146] = new SqlParameter("@Custom1_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom1_Edit, o.Custom1_Edit.GetTypeCode()));
            arrParams[147] = new SqlParameter("@Custom2_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom2_Edit, o.Custom2_Edit.GetTypeCode()));
            arrParams[148] = new SqlParameter("@Custom3_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom3_Edit, o.Custom3_Edit.GetTypeCode()));
            arrParams[149] = new SqlParameter("@Custom4_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom4_Edit, o.Custom4_Edit.GetTypeCode()));
            arrParams[150] = new SqlParameter("@Custom5_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.Custom5_Edit, o.Custom5_Edit.GetTypeCode()));
            arrParams[151] = new SqlParameter("@LastModDate", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastModDate, o.LastModDate.GetTypeCode()));
            arrParams[152] = new SqlParameter("@LastModUser", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.LastModUser, o.LastModUser.GetTypeCode()));
            arrParams[153] = new SqlParameter("@AddedDate", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.AddedDate, o.AddedDate.GetTypeCode()));
            arrParams[154] = new SqlParameter("@AddedUser", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.AddedUser, o.AddedUser.GetTypeCode()));
            arrParams[155] = new SqlParameter("@SDistrict_Prompt", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Prompt, o.SDistrict_Prompt.GetTypeCode()));
            arrParams[156] = new SqlParameter("@SDistrict_Req", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Req, o.SDistrict_Req.GetTypeCode()));
            arrParams[157] = new SqlParameter("@SDistrict_Show", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Show, o.SDistrict_Show.GetTypeCode()));
            arrParams[158] = new SqlParameter("@SDistrict_Edit", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.SDistrict_Edit, o.SDistrict_Edit.GetTypeCode()));

            arrParams[159] = new SqlParameter("@TenID", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.TenID, o.TenID.GetTypeCode()));
            arrParams[160] = new SqlParameter("@FldInt1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt1, o.FldInt1.GetTypeCode()));
            arrParams[161] = new SqlParameter("@FldInt2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt2, o.FldInt2.GetTypeCode()));
            arrParams[162] = new SqlParameter("@FldInt3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldInt3, o.FldInt3.GetTypeCode()));
            arrParams[163] = new SqlParameter("@FldBit1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit1, o.FldBit1.GetTypeCode()));
            arrParams[164] = new SqlParameter("@FldBit2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit2, o.FldBit2.GetTypeCode()));
            arrParams[165] = new SqlParameter("@FldBit3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldBit3, o.FldBit3.GetTypeCode()));
            arrParams[166] = new SqlParameter("@FldText1", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText1, o.FldText1.GetTypeCode()));
            arrParams[167] = new SqlParameter("@FldText2", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText2, o.FldText2.GetTypeCode()));
            arrParams[168] = new SqlParameter("@FldText3", GRA.SRP.Core.Utilities.GlobalUtilities.DBSafeValue(o.FldText3, o.FldText3.GetTypeCode()));

            try
            {

                iReturn = SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, "app_RegistrationSettings_Update", arrParams);

            }

            catch (SqlException exx)
            {

                System.Diagnostics.Debug.Write(exx.Message);

            }

            return iReturn;
        }