Example #1
0
    //to get the parent info is there in the database
    private void getParentInfo()
    {
        string strFJCID = hdnFJCID_ParentInfo.Value;
        string strParent1Id;
        string strParent2Id;

        //to get the parent 1 info
        UserInfo = CamperAppl.getParentInfo(strFJCID, "Y");
        if (!string.IsNullOrEmpty(UserInfo.FirstName))
        {
            //set the hidden value (whether to Insert or update the Parent Info)
            hdnPerformAction.Value = "UPDATE";
            //to fill the parent 1 info
            txtFirstName1.Text        = UserInfo.FirstName;
            txtLastName1.Text         = UserInfo.LastName;
            txtAddress1.Text          = UserInfo.Address;
            ddlCountry1.SelectedValue = UserInfo.Country;
            //AG
            get_CountryStates(ddlState1, int.Parse(UserInfo.Country));

            ddlState1.SelectedValue       = UserInfo.State;
            txtCity1.Text                 = UserInfo.City;
            txtZipCode1.Text              = UserInfo.ZipCode;
            txtPersonalEmail1.Text        = UserInfo.PersonalEmail;
            txtPersonalEmail1Confirm.Text = UserInfo.PersonalEmail;
            txtWorkEmail1.Text            = UserInfo.WorkEmail;
            txtHomePhone1.Text            = UserInfo.HomePhone;
            txtWorkPhone1.Text            = UserInfo.WorkPhone;
            strParent1Id = UserInfo.Parent1Id;

            //to get the Parent 2 info
            UserInfo = CamperAppl.getParentInfo(strFJCID, "N");
            //to fill the parent 2 info
            //if (UserInfo.FirstName != null)  //then parent info 2 exists
            //{
            txtFirstName2.Text        = UserInfo.FirstName;
            txtLastName2.Text         = UserInfo.LastName;
            txtAddress2.Text          = UserInfo.Address;
            ddlCountry2.SelectedValue = UserInfo.Country;
            SetState2Label(UserInfo.Country);
            get_CountryStates(ddlState2, int.Parse(UserInfo.Country));
            if (!string.IsNullOrEmpty(UserInfo.State))
            {
                ddlState2.SelectedValue = UserInfo.State;
            }
            else
            {
                ddlState2.SelectedValue = "0";
            }
            txtCity2.Text          = UserInfo.City;
            txtZipCode2.Text       = UserInfo.ZipCode;
            txtPersonalEmail2.Text = UserInfo.PersonalEmail;
            txtWorkEmail2.Text     = UserInfo.WorkEmail;
            txtHomePhone2.Text     = UserInfo.HomePhone;
            txtWorkPhone2.Text     = UserInfo.WorkPhone;
            strParent2Id           = UserInfo.Parent1Id;
            //}
        }
        else //set the hidden value (whether to Insert or update the Parent Info)
        {
            hdnPerformAction.Value = "INSERT";
        }
    }