public ActionResult List() { UserResBody currResBody = new UserResBody(); foreach (UserResBody item in base._userResBody) { if (item.res_path.Equals("0,1,105,144,202,")) { currResBody = item; break; } } HasPermission(currResBody.res_id); ViewData["currResBody"] = currResBody;//当前菜单 string position = ""; ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); ViewData["position"] = position;//页面位置 int pagesize = 30; int posId = DoRequest.GetQueryInt("posid", -1); int pageindex = DoRequest.GetQueryInt("page", 1); string q = DoRequest.GetQueryString("q"); int useplat = DoRequest.GetQueryInt("useplat"); int dataCount = 0; int pageCount = 0; List <RecommendPositionList> infoList = null; var resp = QueryRecommendPositionList.Do(pagesize, pageindex , posId, useplat , q , ref dataCount, ref pageCount); if (resp == null || resp.Body == null) { infoList = new List <RecommendPositionList>(); } else { infoList = resp.Body.recommend_list; } ViewData["infoList"] = infoList; System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder();//拼接当前页面URL currPageUrl.Append("/mpolymeric/list?"); currPageUrl.Append("&posid=" + posId); currPageUrl.Append("&q=" + q); currPageUrl.Append("&page=" + pageindex); currPageUrl.Append("&useplat=" + useplat); ViewData["currPageUrl"] = currPageUrl;//当前页面的URL ViewData["pagesize"] = pagesize; ViewData["pageindex"] = pageindex; ViewData["dataCount"] = dataCount; ViewData["pageIndexLink"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); return(View()); }
public ActionResult List() { UserResBody currResBody = new UserResBody(); foreach (UserResBody item in base._userResBody) { if (item.res_path.Equals("0,1,104,226,227,")) { currResBody = item; break; } } HasPermission(currResBody.res_id); ViewData["currResBody"] = currResBody;//当前菜单 string position = ""; ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); ViewData["position"] = position;//页面位置 int pagesize = DoRequest.GetQueryInt("size", 100); int pageindex = DoRequest.GetQueryInt("page", 1); int classid = DoRequest.GetQueryInt("classid", -1); string q = DoRequest.GetQueryString("q"); string sKey = q; #region 文章列表 int dataCount = 0; int pageCount = 0; List <ShortArticleInfo> _table = new List <ShortArticleInfo>(); var res = QueryArticleList.Do(pagesize, pageindex , classid , sKey, ref dataCount, ref pageCount); if (res != null && res.Body != null && res.Body.article_list != null) { _table = res.Body.article_list; } ViewData["infoList"] = _table; //文章列表 System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder(); //拼接当前页面URL currPageUrl.Append("/marticle/list?"); currPageUrl.Append("&size=" + pagesize); currPageUrl.Append("&classid=" + classid); currPageUrl.Append("&q=" + DoRequest.UrlEncode(q)); currPageUrl.Append("&page=" + pageindex); ViewData["currPageUrl"] = currPageUrl;//当前页面的URL ViewData["pagesize"] = pagesize; ViewData["pageindex"] = pageindex; ViewData["dataCount"] = dataCount; ViewData["pageIndexLink"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); #endregion return(View()); }
public ActionResult ShopList() { UserResBody currResBody = new UserResBody(); foreach (UserResBody item in base._userResBody) { if (item.res_path.Equals("0,1,107,119,123,")) { currResBody = item; break; } } HasPermission(currResBody.res_id); ViewData["currResBody"] = currResBody;//当前菜单 string position = ""; ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); ViewData["position"] = position;//页面位置 int pagesize = DoRequest.GetQueryInt("size", 60); int pageindex = DoRequest.GetQueryInt("page", 1); string q = DoRequest.GetQueryString("q"); int dataCount = 0; int pageCount = 0; List <ShortShopInfo> infoList = null; var resp = QueryShopList.Do(pagesize, pageindex, q, ref dataCount, ref pageCount); if (resp == null || resp.Body == null || resp.Body.shop_list == null) { infoList = new List <ShortShopInfo>(); } else { infoList = resp.Body.shop_list; } ViewData["infoList"] = infoList; //数据列表 System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder(); //拼接当前页面URL currPageUrl.Append("/musers/shoplist?"); currPageUrl.Append("&size=" + pagesize); currPageUrl.Append("&page=" + pageindex); currPageUrl.Append("&q=" + DoRequest.UrlEncode(q)); ViewData["currPageUrl"] = currPageUrl;//当前页面的URL ViewData["pagesize"] = pagesize; ViewData["pageindex"] = pageindex; ViewData["dataCount"] = dataCount; ViewData["pageIndexLink"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); return(View()); }
public ActionResult ChangeImage() { string _path = DoRequest.GetQueryString("path"); HttpFileCollection postfiles = System.Web.HttpContext.Current.Request.Files; Robots robots = null; if (postfiles[0] != null && postfiles[0].FileName != null && postfiles[0].FileName != "") { string ext = postfiles[0].FileName.Substring(postfiles[0].FileName.LastIndexOf('.') + 1).ToLower(); if (ext != "jpg" && ext != "jpeg" && ext != "gif" && ext != "bmp" && ext != "png") { return(Json(new { error = true, message = "文件类型只能为jpg,jpeg,gif,bmp,png!" }, JsonRequestBehavior.AllowGet)); } NameValueCollection myCol = new NameValueCollection(); myCol.Add("path", _path); robots = new Robots(); string s = robots.HttpUploadFile("http://10.117.21.59/ImageServiceNetgate/uploadFileAtRoot", postfiles[0], myCol, "file"); if (robots.IsError) { return(Json(new { error = true, message = robots.ErrorMsg }, JsonRequestBehavior.AllowGet)); } ResponseFile file = JsonHelper.JsonToObject <Response <ResponseFile> >(s).Body; if (file != null && file.fileNameList != null && file.fileNameList[0] != null) { string fullpathXX = file.fileNameList[0].fileUrl; string path1 = file.fileNameList[0].fileKey.Replace("jianbao/website/", ""); string path2 = path1.Substring(0, path1.LastIndexOf("/") + 1); if (!path2.Equals(_path)) { return(Json(new { error = true, message = "失败,请重新更改!" }, JsonRequestBehavior.AllowGet)); } return(Json(new { error = false, message = "成功!", fullpath = fullpathXX }, JsonRequestBehavior.AllowGet)); } return(Json(new { error = true, message = "失败,请重新更改1!" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { error = true, message = "请选择1个文件!" }, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 检测验证字串 /// </summary> /// <param name="message">返回错误描述</param> /// <returns>true=验证通过;false=发生错误</returns> public static bool CheckVerifyString(ref string message, ref long userId) { string codeString = DoRequest.GetQueryString("code").Trim(); string loginString = DoRequest.GetQueryString("user").Trim(); if (string.IsNullOrEmpty(codeString) || string.IsNullOrEmpty(loginString)) { message = "参数错误"; return(false); } codeString = AES.Decode(codeString, config.DecryptKey).Trim(); loginString = AES.Decode(loginString, config.DecryptKey).Trim(); if (!Utils.IsDateTime(codeString)) { message = "没有权限"; return(false); } DateTime time = DateTime.Parse(codeString); if (time.AddMinutes(3) < DateTime.Now || time > DateTime.Now) { message = "会话已超时"; return(false); } Dictionary <string, string> list = Utils.ParseParame(loginString.Trim()); //LoginUser user = new LoginUser(); string uidDic = Utils.GetDictionaryValue(list, "UID"); if (!Utils.IsLong(uidDic)) { message = "未登录或登录已超时"; return(false); } if (long.Parse(uidDic) < 1) { message = "登录超时"; return(false); } userId = long.Parse(uidDic); return(true); }
/* * public ActionResult Add() * { * UserResBody currResBody = new UserResBody(); * foreach (UserResBody item in base._userResBody) * { * if (item.res_path.Equals("0,1,101,192,")) * { * currResBody = item; * break; * } * } * * ViewData["currResBody"] = currResBody;//当前菜单 * string position = ""; * ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); * ViewData["position"] = position;//页面位置 * * return View(); * } * */ #endregion #region Items public ActionResult Items() { UserResBody currResBody = new UserResBody(); foreach (UserResBody item in base._userResBody) { if (item.res_path.Equals("0,1,105,144,202,")) { currResBody = item; break; } } HasPermission(currResBody.res_id); ViewData["currResBody"] = currResBody;//当前菜单 string position = ""; ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); ViewData["position"] = position;//页面位置 int posId = DoRequest.GetQueryInt("posid"); string q = DoRequest.GetQueryString("q"); List <RecommendListInfo> infoList = null; var resp = GetRecommendItemByRpId.Do(posId); if (resp == null || resp.Body == null) { infoList = new List <RecommendListInfo>(); } else { infoList = resp.Body.item_list; } ViewData["infoList"] = infoList; return(View()); }
public ActionResult Receive() { UserResBody currResBody = new UserResBody(); foreach (UserResBody item in base._userResBody) { if (item.res_path.Equals("0,1,107,234,235,")) { currResBody = item; break; } } HasPermission(currResBody.res_id); ViewData["currResBody"] = currResBody;//当前菜单 string position = ""; ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); ViewData["position"] = position;//页面位置 string phone = DoRequest.GetQueryString("q"); List <AdressInfo> adress = new List <AdressInfo>(); if (phone != null && !phone.Equals("")) { var res = GetReceiveAddrByMobileNo.Do(phone); if (res != null && res.Body != null && res.Body.addr_list != null) { adress = res.Body.addr_list; } } ViewData["adressinfo"] = adress; return(View()); }
public ActionResult UserList() { UserResBody currResBody = new UserResBody(); foreach (UserResBody item in base._userResBody) { if (item.res_path.Equals("0,1,107,118,121,")) { currResBody = item; break; } } HasPermission(currResBody.res_id); ViewData["currResBody"] = currResBody;//当前菜单 string position = ""; ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); ViewData["position"] = position;//页面位置 int pagesize = DoRequest.GetQueryInt("size", 60); int pageindex = DoRequest.GetQueryInt("page", 1); string q = DoRequest.GetQueryString("q"); int state = DoRequest.GetQueryInt("state", -1); int usertype = DoRequest.GetQueryInt("usertype", -1); DateTime date = DateTime.Now.AddYears(-3); DateTime sDate = DoRequest.GetQueryDate("sDate", date); DateTime eDate = DoRequest.GetQueryDate("eDate", DateTime.Now); int dataCount = 0; int pageCount = 0; List <ShortUserInfo> infoList = new List <ShortUserInfo>(); DoCache cache = new DoCache(); string cachekey = "user-QueryUserListindex=" + pageindex + "state=" + state + "type=" + usertype + "sdate=" + sDate.ToString("yyyy-MM-dd") + "edate=" + eDate.ToString("yyyy-MM-dd") + "q=" + q; if (cache.GetCache(cachekey) == null) { var resp = QueryUserList.Do(pagesize, pageindex, state, usertype, sDate.ToString("yyyy-MM-dd 00:00:00"), eDate.ToString("yyyy-MM-dd 23:59:59"), q, ref dataCount, ref pageCount); if (resp != null && resp.Body != null && resp.Body.user_list != null) { infoList = resp.Body.user_list; cache.SetCache(cachekey, infoList, 300); cache.SetCache("userdatacount", dataCount, 300); if (infoList.Count == 0) { cache.RemoveCache(cachekey); } } } else { infoList = (List <ShortUserInfo>)cache.GetCache(cachekey); dataCount = (int)cache.GetCache("userdatacount"); } ViewData["infoList"] = infoList; //数据列表 System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder(); //拼接当前页面URL currPageUrl.Append("/musers/userlist?"); currPageUrl.Append("&size=" + pagesize); currPageUrl.Append("&page=" + pageindex); currPageUrl.Append("&q=" + DoRequest.UrlEncode(q)); currPageUrl.Append("&state=" + state); currPageUrl.Append("&usertype=" + usertype); currPageUrl.Append("&sdate=" + sDate.ToString("yyyy-MM-dd")); currPageUrl.Append("&edate=" + eDate.ToString("yyyy-MM-dd")); ViewData["currPageUrl"] = currPageUrl;//当前页面的URL ViewData["pagesize"] = pagesize; ViewData["pageindex"] = pageindex; ViewData["dataCount"] = dataCount; ViewData["pageIndexLink"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString()); return(View()); }
public ActionResult ImgRecycleList() { UserResBody currResBody = new UserResBody(); foreach (UserResBody item in base._userResBody) { if (item.res_path.Equals("0,1,105,139,143,")) { currResBody = item; break; } } HasPermission(currResBody.res_id); ViewData["currResBody"] = currResBody;//当前菜单 string position = ""; ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position); ViewData["position"] = position;//页面位置 int size = 60; int page = DoRequest.GetQueryInt("page", 1); int classid = DoRequest.GetQueryInt("classid", 3); int dataCount = 0; int pageCount = 0; DateTime sDate = DoRequest.GetQueryDate("st", DateTime.Now.AddYears(-3)); DateTime eDate = DoRequest.GetQueryDate("et", DateTime.Now); string q = DoRequest.GetQueryString("q"); //bool isImage = true; List <SysFiles> infoList = new List <SysFiles>(); var res = QuerySysFile.Do(size, page, classid, 0 , sDate.ToString() , eDate.ToString() , q , ref dataCount, ref pageCount); if (res != null && res.Body != null && res.Body.file_list != null) { infoList = res.Body.file_list; } ViewData["infoList"] = infoList; #region 分页链接 System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder();//拼接当前页面URL currPageUrl.Append("/mspace/imgrecycleList"); currPageUrl.Append("?classid=" + classid); currPageUrl.Append("&st=" + sDate); currPageUrl.Append("&et=" + eDate); currPageUrl.Append("&page=" + page); currPageUrl.Append("&q=" + DoRequest.UrlEncode(q)); ViewData["currPageUrl"] = currPageUrl;//当前页面的URL ViewData["pagesize"] = size; ViewData["pageindex"] = page; ViewData["dataCount"] = dataCount; ViewData["pageIndexLink"] = this.FormatPageIndex(dataCount, size, page, currPageUrl.ToString()); ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, size, page, currPageUrl.ToString()); #endregion return(View()); }