protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.IsSecureConnection)
            {
                if (Session["AccountStatus"].Equals("AdminAccount"))
                {
                    if (!IsPostBack)
                    {
                        ddlTeamList.DataSource = ProductItem.getTeams();
                        ddlTeamList.DataBind();

                        ProductItem product = Session["Product"] as ProductItem;
                        txtPlayerFirstName.Text    = product.playerFirstName;
                        txtPlayerLastName.Text     = product.playerLastName;
                        txtProductDescription.Text = product.productDescription;
                        productImage.ImageUrl      = "~/UL/IMG/" + product.productImage;
                        ddlTeamList.SelectedValue  = product.teamID;
                        txtPrice.Text = string.Format("{0:F2}", product.productPrice);

                        if (product.productIsActive)
                        {
                            ToggleProduct.CssClass = "btn btn-dark";
                            ToggleProduct.Text     = "Active";
                        }
                        else
                        {
                            ToggleProduct.CssClass = "btn btn-dark";
                            ToggleProduct.Text     = "Inactive";
                        }
                    }
                }
                else
                {
                    Response.Redirect("~/UL/Error");
                }
            }
            else
            {
                string url = ConfigurationManager.AppSettings["SecurePath"] + "AdminUpdateProduct";
                Response.Redirect(url);
            }
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.IsSecureConnection)
     {
         if (Session["AccountStatus"].Equals("AdminAccount"))
         {
             if (!IsPostBack)
             {
                 ddlTeamList.DataSource = ProductItem.getTeams();
                 ddlTeamList.DataBind();
             }
         }
         else
         {
             Response.Redirect("~/UL/Error");
         }
     }
     else
     {
         string url = ConfigurationManager.AppSettings["SecurePath"] + "AdminCreateProduct";
         Response.Redirect(url);
     }
 }