Example #1
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 CodeValue,CodeDesc from CodeReferece where CodeType=Industry ");
                //DataTable dt = db.getDataTable(cmd);
                //CoIndustry.DataSource = dt;
                //CoIndustry.DataValueField = "CodeValue";
                //CoIndustry.DataTextField = "CodeDesc";
                //CoIndustry.DataBind();
                //CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
                SqlCommand cmd = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType='Country' ");
                DataTable  dt  = db.getDataTable(cmd);
                BBCountry.DataSource     = dt;
                BBCountry.DataValueField = "CodeValue";
                BBCountry.DataTextField  = "CodeDesc";
                BBCountry.DataBind();
                BBCountry.Items.Insert(0, new ListItem("---Select A Country---", "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)
            {
                if (Session["userType"].ToString() == Reference.USR_ADM)
                {
                    Billboard            BillboardObj = new Billboard();
                    Billboard_Management bDao         = new Billboard_Management();
                    //Company CompanyObj = new Company();
                    // Company_Management CDao = new Company_Management();

                    BillboardObj = bDao.getBillboardByID(Session["BillboardID"].ToString());
                    latitude     = BillboardObj.latitude;
                    longtitude   = BillboardObj.Longtitude;
                    //CompanyObj = CDao.getCompanyByID(Session["CompanyID"].ToString());
                    Database db = new Database();
                    //SqlCommand cmd = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType=Industry ");
                    //DataTable dt = db.getDataTable(cmd);
                    //CoIndustry.DataSource = dt;
                    //CoIndustry.DataValueField = "CodeValue";
                    //CoIndustry.DataTextField = "CodeDesc";
                    //CoIndustry.DataBind();
                    //CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
                    SqlCommand cmd = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType='Country' ");
                    DataTable  dt  = db.getDataTable(cmd);
                    BBCountry.DataSource     = dt;
                    BBCountry.DataValueField = "CodeValue";
                    BBCountry.DataTextField  = "CodeDesc";
                    BBCountry.DataBind();
                    BBCountry.Items.Insert(0, new ListItem("---Select A Country---", "0"));


                    BBAddLn1.Text           = BillboardObj.AddressLn1;
                    BBAddLn2.Text           = BillboardObj.AddressLn2;
                    BBCity.Text             = BillboardObj.City;
                    BBCountry.SelectedValue = BillboardObj.Country;
                    BBLatitude.Text         = BillboardObj.latitude;
                    BBLongtitude.Text       = BillboardObj.Longtitude;

                    BBPostalCode.Text = BillboardObj.postalCode;
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Database db = new Database();
         //SqlCommand cmd = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType=Industry ");
         //DataTable dt = db.getDataTable(cmd);
         //CoIndustry.DataSource = dt;
         //CoIndustry.DataValueField = "CodeValue";
         //CoIndustry.DataTextField = "CodeDesc";
         //CoIndustry.DataBind();
         //CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
         SqlCommand cmd = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType='Country' ");
         DataTable  dt  = db.getDataTable(cmd);
         BBCountry.DataSource     = dt;
         BBCountry.DataValueField = "CodeValue";
         BBCountry.DataTextField  = "CodeDesc";
         BBCountry.DataBind();
         BBCountry.Items.Insert(0, new ListItem("---Select A Country---", "0"));
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Billboard            BillboardObj = new Billboard();
                Billboard_Management bDao         = new Billboard_Management();
                //Company CompanyObj = new Company();
                // Company_Management CDao = new Company_Management();

                BillboardObj = bDao.getBillboardByID(Session["BillboardID"].ToString());
                latitude     = BillboardObj.latitude;
                longtitude   = BillboardObj.Longtitude;
                //CompanyObj = CDao.getCompanyByID(Session["CompanyID"].ToString());
                Database db = new Database();
                //SqlCommand cmd = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType=Industry ");
                //DataTable dt = db.getDataTable(cmd);
                //CoIndustry.DataSource = dt;
                //CoIndustry.DataValueField = "CodeValue";
                //CoIndustry.DataTextField = "CodeDesc";
                //CoIndustry.DataBind();
                //CoIndustry.Items.Insert(0, new ListItem("---Select An Industry---", "0"));
                SqlCommand cmd = new SqlCommand("select CodeValue,CodeDesc from CodeReferece where CodeType='Country' ");
                DataTable  dt  = db.getDataTable(cmd);
                BBCountry.DataSource     = dt;
                BBCountry.DataValueField = "CodeValue";
                BBCountry.DataTextField  = "CodeDesc";
                BBCountry.DataBind();
                BBCountry.Items.Insert(0, new ListItem("---Select A Country---", "0"));


                BBAddLn1.Text           = BillboardObj.AddressLn1;
                BBAddLn2.Text           = BillboardObj.AddressLn2;
                BBCity.Text             = BillboardObj.City;
                BBCountry.SelectedValue = BillboardObj.Country;
                BBLatitude.Text         = BillboardObj.latitude;
                BBLongtitude.Text       = BillboardObj.Longtitude;

                BBPostalCode.Text = BillboardObj.postalCode;
            }
        }