protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && Request.Params["SeriesID"] != null) { designID.Value = Request.Params["SeriesID"].ToString(); } int tryID; if (int.TryParse(designID.Value, out tryID)) { ProductID = tryID; } else { ProductID = 0; } if (!IsPostBack) { if (ProductID > 0) { List <SqlParameter> p = new List <SqlParameter>(); p.Add(new SqlParameter("@SeriesID", ProductID)); DataTable dtShop = DB.Get("ShopSeriesProductsSelect", p.ToArray()); if (dtShop != null && dtShop.Rows.Count > 0) { VariationView.DataSource = dtShop; VariationView.DataBind(); DataRow drShop = dtShop.Rows[0]; int VariationID = int.Parse(drShop["ProductVariationID"].ToString()); SetVariantInfo(VariationID); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["ContestKey"] == null || string.IsNullOrWhiteSpace(Request.Cookies["ContestKey"].Value)) { Response.Redirect("~/Contest/KeyInvalid.aspx", false); } string key = Request.Cookies["ContestKey"].Value; List <SqlParameter> p = new List <SqlParameter>(); p.Add(new SqlParameter("@ContestKey", key)); DataTable dtCode = DB.Get("ContestCodeGetValid", p.ToArray()); if (dtCode != null && dtCode.Rows.Count > 0) { if (!IsPostBack && Request.Params["SeriesID"] != null) { designID.Value = Request.Params["SeriesID"].ToString(); } int tryID; if (int.TryParse(designID.Value, out tryID)) { ProductID = tryID; } else { ProductID = 0; } if (!IsPostBack) { if (ProductID > 0) { p = new List <SqlParameter>(); p.Add(new SqlParameter("@SeriesID", ProductID)); if (!string.IsNullOrWhiteSpace(dtCode.Rows[0]["GenreID"].ToString())) { p.Add(new SqlParameter("@GenreID", dtCode.Rows[0]["GenreID"].ToString())); } DataTable dtShop = DB.Get("ShopSeriesProductsSelect", p.ToArray()); if (dtShop != null && dtShop.Rows.Count > 0) { VariationView.DataSource = dtShop; VariationView.DataBind(); DataRow drShop = dtShop.Rows[0]; int VariationID = int.Parse(drShop["ProductVariationID"].ToString()); SetVariantInfo(VariationID); } } } } else { Response.Redirect("~/Contest/KeyInvalid.aspx", false); } }