protected void Page_Load(object sender, EventArgs e) { Response.CacheControl = "no-cache"; t = Fn.IsInt(Req.GetQueryString("t"), 0); switch (t) { case 0: //用户名 CheckUserName(); break; case 1: //邮箱 CheckEmail(); break; case 2: //验证码 CheckCode(); break; default: CheckUserName(); break; } }
protected void Page_Load(object sender, EventArgs e) { id = Fn.IsInt(Req.GetQueryString("id"), 0); banH = new BanCache("qu_msg_" + id, new TimeSpan(0, 0, 10), 1); t = Req.GetID("t"); if (!LoginInfo.IsLogin()) { userID = LoginInfo.UserID; } banD = new BanData(userID, "qu_msg_" + id, new TimeSpan(1, 0, 0, 0), 1); switch (t) { case 0: //投票 TouPiao(); break; case 1: //评论 Comment(); break; default: msgAjax.Error("非法操作"); break; } Response.Write(msgAjax.ReturnMessage); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { t = Fn.IsInt(Req.GetQueryString("t"), 1); if (t == 1) { L1(); } else if (t == 2) { L2(); } else if (t == 3) { L3(); } else if (t == 4) { L4(); } else if (t == 5) { L5(); } if (dt == null) { return; } foreach (DataRow drw in dt.Rows) { Response.Write(drw["prosn"] + " : " + drw["proname"] + "<br>"); } }
protected void Page_Load(object sender, EventArgs e) { string hid = Req.GetForm("hid"); if (hid == "1") { string cmd = Req.GetForm("cmd"); if (cmd == "reg") { Reg(); } Response.Write(msgAjax.ReturnMessage); Response.End(); } if (!this.IsPostBack) { url = Req.GetQueryString("url"); if (url.Length == 0) { url = Req.GetUrlReferrer("/"); } url = Server.UrlEncode(url);//新加 } }
protected void Page_Load(object sender, EventArgs e) { number = Fn.EncodeHtml(Req.GetQueryString("number")); check(); Response.Write(msgAjax.ReturnMessage); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { id = Fn.IsInt(Req.GetQueryString("id"), 0); banH = new BanCache("news_msg_" + id, new TimeSpan(0, 0, 10), 1); Add(); Response.Write(msgAjax.ReturnMessage); }
protected void Page_Load(object sender, EventArgs e) { t = Fn.IsInt(Req.GetQueryString("t"), 0); if (!this.IsPostBack) { LL(); } }
protected void Page_Load(object sender, EventArgs e) { id = Req.GetID(); type = Req.GetQueryString("type"); if (!this.IsPostBack) { LL(); } }
protected void Page_Load(object sender, EventArgs e) { id = Fn.IsInt(Req.GetQueryString("id"), 0); Add(); Response.Write(msgAjax.ReturnMessage); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { success_target = Req.GetQueryString("success_target"); url = Req.GetUrlReferrer("/"); if (LoginInfo.banHandler.IsBan()) { isV = "1"; } userName = Req.GetCookies("lastUN"); }
protected void Page_Load(object sender, EventArgs e) { LoginInfo.Exit(); string url = Req.GetQueryString("url"); if (url.Length == 0) { url = Req.GetUrlReferrer("/"); } Response.Redirect(url); }
public Paging List(bool isWhere) { SetGetList(); PagingVar pv = new PagingVar(); #region where if (ArrWhereSQL != null) { int searchWhereType = Req.GetID("SearchType", -1); if (searchWhereType != -1) { string sKeyWrod = Req.GetQueryString("KeyWord").Trim(); this.SqlWhere += " and " + ArrWhereSQL[searchWhereType]; paramList.Add(DbHelp.Def.AddParam("@KeyWrod", sKeyWrod)); } } #endregion if (paramList.Count > 0) { pv.DataParm = paramList.ToArray(); } #region order by int searchOrder = Req.GetID("SearchOrderBy", -1); if (searchOrder != -1) { int searchOrderValue = Req.GetID("SearchOrderValue", 0);//0降序 1升序 this.sqlOrder = " order by " + this.structDt.Columns[searchOrder].ColumnName + " " + (searchOrderValue == 1 ? "asc" : "desc"); } #endregion pv.SQLCount = "select count(0)" + this.sqlFrom + this.sqlWhere; pv.SQLRead = "select " + pKName + this.sqlFrom + this.sqlWhere + this.sqlOrder; //abc a,def b where a.id=b.id 这种情况时,需要where if (isWhere) { pv.SQL = this.sqlSelect + this.sqlFrom + this.sqlWhere + " and " + pKName + " in({0})" + this.sqlOrder; } else { pv.SQL = this.sqlSelect + this.sqlFrom + " where " + pKName + " in({0})" + this.sqlOrder; } Paging pg = new Paging(pv, this.puv); pg.load(); return(pg); }
private void Add() { if (banH.IsBan()) { msgAjax.Error("ban"); return; } int fraction = Fn.IsInt(Req.GetQueryString("star"), 3); if (fraction < 0 || fraction > 5) { fraction = 3; } int userID = 0; if (!LoginInfo.IsLogin()) { userID = LoginInfo.UserID; } string sDetail = Server.HtmlEncode(Req.GetForm("content")); if (sDetail.Length > 600) { msgAjax.Error("above"); return; } string sSql = "insert into CaiPu_Evaluate(FK_User,FK_Pro,Fraction,Detail,Purview,IP) values(@FK_User,@FK_Pro,@Fraction,@Detail,@Purview,@IP)"; IDataParameter[] dp = { DbHelp.Def.AddParam("@FK_User", userID), DbHelp.Def.AddParam("@FK_Pro", id), DbHelp.Def.AddParam("@Fraction", fraction), DbHelp.Def.AddParam("@Detail", sDetail), DbHelp.Def.AddParam("@Purview", 0), DbHelp.Def.AddParam("@IP", Request.UserHostAddress), }; if (DbHelp.Update(sSql, dp) > 0) { banH.Add(); msgAjax.Success("1"); } else { msgAjax.Error("nosubmit"); } }
public void ProcessRequest(HttpContext context) { string un = Req.GetQueryString("un").TrimEnd(); if (User_Info.IsUserName(un)) { context.Response.Write('1'); } else { context.Response.Write('0'); } }
private void LL() { if (LoginInfo.NoLogin1(msgAjax)) { return; } ids = Fn.IsIntArr(Req.GetQueryString("id")); type = Req.GetID("t"); buyCount = Fn.IsDouble(Req.GetQueryString("n"), 1); if (buyCount <= 0) { msgAjax.Error("购买数量至少大于0"); return; } if (ids.Length == 0) { msgAjax.Error("请选择商品"); return; } switch (type) { case 0: //产品 AddCart(Fn.StrToIntArr(ids)); break; case 1: //菜谱 Add1("select ProSN from vgPro_Info where ProSN in(select FK_Pro from CaiPu_Pro where FK_CaiPu in (" + ids + "))"); break; //case 2://套餐 // string lsSql = "declare @lst table (FK_Pro int)" // + "insert into @lst(FK_Pro)(" // + "select FK_Pro " // + "from CaiPu_Pro " // + "where FK_CaiPu in(select tc.FK_CaiPu from TaoCan_CaiPu tc where tc.FK_TaoCan in(" + ids + ")) " // + ")" // + "insert into @lst(FK_Pro)(" // + "select FK_CaiPu from TaoCan_Pro where FK_TaoCan in (" + ids + ")" // + ")" // + "select FK_Pro from @lst"; // Add1(lsSql); // //Add1("select FK_Pro from CaiPu_Pro caip left join TaoCan_CaiPu taoc on caip.FK_CaiPu=taoc.FK_CaiPu where taoc.FK_TaoCan in (" + ids + ")"); // break; } }
private void L4() { string sql = "DECLARE @pagenum AS INT, @pagesize AS INT" + "\nSET @pagenum = " + Fn.IsInt(Req.GetQueryString("p"), 1) + "\nSET @pagesize = 32" + "\nSELECT *" + " FROM (SELECT ROW_NUMBER() OVER(ORDER BY prosn DESC) AS rownum," + "prosn, proname" + " FROM cs..pro_info) AS D" + " WHERE rownum BETWEEN (@pagenum-1)*@pagesize+1 AND @pagenum*@pagesize" + " ORDER BY prosn DESC"; dt = DbHelp.GetDataTable(sql); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this.TxtOrderno.Text = Fn.SCNumber(); string idSub = Req.GetQueryString("id"); this.TxtSubject.Text = idSub; if (idSub.Length > 0) { this.TxtSubject.ReadOnly = true; this.htm01.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { if (LoginInfo.IsLogin()) { jso.Add("info", "nologin"); WriteEndJso(); } id = Req.GetID(); t = Fn.IsByte(Req.GetQueryString("t"), 0); moreid = Req.GetQueryString("s"); if (!this.IsPostBack) { LL(); } }
protected void Page_Load(object sender, EventArgs e) { id = Fn.IsInt(Req.GetQueryString("id"), 0); banH = new BanCache("news_" + id, new TimeSpan(1, 0, 0, 0), 1); s = Req.GetQueryString("s"); if (s.Length > 1) { s = s.Substring(0, 1); } if (!this.IsPostBack) { LL(); } Response.Write(msgAjax.ReturnMessage); }
protected void Page_Load(object sender, EventArgs e) { if (LoginInfo.NoLogin1(msgAjax)) { Response.Write(msgAjax.ReturnMessage); Response.End(); } id = Fn.IsInt(Req.GetQueryString("id"), 0); userID = LoginInfo.UserID; Exchange(); Response.Write(msgAjax.ReturnMessage); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { t = Fn.IsInt(Req.GetQueryString("t"), 0); id = Fn.IsInt(Req.GetQueryString("id"), 0); banH = new BanCache("caipu_msg_" + id, new TimeSpan(0, 0, 10), 1); switch (t) { case 1: //提交 Add(); break; default: msgAjax.Error("非法操作"); break; } Response.Write(msgAjax.ReturnMessage); }
private void L5() { IDataParameter[] dp = { DbHelp.Def.AddParam("@TableName", "cs..pro_info"), DbHelp.Def.AddParam("@PageSize", "32"), DbHelp.Def.AddParam("@PageIndex", Fn.IsInt(Req.GetQueryString("p"), 1)), DbHelp.Def.AddParam("@FieldKey", "prosn"), DbHelp.Def.AddParam("@Fields", "prosn,proname"), DbHelp.Def.AddParam("@Where", "prosn>1"), DbHelp.Def.AddParam("@Order", "prosn desc"), DbHelp.Def.AddParam("@PageCount", "-1"), }; dt = DbHelp.GetDataTable("sp_paging", CommandType.StoredProcedure, dp); //sp_paging 'pro_info',10,83866,'prosn','prosn,proname','prosn>100','prosn desc',-1 }
protected void Page_Load(object sender, EventArgs e) { url = Req.GetQueryString("url"); if (url.Length == 0) url = Req.GetUrlReferrer("/"); if ((url == Request.Url.ToString()) || url.IndexOf("reg.aspx") >= 0) { url = "/user/center.aspx"; } //判断是否用户需要输入验证码 if (LoginInfo.banHandler.IsBan()) isV = "1"; userName = Req.GetCookies("lastUN"); }
protected void Page_Load(object sender, EventArgs e) { Response.CacheControl = "no-cache"; t = Fn.IsInt(Req.GetQueryString("t"), -1); kw = Req.GetQueryString("kw"); WZ.Common.Config.cs.s = kw; if (kw.Length > 30) { kw = kw.Substring(0, 30); } if (!this.IsPostBack) { LL(); } }
private void CheckEmail() { string s = Req.GetQueryString("s"); if (!Fn.IsRegex(s, Fn.EnumRegex.电子邮件)) { Response.Write('2');//格式不正确 Response.End(); } if (User_Info.IsEmail(s)) { Response.Write('1');//已存在 } else { Response.Write('0');//不存 } }
private void CheckUserName() { string s = Req.GetQueryString("s"); if (!Fn.IsRegex(s, Fn.EnumRegex.用户名)) { Response.Write('2');//格式不正确 Response.End(); } if (User_InfoL.IsUserName(s)) { Response.Write('1'); } else { Response.Write('0'); } }
protected void Page_Load(object sender, EventArgs e) { tn = Req.GetQueryString("tn"); Response.Write(tn); Response.End(); if (tn.Length > 0) { insert(); update(); para(); a1(); a2(); a3(); fz(); fzMod(); winput(); } }
private void CheckCode() { bool b = true; string strCode = Req.GetQueryString("s"); string strCode1 = Req.GetSession("uverify"); if (strCode.Length == 0 || (string.Compare(strCode, strCode1, true) != 0)) { b = false; } if (b) { Response.Write('1');//正确 } else { Response.Write('0');//错误 } }
protected void Page_Load(object sender, EventArgs e) { t = Fn.IsInt(Req.GetQueryString("t"), 0); id = Fn.IsInt(Req.GetQueryString("id"), 0); switch (t) { case 0: //显示 GetHtml(); break; case 1: //提交 Add(); WriteEndJso(); break; default: jso.Add("info", "null"); WriteEndJso(); break; } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.CacheControl = "no-cache"; string tableName = string.Empty; switch (Req.GetQueryString("t")) { //case "news": // tableName = "News_Class"; // break; case "pro": tableName = "pro_class"; break; case "help": tableName = "help_class"; break; //case "pack": // tableName = "Pack_Class"; // break; case "area": tableName = "pub_area"; break; default: tableName = "pub_area"; break; } DataTable dt = PubData.GetDataTable(tableName); WZ.Data.AjaxHandle.PubClass pc = new WZ.Data.AjaxHandle.PubClass(dt); pc.Run(); }