protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Database db = new Database();

                //SqlCommand cmd = new SqlCommand("Select * from Company where status=1");
                //DataTable dt = db.getDataTable(cmd);

                //ddlCompany.DataSource = dt;
                //ddlCompany.DataValueField = "CompanyID";
                //ddlCompany.DataTextField = "Name";
                //ddlCompany.DataBind();

                //ddlCompany.Items.Insert(0, new ListItem("---Select A Company---", "0"));
                //SqlCommand cmdUserType = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType='UserType'");
                //DataTable dtUserType = db.getDataTable(cmdUserType);
                //ddlUserType.DataSource = dtUserType;
                //ddlUserType.DataValueField = "CodeValue";
                //ddlUserType.DataTextField = "CodeDesc";
                //ddlUserType.DataBind();
                //ddlUserType.Items.Insert(0, new ListItem("---Select A User Type---", "0"));
                SqlCommand cmd = new SqlCommand("select * from CodeReferece where CodeType='Industry' ");
                DataTable  dt  = db.getDataTable(cmd);
                CoIndustry.DataSource     = dt;
                CoIndustry.DataValueField = "CodeValue";
                CoIndustry.DataTextField  = "CodeValue";
                CoIndustry.DataBind();
                CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
            }
        }
Exemplo n.º 2
0
        //CoName=companynametextboxID
        //CoIndustry=companyIndustrytextboxID
        protected void Page_Load(object sender, EventArgs e)
        {
            // Deny normal user access
            if (Session["userType"].ToString() == Reference.USR_MEM)
            {
                /* string script = "alert('You do not have access to the page.');";
                 * ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true); */

                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "alert('You do not have access to this page'); window.location='" +
                                                    Request.ApplicationPath + "ProfileInfo.aspx';", true);
            }

            if (!IsPostBack)
            {
                if (Session["userType"].ToString() == Reference.USR_ADM)
                {
                    Company            CompanyObj = new Company();
                    Company_Management CDao       = new Company_Management();


                    CompanyObj = CDao.getCompanyByID(Session["CompanyID"].ToString());

                    CoName.Text = CompanyObj.Name;
                    CoIndustry.SelectedValue = CompanyObj.Industry;
                    Database   db  = new Database();
                    SqlCommand cmd = new SqlCommand("select * from CodeReferece where CodeType='Industry' ");
                    DataTable  dt  = db.getDataTable(cmd);
                    CoIndustry.DataSource     = dt;
                    CoIndustry.DataValueField = "CodeValue";
                    CoIndustry.DataTextField  = "CodeValue";
                    CoIndustry.DataBind();
                    CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Deny normal user access
            if (Session["userType"].ToString() == Reference.USR_MEM)
            {
                /* string script = "alert('You do not have access to the page.');";
                 * ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true); */

                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "alert('You do not have access to this page'); window.location='" +
                                                    Request.ApplicationPath + "ProfileInfo.aspx';", true);
            }

            if (!IsPostBack)
            {
                Database db = new Database();

                //SqlCommand cmd = new SqlCommand("Select * from Company where status=1");
                //DataTable dt = db.getDataTable(cmd);

                //ddlCompany.DataSource = dt;
                //ddlCompany.DataValueField = "CompanyID";
                //ddlCompany.DataTextField = "Name";
                //ddlCompany.DataBind();

                //ddlCompany.Items.Insert(0, new ListItem("---Select A Company---", "0"));
                //SqlCommand cmdUserType = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType='UserType'");
                //DataTable dtUserType = db.getDataTable(cmdUserType);
                //ddlUserType.DataSource = dtUserType;
                //ddlUserType.DataValueField = "CodeValue";
                //ddlUserType.DataTextField = "CodeDesc";
                //ddlUserType.DataBind();
                //ddlUserType.Items.Insert(0, new ListItem("---Select A User Type---", "0"));
                SqlCommand cmd = new SqlCommand("select * from CodeReferece where CodeType='Industry' ");
                DataTable  dt  = db.getDataTable(cmd);
                CoIndustry.DataSource     = dt;
                CoIndustry.DataValueField = "CodeValue";
                CoIndustry.DataTextField  = "CodeValue";
                CoIndustry.DataBind();
                CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
            }
        }
        //CoName=companynametextboxID
        //CoIndustry=companyIndustrytextboxID
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Company            CompanyObj = new Company();
                Company_Management CDao       = new Company_Management();


                CompanyObj = CDao.getCompanyByID(Session["CompanyID"].ToString());

                CoName.Text = CompanyObj.Name;
                CoIndustry.SelectedValue = CompanyObj.Industry;
                Database   db  = new Database();
                SqlCommand cmd = new SqlCommand("select * from CodeReferece where CodeType='Industry' ");
                DataTable  dt  = db.getDataTable(cmd);
                CoIndustry.DataSource     = dt;
                CoIndustry.DataValueField = "CodeValue";
                CoIndustry.DataTextField  = "CodeValue";
                CoIndustry.DataBind();
                CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
            }
        }