public JsonResult ajaxgetvotelist(string key, string status, int pagenum = 1) { AjaxResult ajax = new AjaxResult(); ajax.ErrorMessage = ""; ajax.RetCode = 0; VoteIndexModel model = new VoteIndexModel(); model.myvote = key == "my"; string where = ""; if (model.myvote) { var u = GetUser(); where = " and uid=" + (u != null ? u.uid : 0) + " and votestatus !=5 order by votestatus ,createtime desc "; } else { where = " and votestatus in (2,4) order by votestatus ,createtime desc "; } model.VoteList = c_voteDal.InfoPagerData(where, 10, pagenum); int count = c_voteDal.GetCountByWhere(where); string html = base.RenderViewToString("votelist", model); ajax.Html = html; ajax.ErrorMessage = (count / 10 + 2).ToString(); ajax.RetCode = count > 0 ? 1 : 0; return(Json(ajax)); }
public ActionResult myvote() { if (!Common.HeistMon.HMon.GetInstance().AddMon("voteindex_" + base.GetUserid(), 30)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } VoteIndexModel model = new VoteIndexModel(); model.uid = 0; var u = GetUser(); if (u != null) { if (!u.wkccheckpass) { this.Request.RequestContext.HttpContext.Response.Redirect("/verify", true); } model.uid = u.uid; model.votecount = c_voteDal.GetCountByWhere("and votestatus !=5 and uid=" + model.uid); } return(View(model)); }
public ActionResult Index() { if (base.GetUserid() != "") { if (!Common.HeistMon.HMon.GetInstance().AddMon("voteindex_" + base.GetUserid(), 30)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } } else { if (!Common.HeistMon.HMon.GetInstance().AddMon("voteindex_" + base.GetRequesterIP(), 30)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } } VoteIndexModel model = new VoteIndexModel(); model.uid = 0; var u = GetUser(); if (u != null) { model.uid = u.uid; } model.votecount = c_voteDal.GetCountByWhere("and votestatus in (2,4)"); return(View(model)); }
public ActionResult createvote() { if (!Common.HeistMon.HMon.GetInstance().AddMon("createvote_" + base.GetUserid(), 20)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } var u = GetUser(); if (!u.wkccheckpass) { this.Request.RequestContext.HttpContext.Response.Redirect("/verify", true); } VoteIndexModel model = new VoteIndexModel(); if (LinkTokenSQ.MvcApplication.Syspar.ContainsKey("addvoteprice")) { double p1 = 0; double.TryParse(LinkTokenSQ.MvcApplication.Syspar["addvoteprice"].keyvalue, out p1); model.addvoteprice = p1; } if (LinkTokenSQ.MvcApplication.Syspar.ContainsKey("joinvoteprice")) { double p1 = 0; double.TryParse(LinkTokenSQ.MvcApplication.Syspar["joinvoteprice"].keyvalue, out p1); model.joinvoteprice = p1; } int vid = 0; if (!string.IsNullOrEmpty(Request["vid"])) { vid = int.Parse(Request["vid"]); } string info = ""; model.VoteList = new List <c_voteEntity>(); model.VoteItemList = new List <c_voteitemEntity>(); if (vid > 0) { try { model.VoteList = c_voteDal.GetListByWhere(" and uid=" + u.uid + " and voteid=" + vid, ref info); if (model.VoteList.Count == 1) { model.VoteItemList = c_voteitemDal.GetListByWhere(" and voteid=" + vid, ref info); } } catch { } } return(View(model)); }
public ActionResult votedetail() { if (base.GetUserid() != "") { if (!Common.HeistMon.HMon.GetInstance().AddMon("voteindex_" + base.GetUserid(), 30)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } } else { if (!Common.HeistMon.HMon.GetInstance().AddMon("voteindex_" + base.GetRequesterIP(), 30)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } } VoteIndexModel model = new VoteIndexModel(); model.uid = 0; string where = ""; long vid = 0; long svid = 0; if (!string.IsNullOrEmpty(Request["vid"])) { long.TryParse(Request["vid"], out vid); } if (!string.IsNullOrEmpty(Request["svid"])) { long.TryParse(Request["svid"], out svid); } where += " and voteid=" + vid; if (svid > 0) { where += " and svoteid=" + svid; } if (!string.IsNullOrEmpty(Request["address"])) { where += string.Format(" and c_voteuser.wkcaddress='{0}' ", Request["address"].Trim()); } model.votecount = c_voteuserDal.GetCountByWhere(where); return(View(model)); }
public JsonResult ajaxgetvotedetail(string key, string status, int pagenum = 1) { AjaxResult ajax = new AjaxResult(); ajax.ErrorMessage = ""; ajax.RetCode = 0; VoteIndexModel model = new VoteIndexModel(); model.VoteJoinUserList = new List <c_voteuserEntity>(); string where = ""; long vid = 0; long svid = 0; if (!string.IsNullOrEmpty(Request["vid"])) { long.TryParse(Request["vid"], out vid); } if (!string.IsNullOrEmpty(Request["svid"])) { long.TryParse(Request["svid"], out svid); } where += " and voteid=" + vid; if (svid > 0) { where += " and svoteid=" + svid; } if (!string.IsNullOrEmpty(Request["address"])) { where += string.Format(" and c_voteuser.wkcaddress='{0}' ", Request["address"].Trim()); } model.VoteJoinUserList = c_voteuserDal.InfoPagerData(where + " order by usvoteid desc ", 10, pagenum); int count = c_voteuserDal.GetCountByWhere(where); string html = base.RenderViewToString("_detail", model); ajax.Html = html; ajax.ErrorMessage = (count / 10 + 2).ToString(); ajax.RetCode = count > 0 ? 1 : 0; return(Json(ajax)); }
public ActionResult viewvote() { if (base.GetUserid() != "") { if (!Common.HeistMon.HMon.GetInstance().AddMon("voteindex_" + base.GetUserid(), 30)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } } else { if (!Common.HeistMon.HMon.GetInstance().AddMon("voteindex_" + base.GetRequesterIP(), 30)) { this.HttpContext.Response.Write("FireWall!"); this.HttpContext.Response.End(); return(null); } } VoteIndexModel model = new VoteIndexModel(); if (LinkTokenSQ.MvcApplication.Syspar.ContainsKey("addvoteprice")) { double p1 = 0; double.TryParse(LinkTokenSQ.MvcApplication.Syspar["addvoteprice"].keyvalue, out p1); model.addvoteprice = p1; } if (LinkTokenSQ.MvcApplication.Syspar.ContainsKey("joinvoteprice")) { double p1 = 0; double.TryParse(LinkTokenSQ.MvcApplication.Syspar["joinvoteprice"].keyvalue, out p1); model.joinvoteprice = p1; } int vid = 0; if (!string.IsNullOrEmpty(Request["vid"])) { vid = int.Parse(Request["vid"]); } string info = ""; model.VoteList = new List <c_voteEntity>(); model.VoteItemList = new List <c_voteitemEntity>(); if (vid > 0) { try { model.VoteList = c_voteDal.GetListByWhere(" and voteid=" + vid, ref info); if (model.VoteList.Count == 1) { model.VoteItemList = c_voteitemDal.GetListByWhere(" and voteid=" + vid, ref info); model.VoteJoinUserList = c_voteuserDal.GetListByWhere(" and voteid=" + vid, ref info); } } catch { } } var uinfo = this.GetUser(); if (uinfo != null && uinfo.uid > 0 && uinfo.wkccheckpass) { model.uid = uinfo.uid; } return(View(model)); }