예제 #1
0
    public DropDownList fillDropDown(DropDownList DropDownList1, string sListName, string sTableName)
    {
        BackofficeClass objBackofficeClass = new BackofficeClass(sqlConn);

        DropDownList1.DataSource = objBackofficeClass.GET_Items_AnyItemTable(sListName, sTableName);
        DropDownList1.DataTextField = "ITEM_TEXT";
        DropDownList1.DataValueField = "ITEM_VALUE";
        DropDownList1.DataBind();

        return DropDownList1;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        lblError.Text = "";

        try
        {
            //    Response.Write(AppLib.Encrypt("1"));
            /*DateTime dtTodayDate = DateTime.Now;
            DateTime dtBDate = Convert.ToDateTime("16/06/1983");
            Response.Write(dtTodayDate - dtBDate);*/

            objBackofficeClass = new BackofficeClass(objSqlConnClass.OpenConnection());
            objUsersClass = new UsersClass(objSqlConnClass.sqlConnection);

            if (ViewState["gsAccountFrom"] != null)
            {
                gsAccountFrom = ViewState["gsAccountFrom"].ToString();
            }

            if (Request.QueryString["cid"] != null && Request.QueryString["id"] != null)
            {
                BindCompanyDetails();
                /*TextBox txtOrganization = (TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtOrganization");
                txtOrganization.Attributes.Add("Readonly", "true");*/
            }

            if (!IsPostBack)
            {
                BindCompanyControl();
                giShowReceipt = 1;
                giSendEmail = 1;
                CreateUserWizard1.FinishDestinationPageUrl = "/";
                CreateUserWizard1.LoginCreatedUser = false;

                //////////////////////////////////////////////////////////
                //Taking the List of Items in DataSets from the Database
                //////////////////////////////////////////////////////////

                // DataSet DegreeDS =

                DataSet StateDS = objBackofficeClass.GET_Items_AnyItemTable("State", "List_StateCountry");
                DataSet CountryDS = objBackofficeClass.GET_Items_AnyItemTable("Country", "List_StateCountry");

                ///////////////////////////////////////////////////////////////////////////////////////
                //Assigning the DropDownList objects by finding the controls from the createuserwizard
                ////////////////////////////////////////////////////////////////////////////////////////

                DropDownList ddlDegree = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlDegree");
                DropDownList ddlYourRole = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlYourRole");
                DropDownList ddlState = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlState");
                DropDownList ddlCountry = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlCountry");
                DropDownList ddlAccountFromRelationship = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlAccountFromRelationship");
                DropDownList ddlGender = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlGender");
                DropDownList ddlFamilyStatus = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlFamilyStatus");

                /////////////////////////////
                //Binding the DropDownLists
                ////////////////////////////

                ddlDegree = objSqlConnClass.fillDropDown(ddlDegree, "Degree", "List_Items");
                ddlYourRole = objSqlConnClass.fillDropDown(ddlYourRole, "Your Role", "List_Items");
                ddlAccountFromRelationship = objSqlConnClass.fillDropDown(ddlAccountFromRelationship, "Account From Relationship", "List_Items");
                ddlGender = objSqlConnClass.fillDropDown(ddlGender, "Gender", "List_Items");
                ddlFamilyStatus = objSqlConnClass.fillDropDown(ddlFamilyStatus, "Family Status", "List_Items");

                BindDropDownList(ddlState, StateDS);
                BindDropDownList(ddlCountry, CountryDS);
            }
        }
        catch (Exception ex) { }
        finally
        {
            objSqlConnClass.CloseConnection();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        lblError.Text = "";
        //Response.Write(AppLib.Encrypt("1"));
        try
        {
            // David K. Bowers 04/12/12
            // --- start validate invite id
            // to be a valid instance of the registration page the user must have come in from the invite email link
            // which contains the iid parameter.  The iid parenter is the intCompanyRequestedUsersListId column in
            // the tbl_CompanyRequestedUsersList.  The iid is read from the url and stored in a hidden form field.  If
            // its not in either place then its invalid so redirect them to the resend invite form
            string get_iid = "";
            var giid = Request.QueryString["iid"];
            if (giid != null)
            {
                get_iid = giid.ToString();
                textIID.Value = get_iid;
                iInviteId = Convert.ToInt32(get_iid);
            }
            else
            {

                string hidden_iid = textIID.Value.Trim();
                if (hidden_iid.Length > 0) iInviteId = Convert.ToInt32(hidden_iid);
            }
            if (iInviteId == 0)
            {
                Response.Redirect("ResendInvite.aspx");
            }
            // --- end validate invite id

            objBackofficeClass = new BackofficeClass(objSqlConnClass.OpenConnection());
            objUsersClass = new UsersClass(objSqlConnClass.sqlConnection);

            DataSet DS = new DataSet();
            DS = objUsersClass.USR_GetInviteCompany(iInviteId);
            if (DS != null)
            {
                iCompanyId = Convert.ToInt32(DS.Tables[0].Rows[0]["intCompanyId"].ToString());
                sCompanyName = DS.Tables[0].Rows[0]["strCompanyName"].ToString();
                sEmpFirstName = DS.Tables[0].Rows[0]["strEmpFirstName"].ToString();
                sEmpLastName = DS.Tables[0].Rows[0]["strEmpLastName"].ToString();
                sEmpEmail = DS.Tables[0].Rows[0]["strEmpEmail"].ToString();
            }

            if (ViewState["gsAccountFrom"] != null)
            {
                gsAccountFrom = ViewState["gsAccountFrom"].ToString();
            }

        /*
         * =====================================================================
         * David Bowers 5/3/2012
         * I can't figure out what this is for so I am commenting it out for now
         * =====================================================================
            //DropDownList ddlCompany = (DropDownList)CreateUserWizardStep1.ContentTemplateContainer.FindControl("ddlCompany");
            if (Request.QueryString["cid"] != null && Request.QueryString["id"] != null)
            {
                //ddlCompany.Visible = false;
                BindCompanyDetails();
            }
            else
            {
               // ddlCompany.Visible = true;
            }
        */
            TextBox txtOrganization = (TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtOrganization");
            txtOrganization.Text = sCompanyName;
            txtOrganization.ReadOnly = true;
            txtOrganization.Visible = true;

            if (!IsPostBack)
            {

        /*
         * =====================================================================
         * David Bowers 5/3/2012
         * I can't figure out what this is for so I am commenting it out for now
         * =====================================================================
                if (Request.QueryString["cid"] == null && Request.QueryString["id"] == null)
                    BindCompanyControl();
        */

                giShowReceipt = 1;
                giSendEmail = 1;
                CreateUserWizard1.FinishDestinationPageUrl = "/";
                CreateUserWizard1.LoginCreatedUser = false;

                //////////////////////////////////////////////////////////
                //Taking the List of Items in DataSets from the Database
                //////////////////////////////////////////////////////////

                // DataSet DegreeDS =

                DataSet StateDS = objBackofficeClass.GET_Items_AnyItemTable("State", "List_StateCountry");
                DataSet CountryDS = objBackofficeClass.GET_Items_AnyItemTable("Country", "List_StateCountry");

                ///////////////////////////////////////////////////////////////////////////////////////
                //Assigning the DropDownList objects by finding the controls from the createuserwizard
                ////////////////////////////////////////////////////////////////////////////////////////

                DropDownList ddlDegree = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlDegree");
                DropDownList ddlYourRole = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlYourRole");
                DropDownList ddlState = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlState");
                DropDownList ddlAccountFromRelationship = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlAccountFromRelationship");
                DropDownList ddlGender = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlGender");
                DropDownList ddlFamilyStatus = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlFamilyStatus");

                /////////////////////////////
                //Binding the DropDownLists
                ////////////////////////////

                ddlDegree = objSqlConnClass.fillDropDown(ddlDegree, "Degree", "List_Items");
                ddlYourRole = objSqlConnClass.fillDropDown(ddlYourRole, "Your Role", "List_Items");
                ddlAccountFromRelationship = objSqlConnClass.fillDropDown(ddlAccountFromRelationship, "Account From Relationship", "List_Items");
                ddlGender = objSqlConnClass.fillDropDown(ddlGender, "Gender", "List_Items");
                ddlFamilyStatus = objSqlConnClass.fillDropDown(ddlFamilyStatus, "Family Status", "List_Items");

                BindDropDownList(ddlState, StateDS);
            }
        }
        catch (Exception ex) { }
        finally
        {
            objSqlConnClass.CloseConnection();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        lblError.Text = "";

        try
        {
            objBackofficeClass = new BackofficeClass(objSqlConnClass.OpenConnection());
            objUsersClass = new UsersClass(objSqlConnClass.sqlConnection);

            if (ViewState["gsAccountFrom"] != null)
            {
                gsAccountFrom = ViewState["gsAccountFrom"].ToString();
            }

            if (!IsPostBack)
            {

                giShowReceipt = 1;
                giSendEmail = 1;
                CreateUserWizard1.FinishDestinationPageUrl = "/";
                CreateUserWizard1.LoginCreatedUser = false;

                //////////////////////////////////////////////////////////
                //Taking the List of Items in DataSets from the Database
                //////////////////////////////////////////////////////////

                // DataSet DegreeDS =

                DataSet StateDS = objBackofficeClass.GET_Items_AnyItemTable("State", "List_StateCountry");
                DataSet CountryDS = objBackofficeClass.GET_Items_AnyItemTable("Country", "List_StateCountry");

                ///////////////////////////////////////////////////////////////////////////////////////
                //Assigning the DropDownList objects by finding the controls from the createuserwizard
                ////////////////////////////////////////////////////////////////////////////////////////

                DropDownList ddlDegree = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlDegree");
                DropDownList ddlState = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlState");
                DropDownList ddlCountry = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlCountry");
                DropDownList ddlAccountFromRelationship = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlAccountFromRelationship");
                DropDownList ddlGender = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlGender");
                DropDownList ddlFamilyStatus = (DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlFamilyStatus");

                /////////////////////////////
                //Binding the DropDownLists
                ////////////////////////////

                ddlDegree = objSqlConnClass.fillDropDown(ddlDegree, "Degree", "List_Items");
                //ddlYourRole = objSqlConnClass.fillDropDown(ddlYourRole, "Your Role", "List_Items");
                ddlAccountFromRelationship = objSqlConnClass.fillDropDown(ddlAccountFromRelationship, "Account From Relationship", "List_Items");
                ddlGender = objSqlConnClass.fillDropDown(ddlGender, "Gender", "List_Items");
                ddlFamilyStatus = objSqlConnClass.fillDropDown(ddlFamilyStatus, "Family Status", "List_Items");

                BindDropDownList(ddlState, StateDS);
                BindDropDownList(ddlCountry, CountryDS);
            }
        }
        catch (Exception ex) { }
        finally
        {
            objSqlConnClass.CloseConnection();
        }
    }