Esempio n. 1
0
        private void BindDropDowns(string path)
        {
            dtMaritalStatus                 = XMLBo.GetMaritalStatus(path);
            ddlMaritalStatus.DataSource     = dtMaritalStatus;
            ddlMaritalStatus.DataTextField  = "MaritalStatus";
            ddlMaritalStatus.DataValueField = "MaritalStatusCode";
            ddlMaritalStatus.DataBind();
            ddlMaritalStatus.Items.Insert(0, new ListItem("Select a Status", "Select a Status"));

            dtNationality                 = XMLBo.GetNationality(path);
            ddlNationality.DataSource     = dtNationality;
            ddlNationality.DataTextField  = "Nationality";
            ddlNationality.DataValueField = "NationalityCode";
            ddlNationality.DataBind();
            ddlNationality.Items.Insert(0, new ListItem("Select a Nationality", "Select a Nationality"));

            dtOccupation                 = XMLBo.GetOccupation(path);
            ddlOccupation.DataSource     = dtOccupation;
            ddlOccupation.DataTextField  = "Occupation";
            ddlOccupation.DataValueField = "OccupationCode";
            ddlOccupation.DataBind();
            ddlOccupation.Items.Insert(0, new ListItem("Select an Occupation", "Select a Occupation"));

            dtQualification                 = XMLBo.GetQualification(path);
            ddlQualification.DataSource     = dtQualification;
            ddlQualification.DataTextField  = "Qualification";
            ddlQualification.DataValueField = "QualificationCode";
            ddlQualification.DataBind();
            ddlQualification.Items.Insert(0, new ListItem("Select a Qualification", "Select a Qualification"));

            dtStates = XMLBo.GetStates(path);
            ddlCorrAdrState.DataSource     = dtStates;
            ddlCorrAdrState.DataTextField  = "StateName";
            ddlCorrAdrState.DataValueField = "StateCode";
            ddlCorrAdrState.DataBind();
            ddlCorrAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

            ddlPermAdrState.DataSource     = dtStates;
            ddlPermAdrState.DataTextField  = "StateName";
            ddlPermAdrState.DataValueField = "StateCode";
            ddlPermAdrState.DataBind();
            ddlPermAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

            ddlOfcAdrState.DataSource     = dtStates;
            ddlOfcAdrState.DataTextField  = "StateName";
            ddlOfcAdrState.DataValueField = "StateCode";
            ddlOfcAdrState.DataBind();
            ddlOfcAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));
        }
        private void BindDropDowns()
        {
            AdvisorVo advisorVo = new AdvisorVo();

            try
            {
                dtMaritalStatus                 = XMLBo.GetMaritalStatus(path);
                ddlMaritalStatus.DataSource     = dtMaritalStatus;
                ddlMaritalStatus.DataTextField  = "MaritalStatus";
                ddlMaritalStatus.DataValueField = "MaritalStatusCode";
                ddlMaritalStatus.DataBind();
                ddlMaritalStatus.Items.Insert(0, new ListItem("Select a Status", "Select a Status"));

                dtNationality                 = XMLBo.GetNationality(path);
                ddlNationality.DataSource     = dtNationality;
                ddlNationality.DataTextField  = "Nationality";
                ddlNationality.DataValueField = "NationalityCode";
                ddlNationality.DataBind();
                ddlNationality.Items.Insert(0, new ListItem("Select a Nationality", "Select a Nationality"));

                dtOccupation                 = XMLBo.GetOccupation(path);
                ddlOccupation.DataSource     = dtOccupation;
                ddlOccupation.DataTextField  = "Occupation";
                ddlOccupation.DataValueField = "OccupationCode";
                ddlOccupation.DataBind();
                ddlOccupation.Items.Insert(0, new ListItem("Select a Occupation", "Select a Occupation"));

                dtQualification                 = XMLBo.GetQualification(path);
                ddlQualification.DataSource     = dtQualification;
                ddlQualification.DataTextField  = "Qualification";
                ddlQualification.DataValueField = "QualificationCode";
                ddlQualification.DataBind();
                ddlQualification.Items.Insert(0, new ListItem("Select a Qualification", "Select a Qualification"));

                dtState = XMLBo.GetStates(path);

                ddlCorrAdrState.DataSource     = dtState;
                ddlCorrAdrState.DataTextField  = "StateName";
                ddlCorrAdrState.DataValueField = "StateCode";
                ddlCorrAdrState.DataBind();
                ddlCorrAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

                ddlPermAdrState.DataSource     = dtState;
                ddlPermAdrState.DataTextField  = "StateName";
                ddlPermAdrState.DataValueField = "StateCode";
                ddlPermAdrState.DataBind();
                ddlPermAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

                ddlOfcAdrState.DataSource     = dtState;
                ddlOfcAdrState.DataTextField  = "StateName";
                ddlOfcAdrState.DataValueField = "StateCode";
                ddlOfcAdrState.DataBind();
                ddlOfcAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

                if (customerVo.Type.ToUpper().ToString() == "IND")
                {
                    dtCustomerSubType = XMLBo.GetCustomerSubType(path, "IND");
                }
                else
                {
                    dtCustomerSubType = XMLBo.GetCustomerSubType(path, "NIND");
                }
                ddlCustomerSubType.DataSource     = dtCustomerSubType;
                ddlCustomerSubType.DataTextField  = "CustomerTypeName";
                ddlCustomerSubType.DataValueField = "CustomerSubTypeCode";
                ddlCustomerSubType.DataBind();
                ddlCustomerSubType.SelectedValue = customerVo.SubType;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "EditCustomerIndividualProfile.ascx:BindDropDowns()");

                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }