コード例 #1
0
        //Load State
        #region [Load State]

        private void LoadStateDropDown(string cid)
        {
            try
            {
                if (DDL_Country.SelectedValue.Equals("Select") && DDL_Country.SelectedValue.Equals(""))
                {
                    msgBox.ShowMessage("Please Select Country First.. !!!", "Information", UserControls.MessageBox.MessageStyle.Critical);
                    SetFocus(DDL_Country.Text);
                }
                else
                {
                    DDL_State.DataTextField  = "name";
                    DDL_State.DataValueField = "cid";
                    DataSet ds = ViewState["DatasetAll"] as DataSet;

                    DataView dv = new DataView(ds.Tables["State"]);

                    dv.RowFilter         = "cid = " + cid;
                    DDL_State.DataSource = dv.ToTable();
                    DDL_State.DataBind();
                    DDL_State.Items.Insert(0, new ListItem(" Select ", "0"));
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
コード例 #2
0
ファイル: Second.aspx.cs プロジェクト: VijayMVC/G3_20130609
    //State
    protected void LoadStateCombo()
    {
        DDL_State.DataSource = ObjEntity.StateDetails;

        DDL_State.DataTextField  = "StateName";
        DDL_State.DataValueField = "StateID";
        DDL_State.DataBind();
        DDL_State.Items.Insert(0, new ListItem("--Select--", "0"));
    }
コード例 #3
0
 public void clear()
 {
     txtAddress.Text        = "";
     txtContactNo.Text      = "";
     txtEmail.Text          = "";
     txtEmailid.Text        = "";
     txtFaxNo.Text          = "";
     txtPinCode.Text        = "";
     txtUniversityName.Text = "";
     DDL_Country.ClearSelection();
     DDL_State.ClearSelection();
     DDL_City.ClearSelection();
 }
コード例 #4
0
    public void bind_state()
    {
        bl_RTI_Request objblData = new bl_RTI_Request();
        dl_RTI_Request objData   = new dl_RTI_Request();

        ReturnClass.ReturnDataTable rd = new ReturnClass.ReturnDataTable();
        DDL_State.Items.Clear();
        objblData.Country = ddl_country.SelectedValue;
        rd = objData.BindState(objblData);
        DDL_State.DataSource     = rd.table;
        DDL_State.DataTextField  = "state_name_e";
        DDL_State.DataValueField = "state_id";
        DDL_State.DataBind();
        DDL_State.Items.Add(new ListItem(" Choose State", "0"));
    }
コード例 #5
0
        public void Bind_ddlState()
        {
            cn.Open();

            SqlCommand cmd = new SqlCommand("select State,StateID from countryState where CountryId='" + DDL_Country.SelectedValue + "'", cn);

            SqlDataReader dr = cmd.ExecuteReader();

            DDL_State.DataSource = dr;
            DDL_State.Items.Clear();

            DDL_State.DataTextField  = "State";
            DDL_State.DataValueField = "StateID";
            DDL_State.DataBind();
            cn.Close();

            DDL_State.Items.Insert(0, new ListItem("--Please Select State--", "0"));
        }
コード例 #6
0
        //Load State
        #region [Load State]

        private void LoadStateDropDown(string cid)
        {
            try
            {
                DDL_State.DataTextField  = "name";
                DDL_State.DataValueField = "cid";
                DataSet ds = ViewState["DatasetAll"] as DataSet;

                DataView dv = new DataView(ds.Tables["State"]);

                dv.RowFilter         = "cid = " + cid;
                DDL_State.DataSource = dv.ToTable();
                DDL_State.DataBind();
                DDL_State.Items.Insert(0, new ListItem(" Select ", "0"));
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
コード例 #7
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);

            //Loading Controls

            // ----------------------------------------------------------------------------------------------
            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_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.Add(shortCounter + " KG");
            }


            // ----------------------------------------------------------------------------------------------
            // Lodig selections
            // ----------------------------------------------------------------------------------------------
            // Getting applicationID from Cookie
            HttpCookieCollection objHttpCookieCollection = Request.Cookies;
            HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");

            string strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]);
            //If Cookie is working
            if (strApplicationID != null)
            {
                //Get Member Informations
                MatMember objMember = new MatMember(true, strApplicationID, false, false, false, true, true, true, false, false, false, false);
                DDL_Education.SelectedIndex    = objMember.Education;
                DDL_EduDetails.SelectedIndex   = objMember.EduDetails;
                DDL_AnnualIncome.SelectedIndex = objMember.AnualIncome;
                DDL_Currency.SelectedIndex     = objMember.IncomeIn;
                DDL_Occupation.SelectedIndex   = objMember.Occupation;
                DDL_EmpIn.SelectedIndex        = objMember.EmployedIn;
                // ----------------------------------------------------------------------------------------------
                L_Height.Text            = objMember.Height.ToString() + " Cm";;
                DDL_Weight.SelectedIndex = objMember.Weight - 40;
                DDL_BGroup.SelectedIndex = objMember.BloodGroup;
                L_Complexion.Text        = ControlDataLoader.GetIndexValue(ControlDataLoader.ControlType.Complexion, objMember.Complexion);
                switch (objMember.BodyType)
                {
                case 1:
                    RB_BType_Slim.Checked = true;
                    break;

                case 2:
                    RB_BType_Avg.Checked = true;
                    break;

                case 3:
                    RB_BType_Ath.Checked = true;
                    break;

                case 4:
                    RB_BType_Heavy.Checked = true;
                    break;

                default:
                    break;
                }
                // ----------------------------------------------------------------------------------------------
                DDL_Diet.SelectedIndex = objMember.Diet;

                switch (objMember.Smoke)
                {
                case 1:
                    RB_Smoke_no.Checked = true;
                    break;

                case 2:
                    RB_Smoke_Yes.Checked = true;
                    break;

                case 3:
                    RB_Smoke_Occ.Checked = true;
                    break;

                default:
                    break;
                }
                // ----------------------------------------------------------------------------------------------
                switch (objMember.Drink)
                {
                case 1:
                    RB_Drink_No.Checked = true;
                    break;

                case 2:
                    RB_Drink_Yes.Checked = true;
                    break;

                case 3:
                    RB_Drink_Occ.Checked = true;
                    break;

                default:
                    break;
                }
                // ----------------------------------------------------------------------------------------------
                //Contact Details
                // ----------------------------------------------------------------------------------------------
                TB_Address.Text = objMember.Address;

                DDL_Country.SelectedIndex = objMember.Country;

                DDL_State.SelectedIndex = objMember.State;

                TB_City.Text = objMember.City;

                DDL_ResidenceIn.SelectedIndex = objMember.Residence;

                DDL_ResidentialStatus.SelectedIndex = objMember.ResidenceType;

                TB_Phone_ISD.Text = "+" + objMember.ISDCode.ToString();
                TB_Phone_STD.Text = objMember.AreaCode.ToString();
                TB_Phone_NO.Text  = objMember.PhoneNo.ToString();

                TB_Phone_Mobile.Text = objMember.MobileNO.ToString();

                TB_RCity.Text = objMember.ResidenceCity;

                objMember = null;
                // ----------------------------------------------------------------------------------------------
            }//If StrApplicationID != Null
        }   //if
        else
        {
            sbyte  sbyteFlag = 0;
            string strApplicationID;
            try
            {
                HttpCookieCollection objHttpCookieCollection = Request.Cookies;
                HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");

                strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]);
                if (strApplicationID != null)
                {
                    //Inserting  Education and Occupation
                    sbyteFlag = MatrimonialProfileManager.UpdateEducationalInfo(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;
                    }

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

                    //Drinking Habit
                    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.UpdatePhysicalInfo(strApplicationID,
                                                                              (short)DDL_Weight.SelectedIndex, (sbyte)DDL_BGroup.SelectedIndex, sbyteBodyType,
                                                                              (sbyte)DDL_Diet.SelectedIndex, sbyteSmoke, sbyteDrink);
                    // ----------------------------------------------------------------------------------------------
                    //Setting Contact Details
                    sbyteFlag += MatrimonialProfileManager.UpdateContactInfo(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, (sbyte)DDL_ResidenceIn.SelectedIndex, (sbyte)DDL_ResidentialStatus.SelectedIndex,
                                                                             TB_RCity.Text);
                    // ----------------------------------------------------------------------------------------------
                }

                if (sbyteFlag == 3)// Every module is updated correctly
                {
                    Response.Redirect("EditProfile-S3.aspx");
                }
                else// Some have some error
                {
                    Server.Transfer("../Extras/ErrorReport.aspx");
                }
            }
            catch (Exception Ex)//Oops Some Error Happend
            {
                ErrorLog.WriteErrorLog("Member-EditProfile S2-PB", Ex);
                Server.Transfer("../Extras/ErrorReport.aspx?id=Cookie");
            }
        }//postbak
    }
