コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);

            txtCount.Text = TB_AboutME.MaxLength.ToString();

            TB_AboutME.Attributes.Add("onKeyUp",
                                      "javascript:document.getElementById('" + txtCount.ClientID +
                                      "').setAttribute('value', (" + TB_AboutME.MaxLength +
                                      " - parseInt(document.getElementById('" + TB_AboutME.ClientID +
                                      "').getAttribute('value').length)));");

            //Loading DDLs

            //Getting Connection String

            DDL_FamilyStatus.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.FamilyStatus);
            DDL_FamilyStatus.DataTextField  = "Item";
            DDL_FamilyStatus.DataValueField = "Value";
            DDL_FamilyStatus.DataBind();

            DDL_FamilyType.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Familytype);
            DDL_FamilyType.DataTextField  = "Item";
            DDL_FamilyType.DataValueField = "Value";
            DDL_FamilyType.DataBind();

            DDL_FamilyValues.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.FamilyValue);
            DDL_FamilyValues.DataTextField  = "Item";
            DDL_FamilyValues.DataValueField = "Value";
            DDL_FamilyValues.DataBind();

            LB_Hobbies.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Hobbies);
            LB_Hobbies.DataTextField  = "Item";
            LB_Hobbies.DataValueField = "Value";
            LB_Hobbies.DataBind();
            LB_Hobbies.Items.RemoveAt(0);

            LB_Interests.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Interests);
            LB_Interests.DataTextField  = "Item";
            LB_Interests.DataValueField = "Value";
            LB_Interests.DataBind();
            LB_Interests.Items.RemoveAt(0);
        }
        else        // Not postback
        {
            sbyte sbyteFlage = 0;
            //try
            //{
            HttpCookieCollection objHttpCookieCollection = Request.Cookies;
            HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatRegInfo");

            strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]);
            if (strApplicationID != null)
            {
                //About Me
                sbyteFlage = MatrimonialProfileManager.InsertAboutMe(strApplicationID, TB_AboutME.Text);
                // Family Details
                sbyteFlage += MatrimonialProfileManager.InsertFamilyInfo(strApplicationID, TB_FamilyDetails.Text, (sbyte)DDL_FamilyValues.SelectedIndex,
                                                                         (sbyte)DDL_FamilyType.SelectedIndex, (sbyte)DDL_FamilyStatus.SelectedIndex, TB_familyOrigin.Text,
                                                                         (sbyte)DDL_NoOfBrothers.SelectedIndex, (sbyte)DDL_NoOFSisters.SelectedIndex, (sbyte)DDL_NoOfBrothersMarried.SelectedIndex,
                                                                         (sbyte)DDL_NoOFSistersMarried.SelectedIndex, TB_Father_Name.Text, TB_Mother_name.Text,
                                                                         RB_FLIve.Checked, RB_MLive.Checked, TB_Father_Occ.Text, TB_Mother_Occ.Text);

                //Hobbies And Interests
                string strHobbiesList = "";
                string Flag           = "";
                foreach (ListItem objListItem in LB_Hobbies.Items)
                {
                    if (objListItem.Selected)
                    {
                        strHobbiesList += Flag + objListItem.Value;
                        Flag            = "%";
                    }
                }
                Flag = "";
                //Intrests
                string strInterestList = "";
                foreach (ListItem objListItem in LB_Interests.Items)
                {
                    if (objListItem.Selected)
                    {
                        strInterestList += Flag + objListItem.Value;
                        Flag             = "%";
                    }
                }
                //Inserting Into Database
                sbyteFlage += MatrimonialProfileManager.InsertHobiesNInterests(strApplicationID, strHobbiesList, TB_OtherHobbies.Text, strInterestList, TB_OtherInterests.Text);

                if (sbyteFlage == 3)
                {
                    MatrimonialMemberShip.UpdateIndex(strApplicationID);
                    Server.Transfer("RegistrationStep4.aspx");
                }
                else
                {
                    Response.Redirect("../Extras/ErrorReport.aspx");
                }
            }
            else
            {
                Response.Redirect("../Extras/ErrorReport.aspx");
            }
            //}
            //catch (Exception)
            //{ }
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HttpCookieCollection objHttpCookieCollection = Request.Cookies;
            HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatRegInfo");

            //Getting ApplicationID Value

            // <Meta tag>

            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);


            //Loading DDL

            //Getting Connection String

            //Connect To database

            DDL_Education.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Education);
            DDL_Education.DataTextField  = "Item";
            DDL_Education.DataValueField = "Value";
            DDL_Education.DataBind();

            DDL_EduDetails.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.EduDetails);
            DDL_EduDetails.DataTextField  = "Item";
            DDL_EduDetails.DataValueField = "Value";
            DDL_EduDetails.DataBind();

            DDL_AnnualIncome.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.AnnualIncomeRange);
            DDL_AnnualIncome.DataTextField  = "Item";
            DDL_AnnualIncome.DataValueField = "Value";
            DDL_AnnualIncome.DataBind();

            DDL_Currency.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Currency);
            DDL_Currency.DataTextField  = "Item";
            DDL_Currency.DataValueField = "Value";
            DDL_Currency.DataBind();

            DDL_Occupation.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Occupation);
            DDL_Occupation.DataTextField  = "Item";
            DDL_Occupation.DataValueField = "Value";
            DDL_Occupation.DataBind();

            DDL_EmpIn.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.EmployedIn);
            DDL_EmpIn.DataTextField  = "Item";
            DDL_EmpIn.DataValueField = "Value";
            DDL_EmpIn.DataBind();

            DDL_BGroup.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.BloodGroup);
            DDL_BGroup.DataTextField  = "Item";
            DDL_BGroup.DataValueField = "Value";
            DDL_BGroup.DataBind();

            DDL_Complexion.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Complexion);
            DDL_Complexion.DataTextField  = "Item";
            DDL_Complexion.DataValueField = "Value";
            DDL_Complexion.DataBind();

            DDL_Diet.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Diet);
            DDL_Diet.DataTextField  = "Item";
            DDL_Diet.DataValueField = "Value";
            DDL_Diet.DataBind();

            DDL_Country.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Country);
            DDL_Country.DataTextField  = "Item";
            DDL_Country.DataValueField = "Value";
            DDL_Country.DataBind();

            DDL_ResidenceIn.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Country);
            DDL_ResidenceIn.DataTextField  = "Item";
            DDL_ResidenceIn.DataValueField = "Value";
            DDL_ResidenceIn.DataBind();

            DDL_State.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.State);
            DDL_State.DataTextField  = "Item";
            DDL_State.DataValueField = "Value";
            DDL_State.DataBind();

            DDL_ResidentialStatus.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.ResidenceStatus);
            DDL_ResidentialStatus.DataTextField  = "Item";
            DDL_ResidentialStatus.DataValueField = "Value";
            DDL_ResidentialStatus.DataBind();

            short shortCounter;
            DDL_Weight.Items.Insert(0, "-- Select --");
            for (shortCounter = 40; shortCounter <= 140; ++shortCounter)
            {
                DDL_Weight.Items.Insert(shortCounter - 39, shortCounter + " KG");
            }

            DDL_Height.Items.Insert(0, "-- Select --");
            for (shortCounter = 90; shortCounter <= 185; ++shortCounter)
            {
                DDL_Height.Items.Insert(shortCounter - 89, shortCounter + " CM");
            }
        }
        else
        {
            sbyte  sbyteFlag = 0;
            string strApplicationID;
            //try
            //{
            HttpCookieCollection objHttpCookieCollection = Request.Cookies;
            HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatRegInfo");

            strApplicationID = Crypto.DeCrypto(objHttpCookie.Values[0]);

            if (strApplicationID != null)
            {
                //Inserting  Education and Occupation
                sbyteFlag = MatrimonialProfileManager.InsertEducationalInfo(strApplicationID, (sbyte)DDL_Education.SelectedIndex,
                                                                            (sbyte)DDL_EduDetails.SelectedIndex, (sbyte)DDL_AnnualIncome.SelectedIndex,
                                                                            (short)DDL_Currency.SelectedIndex, (sbyte)DDL_Occupation.SelectedIndex,
                                                                            (sbyte)DDL_EmpIn.SelectedIndex);


                // setting Physical Attributes

                sbyte sbyteBodyType = 0;
                sbyte sbyteSmoke    = 0;
                sbyte sbyteDrink    = 0;

                if (RB_BType_Slim.Checked)
                {
                    sbyteBodyType = 1;
                }
                else if (RB_BType_Avg.Checked)
                {
                    sbyteBodyType = 2;
                }
                else if (RB_BType_Ath.Checked)
                {
                    sbyteBodyType = 3;
                }
                else if (RB_BType_Heavy.Checked)
                {
                    sbyteBodyType = 4;
                }

                if (RB_Smoke_no.Checked)
                {
                    sbyteSmoke = 1;
                }
                else if (RB_Smoke_Yes.Checked)
                {
                    sbyteSmoke = 2;
                }
                else if (RB_Smoke_Occ.Checked)
                {
                    sbyteSmoke = 3;
                }

                if (RB_Drink_No.Checked)
                {
                    sbyteDrink = 1;
                }
                else if (RB_Drink_Yes.Checked)
                {
                    sbyteDrink = 2;
                }
                else if (RB_Drink_Occ.Checked)
                {
                    sbyteDrink = 3;
                }


                //Inserting Physical Attributes
                sbyteFlag += MatrimonialProfileManager.InsertPhysicalInfo(strApplicationID, (short)(DDL_Height.SelectedIndex + 89),
                                                                          (short)DDL_Weight.SelectedIndex, (sbyte)DDL_BGroup.SelectedIndex, sbyteBodyType,
                                                                          (sbyte)DDL_Diet.SelectedIndex, sbyteSmoke, sbyteDrink, (sbyte)DDL_Complexion.SelectedIndex);



                //Setting Contact Details
                sbyteFlag += MatrimonialProfileManager.InsertContactInfo(strApplicationID, TB_Address.Text, (short)DDL_Country.SelectedIndex,
                                                                         (sbyte)DDL_State.SelectedIndex, TB_City.Text, TB_Phone_NO.Text, TB_Phone_STD.Text, TB_Phone_ISD.Text,
                                                                         TB_Phone_Mobile.Text, (short)DDL_ResidenceIn.SelectedIndex, (sbyte)DDL_ResidentialStatus.SelectedIndex,
                                                                         TB_RCity.Text);
            }

            if (sbyteFlag == 3)
            {
                MatrimonialMemberShip.UpdateIndex(strApplicationID);
                Server.Transfer("RegistrationStep3.aspx");
            }
            else
            {
                Response.Redirect("../Extras/ErrorReport.aspx");
            }


            //}
            //catch (Exception)
            //{
            //    Response.Redirect("../Extras/ErrorReport.aspx?id=Cookie");
            //}
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);

            /// Text Counter Initiallisation

            txtCount.Text = TB_Expectations.MaxLength.ToString();

            TB_Expectations.Attributes.Add("onKeyUp", "javascript:document.getElementById('" + txtCount.ClientID + "').setAttribute('value', (" + TB_Expectations.MaxLength +
                                           " - parseInt(document.getElementById('" + TB_Expectations.ClientID + "').getAttribute('value').length)));");

            //load ddls
            //Getting Connection String

            //Connect To database
            LB_MaritalStatus.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.MaritalStatus);
            LB_MaritalStatus.DataTextField  = "Item";
            LB_MaritalStatus.DataValueField = "Value";
            LB_MaritalStatus.DataBind();
            LB_MaritalStatus.Items.RemoveAt(0);

            LB_Complexion.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Complexion);
            LB_Complexion.DataTextField  = "Item";
            LB_Complexion.DataValueField = "Value";
            LB_Complexion.DataBind();
            LB_Complexion.Items.RemoveAt(0);

            LB_MotherTongue.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.MotherTongue);
            LB_MotherTongue.DataTextField  = "Item";
            LB_MotherTongue.DataValueField = "Value";
            LB_MotherTongue.DataBind();
            LB_MotherTongue.Items.RemoveAt(0);

            LB_Religion.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Religion);
            LB_Religion.DataTextField  = "Item";
            LB_Religion.DataValueField = "Value";
            LB_Religion.DataBind();
            LB_Religion.Items.RemoveAt(0);

            LB_Caste.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Cast);
            LB_Caste.DataTextField  = "Item";
            LB_Caste.DataValueField = "Value";
            LB_Caste.DataBind();
            LB_Caste.Items.RemoveAt(0);
            LB_Caste.Items.RemoveAt(0);
            LB_Caste.Items.Insert(0, "Any");

            LB_Education.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Education);
            LB_Education.DataTextField  = "Item";
            LB_Education.DataValueField = "Value";
            LB_Education.DataBind();
            LB_Education.Items.RemoveAt(0);
            LB_Education.Items.Insert(0, "Any");


            LB_Edudetails.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.EduDetails);
            LB_Edudetails.DataTextField  = "Item";
            LB_Edudetails.DataValueField = "Value";
            LB_Edudetails.DataBind();
            LB_Edudetails.Items.RemoveAt(0);
            LB_Edudetails.Items.Insert(0, "Any");

            LB_AnnulIncome.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.AnnualIncomeRange);
            LB_AnnulIncome.DataTextField  = "Item";
            LB_AnnulIncome.DataValueField = "Value";
            LB_AnnulIncome.DataBind();
            LB_AnnulIncome.Items.RemoveAt(0);

            LB_Occupation.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Occupation);
            LB_Occupation.DataTextField  = "Item";
            LB_Occupation.DataValueField = "Value";
            LB_Occupation.DataBind();
            LB_Occupation.Items.RemoveAt(0);
            LB_Occupation.Items.Insert(0, "Any");

            LB_Citizenship.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Country);
            LB_Citizenship.DataTextField  = "Item";
            LB_Citizenship.DataValueField = "Value";
            LB_Citizenship.DataBind();
            LB_Citizenship.Items.RemoveAt(0);
            LB_Citizenship.Items.Insert(0, "Any");

            LB_CountryLiving.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Country);
            LB_CountryLiving.DataTextField  = "Item";
            LB_CountryLiving.DataValueField = "Value";
            LB_CountryLiving.DataBind();
            LB_CountryLiving.Items.RemoveAt(0);
            LB_CountryLiving.Items.Insert(0, "Any");

            LB_Rasident_State.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.State);
            LB_Rasident_State.DataTextField  = "Item";
            LB_Rasident_State.DataValueField = "Value";
            LB_Rasident_State.DataBind();
            LB_Rasident_State.Items.RemoveAt(0);
            LB_Rasident_State.Items.Insert(0, "Any");

            LB_Rasident_Status.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.ResidenceStatus);
            LB_Rasident_Status.DataTextField  = "Item";
            LB_Rasident_Status.DataValueField = "Value";
            LB_Rasident_Status.DataBind();
            LB_Rasident_Status.Items.RemoveAt(0);
            LB_Rasident_Status.Items.Insert(0, "Any");

            DDL_ChDosham.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.HoroManglic);
            DDL_ChDosham.DataTextField  = "Item";
            DDL_ChDosham.DataValueField = "Value";
            DDL_ChDosham.DataBind();
            DDL_ChDosham.Items.RemoveAt(5);


            DDL_EathingHabits.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Diet);
            DDL_EathingHabits.DataTextField  = "Item";
            DDL_EathingHabits.DataValueField = "Value";
            DDL_EathingHabits.DataBind();

            Int16 Int16Counter;
            DDL_Height_min.Items.Insert(0, "-- Select --");
            DDL_Height_Max.Items.Insert(0, "-- Select --");
            for (Int16Counter = 90; Int16Counter <= 185; ++Int16Counter)
            {
                DDL_Height_min.Items.Insert(Int16Counter - 89, Int16Counter + " CM");
                DDL_Height_Max.Items.Insert(Int16Counter - 89, Int16Counter + 1 + " CM");
            }


            TB_NonIndianState.Attributes.Add("visible", "false");
        }
        else
        {
            HttpCookieCollection objHttpCookieCollection = Request.Cookies;
            HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatRegInfo");

            strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]);

            // Inserting data into database
            if (strApplicationID != null)
            {
                sbyte sbyteFlag = 0;
                sbyte sbyteChildrenStatus;
                sbyte sbytePhysicalStatus;

                //-------------------------------------------------------------------------------------------------------------
                if (RB_ChildrenNO.Checked)
                {
                    sbyteChildrenStatus = 1;
                }
                else if (RB_ChildrenYesLT.Checked)
                {
                    sbyteChildrenStatus = 2;
                }
                else if (RB_ChildrenYesNLT.Checked)
                {
                    sbyteChildrenStatus = 3;
                }
                else if (RB_ChildrenDM.Checked)
                {
                    sbyteChildrenStatus = 4;
                }
                else
                {
                    sbyteChildrenStatus = 0;
                }

                //-------------------------------------------------------------------------------------------------------------

                if (RB_phy_nor.Checked)
                {
                    sbytePhysicalStatus = 1;
                }
                else if (RB_phy_Dis.Checked)
                {
                    sbytePhysicalStatus = 2;
                }
                else if (RB_phy_DMater.Checked)
                {
                    sbytePhysicalStatus = 3;
                }
                else
                {
                    sbytePhysicalStatus = 0;
                }

                //-------------------------------------------------------------------------------------------------------------

                // Loading Values From LB

                string strMaritalStatusList = "";
                string Flag = "";
                // Marital Status
                foreach (ListItem objListItem in LB_MaritalStatus.Items)
                {
                    if (objListItem.Selected)
                    {
                        strMaritalStatusList += Flag + objListItem.Value;
                        Flag = "%";
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Complexion
                string strComplexionList = "";

                Flag = "";

                foreach (ListItem objListItem in LB_Complexion.Items)
                {
                    if (objListItem.Selected)
                    {
                        strComplexionList += Flag + objListItem.Value;
                        Flag = "%";
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Mother Tongue
                string strMotherTongueList = "";

                Flag = "";

                foreach (ListItem objListItem in LB_MotherTongue.Items)
                {
                    if (objListItem.Selected)
                    {
                        strMotherTongueList += Flag + objListItem.Value;
                        Flag = "%";
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Religion
                string strReligionList = "";
                if (CB_Religion_Any.Checked)
                {
                    strReligionList = "##";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Religion.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strReligionList += Flag + objListItem.Value;
                            Flag             = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                //Caste
                string strCasteList = "";
                if (CB_Caste_Any.Checked)
                {
                    strCasteList = "##";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Caste.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strCasteList += Flag + objListItem.Value;
                            Flag          = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Education
                string strEducationList = "";
                if (CB_Education_Any.Checked)
                {
                    strEducationList = "##";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Education.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strEducationList += Flag + objListItem.Value;
                            Flag              = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // EduDetails
                string strEduDetailsList = "";
                if (CB_EduDet.Checked)
                {
                    strEduDetailsList = "##";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Edudetails.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strEduDetailsList += Flag + objListItem.Value;
                            Flag = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Occupation
                string strOccupationList = "";
                if (CB_Occupation_any.Checked)
                {
                    strOccupationList = "##";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Occupation.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strOccupationList += Flag + objListItem.Value;
                            Flag = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Citizenship
                string strCitizenshipList = "";
                if (CB_IndianX.Checked)
                {
                    strCitizenshipList = "##";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Citizenship.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strCitizenshipList += Flag + objListItem.Value;
                            Flag = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Country Living in
                string strCountryLivinginList = "";
                if (CB_Indian.Checked)
                {
                    strCountryLivinginList = "##";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Citizenship.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strCountryLivinginList += Flag + objListItem.Value;
                            Flag = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                // Country Living in
                string strStateList = "";
                if (!CB_StatesInIndia.Checked)
                {
                    strStateList = TB_NonIndianState.Text + "#";
                }
                else
                {
                    Flag = "";

                    foreach (ListItem objListItem in LB_Rasident_State.Items)
                    {
                        if (objListItem.Selected)
                        {
                            strStateList += Flag + objListItem.Value;
                            Flag          = "%";
                        }
                    }
                }
                //-------------------------------------------------------------------------------------------------------------
                //Residential Status
                string strResidentStatus = "";
                Flag = "";
                foreach (ListItem objListItem in LB_Rasident_Status.Items)
                {
                    if (objListItem.Selected)
                    {
                        strResidentStatus += Flag + objListItem.Value;
                        Flag = "%";
                    }
                }
                //--------------------------------------------------------------------------------------------------------------
                sbyteFlag = MatrimonialProfileManager.InsertMyExpectation(strApplicationID, TB_Expectations.Text);
                //--------------------------------------------------------------------------------------------------------------
                sbyteFlag += MatrimonialProfileManager.InsertPartnerPreferance(strApplicationID, strMaritalStatusList, sbyte.Parse(TB_Age_min.Text),
                                                                               sbyte.Parse(TB_Age_Max.Text), strComplexionList, sbyteChildrenStatus, (DDL_Height_min.SelectedIndex + 89), (DDL_Height_Max.SelectedIndex + 89),
                                                                               sbytePhysicalStatus, strMotherTongueList, strReligionList, strCasteList, DDL_ChDosham.SelectedIndex, DDL_EathingHabits.SelectedIndex,
                                                                               strEducationList, strEduDetailsList, LB_AnnulIncome.SelectedIndex, strOccupationList, strCitizenshipList, strCountryLivinginList,
                                                                               strStateList, strResidentStatus);
                //--------------------------------------------------------------------------------------------------------------

                if (sbyteFlag == 2)
                {
                    MatrimonialMemberShip.UpdateIndex(strApplicationID);
                    Server.Transfer("RegistrationConfirm.aspx");
                }
                else
                {
                    Server.Transfer("../Extras/ErrorReport.aspx");
                }
            }
            else
            {
            }
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Setting UserID

            HF_UaerID.Value = Crypto.DeCrypto(Request.QueryString["key"]);

            if (HF_UaerID.Value == null)
            {
                Response.Redirect("../Extras/ErrorReport.aspx?id=WrongKey");
            }


            //Getting Connection String

            //Connect To database

            //load all the DDLs

            //Loading IndexMotherTongue

            DDL_MotherTongue.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.MotherTongue);
            DDL_MotherTongue.DataTextField  = "Item";
            DDL_MotherTongue.DataValueField = "Value";
            DDL_MotherTongue.DataBind();

            // Loading Religion

            DDL_Religion.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Religion);
            DDL_Religion.DataTextField  = "Item";
            DDL_Religion.DataValueField = "Value";
            DDL_Religion.DataBind();


            // Loading Cast
            DDL_Cast.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Cast);
            DDL_Cast.DataTextField  = "Item";
            DDL_Cast.DataValueField = "Value";
            DDL_Cast.DataBind();


            // Loading Profile Created by
            DDL_ProfieCreated.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.ProfileCreatedBy);
            DDL_ProfieCreated.DataTextField  = "Item";
            DDL_ProfieCreated.DataValueField = "Value";
            DDL_ProfieCreated.DataBind();


            // Loading Reference by

            DDL_Reference.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.ReferenceBy);
            DDL_Reference.DataTextField  = "Item";
            DDL_Reference.DataValueField = "Value";
            DDL_Reference.DataBind();


            // Loading Star

            DDL_Star.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Star);
            DDL_Star.DataTextField  = "Item";
            DDL_Star.DataValueField = "Value";
            DDL_Star.DataBind();


            // Loading MoonSign

            DDL_Moon.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.MoonSign);
            DDL_Moon.DataTextField  = "Item";
            DDL_Moon.DataValueField = "Value";
            DDL_Moon.DataBind();

            DDL_SEqt.DataSource     = ControlDataLoader.DataForLoadingControls(ControlDataLoader.ControlType.Sequrity);
            DDL_SEqt.DataTextField  = "SequrityQuestion";
            DDL_SEqt.DataValueField = "Value";
            DDL_SEqt.DataBind();


            int intThisYear = DateTime.Now.Year - 18;
            for (int i = 0; i <= 32; ++i)
            {
                DDL_dobYear.Items.Add((intThisYear - i).ToString());
            }
        }
        else
        {
            if (CB_Accept.Checked)
            {
                //save details into data base

                sbyte sbyteFlag = 0;

                //Inserting AccountInformations
                strApplicationID = MatrimonialMemberShip.InsertAccountInfo(HF_UaerID.Value,
                                                                           FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password.Text, "MD5"), (sbyte)DDL_SEqt.SelectedIndex, TB_Answer.Text);
                //If Inserted
                Response.Write(strApplicationID);
                if (strApplicationID != null)
                {
                    // Basic member Informations
                    DateTime dtDOB;
                    sbyte    sbyteMaritalStatus = 0;
                    string   strPhysicalStatus;
                    string   strChildrenLivingStatus;


                    // Setting Date of birth
                    dtDOB = DateTime.Parse(DDL_dobMonth.SelectedIndex + " " + DDL_dobYear.SelectedIndex + "," + DDL_dobDay.SelectedIndex);


                    // Setting   MaritalStatus
                    if (RB_MS_UM.Checked)
                    {
                        sbyteMaritalStatus = 1;
                    }
                    else if (RB_MS_Div.Checked)
                    {
                        sbyteMaritalStatus = 2;
                    }
                    else if (RB_MS_Sep.Checked)
                    {
                        sbyteMaritalStatus = 3;
                    }
                    else if (RB_MS_WW.Checked)
                    {
                        sbyteMaritalStatus = 4;
                    }

                    //Setting NoOfChildren

                    if (RB_phy_nor.Checked)
                    {
                        strPhysicalStatus = true.ToString();
                    }
                    else if (RB_phy_Dis.Checked)
                    {
                        strPhysicalStatus = false.ToString();
                    }
                    else
                    {
                        strPhysicalStatus = null;
                    }

                    // setting Children Living With

                    if (RB_CH_LWM.Checked)
                    {
                        strChildrenLivingStatus = true.ToString();
                    }
                    else if (RB_CH_NWM.Checked)
                    {
                        strChildrenLivingStatus = false.ToString();
                    }
                    else
                    {
                        strChildrenLivingStatus = null;
                    }

                    //Inserting Basic Informations
                    sbyteFlag = MatrimonialProfileManager.InsertBasicInfo(strApplicationID,
                                                                          TB_Name.Text, RB_Male.Checked, dtDOB,
                                                                          (sbyte)DDL_MotherTongue.SelectedIndex,
                                                                          (sbyte)DDL_ProfieCreated.SelectedIndex,
                                                                          (sbyte)DDL_Cast.SelectedIndex, sbyteMaritalStatus,
                                                                          (sbyte)DDL_Religion.SelectedIndex,
                                                                          (sbyte)DDL_NoOfChildren.SelectedIndex,
                                                                          strPhysicalStatus, strChildrenLivingStatus,
                                                                          TB_SubCast.Text);

                    // SociaReligious member Informations

                    sbyte  sbyteHoroscopeMatch = 0;
                    string strTimeOfBirth      = null;
                    sbyte  sbyteManglik        = 0;

                    if (RB_Horoscope_NO.Checked)
                    {
                        sbyteHoroscopeMatch = 1;
                    }
                    else if (RB_Horoscope_Yes.Checked)
                    {
                        sbyteHoroscopeMatch = 2;
                    }
                    else if (RB_Horoscope_NoMatters.Checked)
                    {
                        sbyteHoroscopeMatch = 3;
                    }


                    if (RB_Manglik_No.Checked)
                    {
                        sbyteManglik = 1;
                    }
                    else if (RB_Manglik_Yes.Checked)
                    {
                        sbyteManglik = 2;
                    }
                    else if (RB_Manglik_DKnow.Checked)
                    {
                        sbyteManglik = 3;
                    }
                    else if (RB_Manglik_NA.Checked)
                    {
                        sbyteManglik = 4;
                    }

                    if ((TB_Time_H.Text != null) && (TB_Time_M.Text != null))
                    {
                        strTimeOfBirth = TB_Time_H.Text + ":" + TB_Time_M.Text + " " + DDL_Time.SelectedValue;
                    }

                    //Inserting SociaReligious Informations
                    sbyteFlag += MatrimonialProfileManager.InsertSocioReligiousInfo(strApplicationID, (sbyte)DDL_Star.SelectedIndex,
                                                                                    (sbyte)DDL_Moon.SelectedIndex, sbyteHoroscopeMatch, TB_POB.Text, strTimeOfBirth, sbyteManglik);

                    sbyteFlag += MatrimonialMessanger.SetMailingSettings(HF_UaerID.Value);
                }
                else
                {
                    Response.Redirect("../Extras/ErrorReport.aspx");
                }

                if (sbyteFlag == 3)
                {
                    MatrimonialMemberShip.UpdateIndex(strApplicationID);
                    HttpCookie objHttpCookie = new HttpCookie("MatRegInfo");
                    objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(strApplicationID);
                    objHttpCookie.Expires = DateTime.MaxValue; //<<<<<<<<<<<<<< ForTesting >>>>>>>>>>>
                    Response.Cookies.Add(objHttpCookie);

                    Server.Transfer("RegistrationStep2.aspx");
                }
                else
                {
                    Response.Write(strApplicationID);
                    //Response.Redirect("../Extras/ErrorReport.aspx");<< ForTesting >>
                }
            }
            else
            {
                LabelDisplay.Visible = true;
                LabelDisplay.Text    = "You Need to accept terms and conditions";
            }
        }
    }