protected void Page_Load(object sender, EventArgs e) { com.product pro = new com.product(); classTable = pro.GetProductClass(); if (!string.IsNullOrWhiteSpace(Request.QueryString["page"])) { try { pageIndex = int.Parse(Request.QueryString["page"]); pageIndex = pageIndex < 1 ? 1 : pageIndex; } catch (Exception) { } } if (!string.IsNullOrWhiteSpace(Request.QueryString["classid"])) { try { classid = int.Parse(Request.QueryString["classid"]); } catch (Exception) { } } if (Request.HttpMethod.ToLower() == "post") { searchText = Request.Form["txtSearch"]; } maxPage = pro.GetProductListByClassIDMaxCount(classid + "", searchText); pageIndex = pageIndex > maxPage ? maxPage : pageIndex; productTable = pro.GetProductListByClassID(classid + "", pageIndex + "", searchText); }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(Request.QueryString["id"])) { try { int pid = int.Parse(Request.QueryString["id"]); com.product pro = new com.product(); product = pro.GetProductById(pid.ToString()); productImage = product["Images"].ToString().Split(';'); } catch (Exception) { Response.Redirect("index.aspx"); } } else { Response.Redirect("index.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!string.IsNullOrWhiteSpace(Request.QueryString["action"]) && Request.QueryString["action"] == "addmsg") { string name = Request.Params["name"]; string email = Request.Params["email"]; string phone = Request.Params["phone"]; string content = Request.Params["content"]; com.msgBoard mb = new com.msgBoard(); int count = mb.addMsgBoard(name, email, phone, content); if (count > 0) { Response.Write("success"); } else { Response.Write("error"); } Response.End(); } if (!string.IsNullOrWhiteSpace(Request.QueryString["l"]) && Request.QueryString["l"] == "zh-cn") { SqlOper.Utils.Language = "zh-cn"; } else if (!string.IsNullOrWhiteSpace(Request.QueryString["l"]) && Request.QueryString["l"] == "en") { SqlOper.Utils.Language = "en"; } com.product pro = new com.product(); homeShowDt = pro.GetProductHomeShow(); homeRecommendDt = pro.GetProductHomeRecommend(); } catch (Exception) { } }
protected void Page_Load(object sender, EventArgs e) { com.product pro = new com.product(); homeShowDt = pro.GetProductHomeShow(); homeRecommendDt = pro.GetProductHomeRecommend(); }