コード例 #8
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");
            //}
        }
    }
コード例 #9
0
    private void LoadStep2()
    {
        using (SqlConnection objConnection = DBConnection.GetSqlConnection())
        {
            objConnection.Open();
            try
            {
                SqlCommand    objCommand    = new SqlCommand("SELECT * FROM IndexEducation", objConnection);
                SqlDataReader objDataReader = objCommand.ExecuteReader();

                DDL_Education.DataSource     = objDataReader;
                DDL_Education.DataTextField  = "Item";
                DDL_Education.DataValueField = "Value";
                DDL_Education.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexEduDetails", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_EduDetails.DataSource     = objDataReader;
                DDL_EduDetails.DataTextField  = "Item";
                DDL_EduDetails.DataValueField = "Value";
                DDL_EduDetails.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexAnnualIncomeRange", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_AnnualIncome.DataSource     = objDataReader;
                DDL_AnnualIncome.DataTextField  = "Item";
                DDL_AnnualIncome.DataValueField = "Value";
                DDL_AnnualIncome.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexCurrency", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_Currency.DataSource     = objDataReader;
                DDL_Currency.DataTextField  = "Item";
                DDL_Currency.DataValueField = "Value";
                DDL_Currency.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexOccupation", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_Occupation.DataSource     = objDataReader;
                DDL_Occupation.DataTextField  = "Item";
                DDL_Occupation.DataValueField = "Value";
                DDL_Occupation.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexEmployedIn", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_EmpIn.DataSource     = objDataReader;
                DDL_EmpIn.DataTextField  = "Item";
                DDL_EmpIn.DataValueField = "Value";
                DDL_EmpIn.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexBloodGroup", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_BGroup.DataSource     = objDataReader;
                DDL_BGroup.DataTextField  = "Item";
                DDL_BGroup.DataValueField = "Value";
                DDL_BGroup.DataBind();
                objDataReader.Close();


                objCommand    = new SqlCommand("SELECT * FROM IndexDiet", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_Diet.DataSource     = objDataReader;
                DDL_Diet.DataTextField  = "Item";
                DDL_Diet.DataValueField = "Value";
                DDL_Diet.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexCountry", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_Country.DataSource     = objDataReader;
                DDL_Country.DataTextField  = "Item";
                DDL_Country.DataValueField = "Value";
                DDL_Country.DataBind();
                objDataReader.Close();

                objDataReader = objCommand.ExecuteReader();

                DDL_ResidenceIn.DataSource     = objDataReader;
                DDL_ResidenceIn.DataTextField  = "Item";
                DDL_ResidenceIn.DataValueField = "Value";
                DDL_ResidenceIn.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexState", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_State.DataSource     = objDataReader;
                DDL_State.DataTextField  = "Item";
                DDL_State.DataValueField = "Value";
                DDL_State.DataBind();
                objDataReader.Close();

                objCommand    = new SqlCommand("SELECT * FROM IndexResidenceStatus", objConnection);
                objDataReader = objCommand.ExecuteReader();

                DDL_ResidentialStatus.DataSource     = objDataReader;
                DDL_ResidentialStatus.DataTextField  = "Item";
                DDL_ResidentialStatus.DataValueField = "Value";
                DDL_ResidentialStatus.DataBind();
                objDataReader.Close();

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

                objConnection.Close();
            }
            catch (Exception Ex)
            {
                ErrorLog.WriteErrorLog("Admin-EditProfile:S2-LD", Ex);
                objConnection.Close();
                Server.Transfer("../Extras/ErrorReport.aspx");
            }
        }//using



        string strApplicationID = MatrimonialMemberShip.GetApplicationID(HF_MatID.Value);

        //If Cookie is working
        if (strApplicationID != null)
        {
            //Get Member Informations
            MatMember objMember = new MatMember(true, strApplicationID, false, false, false, true, true, true, false, false, false, false);
            DDL_Education.SelectedIndex    = objMember.Education;
            DDL_EduDetails.SelectedIndex   = objMember.EduDetails;
            DDL_AnnualIncome.SelectedIndex = objMember.AnualIncome;
            DDL_Currency.SelectedIndex     = objMember.IncomeIn;
            DDL_Occupation.SelectedIndex   = objMember.Occupation;
            DDL_EmpIn.SelectedIndex        = objMember.EmployedIn;

            L_Height.Text            = objMember.Height.ToString() + " Cm";;
            DDL_Weight.SelectedIndex = objMember.Weight - 40;
            DDL_BGroup.SelectedIndex = objMember.BloodGroup;
            L_Complexion.Text        = ControlDataLoader.GetIndexValue(ControlDataLoader.ControlType.Complexion, objMember.Complexion);
            switch (objMember.BodyType)
            {
            case 1:
                RB_BType_Slim.Checked = true;
                break;

            case 2:
                RB_BType_Avg.Checked = true;
                break;

            case 3:
                RB_BType_Ath.Checked = true;
                break;

            case 4:
                RB_BType_Heavy.Checked = true;
                break;

            default:
                break;
            }

            DDL_Diet.SelectedIndex = objMember.Diet;

            switch (objMember.Smoke)
            {
            case 1:
                RB_Smoke_no.Checked = true;
                break;

            case 2:
                RB_Smoke_Yes.Checked = true;
                break;

            case 3:
                RB_Smoke_Occ.Checked = true;
                break;

            default:
                break;
            }

            switch (objMember.Drink)
            {
            case 1:
                RB_Drink_No.Checked = true;
                break;

            case 2:
                RB_Drink_Yes.Checked = true;
                break;

            case 3:
                RB_Drink_Occ.Checked = true;
                break;

            default:
                break;
            }

            //Contact Details


            TB_Address.Text = objMember.Address;

            DDL_Country.SelectedIndex = objMember.Country;

            DDL_State.SelectedIndex = objMember.State;

            TB_City.Text = objMember.City;

            DDL_ResidenceIn.SelectedIndex = objMember.Residence;

            DDL_ResidentialStatus.SelectedIndex = objMember.ResidenceType;

            TB_Phone_ISD.Text = "+" + objMember.ISDCode.ToString();
            TB_Phone_STD.Text = objMember.AreaCode.ToString();
            TB_Phone_NO.Text  = objMember.PhoneNo.ToString();

            TB_Phone_Mobile.Text = objMember.MobileNO.ToString();

            TB_RCity.Text = objMember.ResidenceCity;

            objMember = null;
        }
    }
コード例 #10
0
        // Selected Index Changes
        #region Selected Index Change

        protected void lnkBtnUniversityName_Click(object sender, EventArgs e)
        {
            try
            {
                btnNew.Visible    = false;
                btnSave.Visible   = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;

                txtUniversityName.Enabled = true;
                txtAddress.Enabled        = true;

                txtEmail.Enabled = true;

                txtPinCode.Enabled   = true;
                txtContactNo.Enabled = true;
                txtFaxNo.Enabled     = true;

                flpLogo.Enabled     = true;
                DDL_City.Enabled    = true;
                DDL_Country.Enabled = true;
                DDL_State.Enabled   = true;

                lock (this)
                {
                    LinkButton  lnkBtnId = (LinkButton)sender;
                    GridViewRow grdrow   = lnkBtnId.NamingContainer as GridViewRow;
                    ViewState["UniversityId"] = GrdUniversity.DataKeys[grdrow.RowIndex].Values["UniversityId"].ToString();
                    txtUniversityName.Text    = GrdUniversity.DataKeys[grdrow.RowIndex].Values["UniversityName"].ToString();
                    txtAddress.Text           = GrdUniversity.DataKeys[grdrow.RowIndex].Values["Address"].ToString();

                    //LoadCountryDropDown();
                    // DDL_Country.SelectedValue = GrdUniversity.DataKeys[grdrow.RowIndex].Values["Country"].ToString();
                    //LoadStateDropDown(DDL_Country.SelectedValue);
                    //LoadCityDropDown(DDL_State.SelectedValue);
                    // DDL_City.SelectedValue = GrdUniversity.DataKeys[grdrow.RowIndex].Values["City"].ToString();
                    //DDL_Country.SelectedValue = ds.Tables[0].Rows[0]["Country"].ToString();


                    //FETCH COUNTRY,STATE,CITY
                    int id = Convert.ToInt32(ViewState["UniversityId"].ToString());

                    country = db.getDbstatus_Value("select Country from tblUniversity where UniversityId='" + id + "'");
                    //  DDL_Country.Items.FindByValue(CountryId).Selected = true;
                    DDL_Country.ClearSelection();
                    float abc = db.getDb_Value("select CountryId from Country where County='" + country.ToString() + "' ");
                    DDL_Country.SelectedValue = abc.ToString();


                    sta = db.getDbstatus_Value("select State from tblUniversity where UniversityId='" + id + "'");
                    DDL_State.ClearSelection();
                    Bind_ddlState1();
                    float pqr = db.getDb_Value("select StateId from countryState where State='" + sta.ToString() + "'");
                    DDL_State.SelectedValue = pqr.ToString();

                    ci = db.getDbstatus_Value("select City from tblUniversity where UniversityId='" + id + "'");
                    DDL_City.ClearSelection();
                    Bind_ddlCity1();
                    float xyz = db.getDb_Value("select DistrictId from tblDistrict where District='" + ci.ToString() + "'");
                    DDL_City.SelectedValue = xyz.ToString();


                    // DDL_State.Text = state.ToString();
                    //DDL_State.SelectedValue = state.ToString();
                    // DDL_State.SelectedValue = GrdUniversity.DataKeys[grdrow.RowIndex].Values["state"].ToString();



                    txtPinCode.Text   = GrdUniversity.DataKeys[grdrow.RowIndex].Values["PinCode"].ToString();
                    txtEmail.Text     = GrdUniversity.DataKeys[grdrow.RowIndex].Values["Email"].ToString();
                    txtContactNo.Text = GrdUniversity.DataKeys[grdrow.RowIndex].Values["ContactNo1"].ToString();
                    txtFaxNo.Text     = GrdUniversity.DataKeys[grdrow.RowIndex].Values["FaxNo1"].ToString();
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }