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) { id = Req.GetID(); string hid = Req.GetForm("hid"); if (hid == "1") { string cmd = Req.GetForm("cmd"); switch (cmd) { case "ajax_page_eval": EvaluateList_ajaxPage(); break; case "ajax_page_msg": MsgList_ajaxPage(); break; } Response.End(); } if (!this.IsPostBack) { LL(); } }
//private IMessage msgAjax = new MessageAjax(); protected void Page_Load(object sender, EventArgs e) { id = Req.GetID(); UserID = LoginInfo.UserID; cp = new ClassPath(PubData.GetDataTable("pub_area"), acp); string hid = Req.GetForm("hid"); if (hid == "1") { string cmd = Req.GetForm("cmd"); switch (cmd) { case "save": cb_ok(); break; case "del": cb_delete(); break; } Response.Write(msgAjax.ReturnMessage); Response.End(); } if (!this.IsPostBack) { LL(); BGList(); } }
protected void Page_Load(object sender, EventArgs e) { id = Req.GetID(); if (!Page.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) { classID = Req.GetID("classID"); if (!this.IsPostBack) { LL(); } }
protected void Page_Load(object sender, EventArgs e) { id = Req.GetID(); t = Fn.IsInt(Req.GetQueryString("t"), 0); if (!this.IsPostBack) { LL(); } }
public void Run() { context = HttpContext.Current; //SCWCache.CacheKey ck; //#region //switch (Req.GetQueryString("t")) //{ // case "news": // ck = SCWCache.CacheKey.News_Class; // break; // case "pro": // ck = SCWCache.CacheKey.Pro_Class; // break; // case "help": // ck = SCWCache.CacheKey.Help_Class; // break; // case "pack": // ck = SCWCache.CacheKey.Pack_Class; // break; // case "area": // ck = SCWCache.CacheKey.Pub_Area; // break; // default: // ck = SCWCache.CacheKey.Pub_Area; // break; //} //#endregion //dt = SCWCache.GetDataTable(ck); if (dt == null) { context.Response.Write(JavaScriptConvert.SerializeObject(aJso)); return; } this._sid = Req.GetID("sid"); //若有修改ID,则运行EditData if (this._sid > 0) { EditData1(); } else { this._id = Req.GetID(); SelectData(); } context.Response.Write(JavaScriptConvert.SerializeObject(aJso)); }
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); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { id = Req.GetID(); if (id < 1) { msgG.Error("非法操作3"); } LL(); } }
protected void Page_Load(object sender, EventArgs e) { Response.Write(Guid.NewGuid().ToString("N") + "<br>"); Response.Write(Guid.NewGuid().ToString("D") + "<br>"); Response.Write(Guid.NewGuid().ToString("B") + "<br>"); Response.Write(Guid.NewGuid().ToString("P") + "<br>"); Response.Write(Guid.NewGuid().ToString("P") + "<br>"); Response.Write(dt.Ticks + "<br>"); Response.Write(HttpUtility.UrlEncode("在中有<>Sdfsdf") + "<br>"); Response.Write(GetPageNumbers(Req.GetID("page"), 55, Request.Url.ToString(), 4, "", "")); }
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; } }
/// <summary> /// 获取所有记录 /// </summary> /// <returns></returns> public DataTable ListAll() { SetGetList(); #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 return(DbHelp.GetDataTable(this.sqlSelect + this.sqlFrom + this.sqlWhere + this.sqlOrder)); }
protected void Page_Load(object sender, EventArgs e) { string furl = "login.aspx?furl=" + Request.Url.ToString(); if (LoginInfo.IsLogin()) { Response.Redirect(furl); return; } id = Req.GetID(); string sql = "update User_Letter set IsRead=1 where LetSN=" + id + " and FK_User_To=" + LoginInfo.UserID + ";select FK_User_From,Title,Detail,AddDate,(select UserName from User_Info where UserSN=User_Letter.FK_User_From) as fromUserName from User_Letter where LetSN=" + id + " and FK_User_To=" + LoginInfo.UserID; d = new SqlDataSelect(sql); }
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(); } }
public string AOnClick(string pFieldName) { string a = "location.href='{0}'"; int fieldIndex = FnData.GetTableFieldIndex(structDt, pFieldName); URLPara urlp = new URLPara(); urlp.QueryStringToURLPara(); int searchOrderValue = Req.GetID("SearchOrderValue", 0);//0降序 1升序 //HttpContext.Current.Response.Write(searchOrderValue + ","); foreach (DataColumn s in structDt.Columns) { if (string.Compare(s.ColumnName, pFieldName, true) == 0) { searchOrderValue = searchOrderValue == 1 ? 0 : 1; break; } } Dictionary <string, string> d = new Dictionary <string, string>(); d.Add("SearchOrderBy", fieldIndex.ToString()); d.Add("SearchOrderValue", searchOrderValue.ToString()); if (!urlp.d.ContainsKey("SearchOrderBy")) { urlp.d.Add("SearchOrderBy", ""); } if (!urlp.d.ContainsKey("SearchOrderValue")) { urlp.d.Add("SearchOrderValue", ""); } a = string.Format(a, urlp.ToString(d)); return(a); }
protected void Page_Load(object sender, EventArgs e) { if (LoginInfo.IsLogin()) { string furl = "login.aspx?furl=" + Request.Url.ToString(); Response.Redirect(furl); return; } id = Req.GetID(); hid = Fn.IsInt(Req.GetForm("hid"), 0); if (hid > 0) { switch (hid) { case 1: //申请取消 Ord_QX(); break; } Response.Write(msgAjax.ReturnMessage); Response.End(); } }
//protected string pageAreaName; protected void Page_Load(object sender, EventArgs e) { LoginInfo.NoLoginF(); id = Req.GetID(); num = Req.GetID("num"); int userID = LoginInfo.UserID; string sql = "select top 1 FK_User,FK_Area,Name,Address,FixTel,Tel from User_Contact where FK_User="******" order by UseTime desc"; bool b = false; //获取最后一次用户使用的配送信息 using (IDataReader dr = DbHelp.Read(sql)) { if (dr.Read()) { b = true; pageRealName = dr["Name"].ToString(); pageArea = dr["FK_Area"].ToString(); pageAddress = dr["Address"].ToString(); pageTel = dr["Tel"].ToString(); pageFixTel = dr["FixTel"].ToString(); } } //若没有配送信息,则从个人用户信息读取 if (!b) { sql = "select RealName,Area,Address,Tel,FixTel from User_Personal where FK_User="******"RealName"].ToString(); pageArea = dr["Area"].ToString(); pageAddress = dr["Address"].ToString(); pageTel = dr["Tel"].ToString(); pageFixTel = dr["FixTel"].ToString(); } } } sql = "select Integral from Gift_Info where GiftSN=" + id; using (IDataReader dr = DbHelp.Read(sql)) { if (dr.Read()) { pageTotalIntegral = ((int)num * int.Parse(dr["Integral"].ToString())).ToString();//总积分 } else { pageTotalIntegral = "不存在此礼品"; return; } } sql = "select UserIntegral from User_Info where UserSN=" + userID; using (IDataReader dr = DbHelp.Read(sql)) { if (dr.Read()) { pageUserIntegral = dr["UserIntegral"].ToString(); } else { pageUserIntegral = "不存在用户"; return; } } //GetClassPath1 acp = new GetClassPath1(); //ClassPath cp = new ClassPath(PubData.GetDataTable("pub_area"), acp); //cp.Exe(Fn.IsInt(pageArea, 0)); //pageAreaName = acp.GetPath; }
private void Exchange() { //验证文本框输入 if (!double.TryParse(Req.GetQueryString("excount"), out excount)) { msgAjax.Error("errnumber"); return; } else { if (excount <= 0) { msgAjax.Error("errnumber"); return; } } string g_GiftName; int g_Integral = 0; int g_UserIntegral = 0; int g_TotalIntegral = 0; string sql = "select GiftName,Integral from Gift_Info where GiftSN=" + id; using (IDataReader dr = DbHelp.Read(sql)) { if (dr.Read()) { g_GiftName = dr["GiftName"].ToString(); g_Integral = int.Parse(dr["Integral"].ToString()); g_TotalIntegral = (int)excount * g_Integral;//总积分 } else { msgAjax.Error("nogift"); return; } } sql = "select UserIntegral from User_Info where UserSN=" + userID; using (IDataReader dr = DbHelp.Read(sql)) { if (dr.Read()) { g_UserIntegral = int.Parse(dr["UserIntegral"].ToString()); } else { msgAjax.Error("不存在用户"); return; } } if (g_UserIntegral < g_TotalIntegral) { msgAjax.Error("nointegral"); //msgAjax.Error("您的积分不足,还差" + (g_TotalIntegral - g_UserIntegral)); return; } int t = Req.GetID("t"); if (t == 1)//判断 { msgAjax.Success("1"); return; } if (t == 2)//兑换 { string sName = Req.GetForm("cName").Trim(); string sSex = Req.GetForm("cSex").Trim(); string sAddress = Req.GetForm("cAddress").Trim(); string sFixTel = Req.GetForm("cFixTel").Trim(); string sTel = Req.GetForm("cTel").Trim(); string sArea = Req.GetForm("cArea").Trim(); string sInfo = Fn.EncodeHtml(Req.GetForm("cInfo").Trim()); if (sName.Length < 1 || sName.Length > 30) { msgAjax.Error("请输入收货人,不超30个字;"); return; } if ((sTel.Length < 1 || sTel.Length > 25) && (sFixTel.Length < 1 || sFixTel.Length > 25)) { msgAjax.Error("手机,固定电话必填一个,不超25个位;"); return; } if (sAddress.Length < 1 || sAddress.Length > 300) { msgAjax.Error("请输入详细地址,不超300个字;"); return; } if ((!Fn.IsIntBool(sArea))) { msgAjax.Error("请选择地区;"); return; } else if (Convert.ToInt32(sArea) < 1) { msgAjax.Error("请选择地区;"); return; } if (sInfo.Length > 600) { msgAjax.Error("符加信息不能超过600字;"); return; } Gift_ExchangeLogM mod = new Gift_ExchangeLogM(); mod.FK_User = userID; mod.FK_Gift = id; mod.gift_UserName = LoginInfo.UserName; mod.gift_RealName = sName; mod.gift_Address = sAddress; mod.gift_FixTel = sFixTel; mod.gift_Tel = sTel; mod.gift_Area = Convert.ToInt32(sArea); mod.gift_Caption = sInfo; mod.GiftName = g_GiftName; mod.ExIntegral = g_Integral; mod.ExTotalIntegral = g_TotalIntegral; mod.Num = excount; Gift_TransM trans_mod = new Gift_TransM(); trans_mod.mod = mod; DbHelp.ExecuteTrans(new DbHelpParam(), this.Gift_Trans, trans_mod); if (trans_mod.returnValue == "1") { msgAjax.Success("1"); } else { msgAjax.Error(trans_mod.returnValue); } } }