/// <summary> /// 得到推荐文章 /// </summary> /// <returns></returns> public List<PushInfo> ListNewByPush() { string SysName = CacheName.ListNewByPush.ToString(); List<PushInfo> list = null; if (SysCache.Contains(SysName)) { list= SysCache.Get(SysName) as List<PushInfo>; } if (list != null) return list; bizPushInfo bp = new bizPushInfo(); list = bp.ListByTypeID(2, 10); SysCache.Add(SysName, list, new AbsoluteTime(DateTime.Now.AddMinutes(30))); return list; }
public ActionResult Push(int id, FormCollection f, HttpPostedFileBase file1) { string source = Request.QueryString["source"].ToString(); bizPushInfo bp = new bizPushInfo(); PushInfo model = new PushInfo(); BBSMain modelBBSMain = (new bizBBSMain()).Get(id); model.PushInfoTypeID = int.Parse(f["PushInfoTypeID"]); model.Title = f["title"].Trim(); model.TitleUrl = f["TitleUrl"].Trim(); model.Remark = f["Remark"].Trim(); model.AddUserID = modelBBSMain.AddUser; model.AddUserName = modelBBSMain.UserName; model.AddTime = modelBBSMain.AddTime; model.PushTime = DateTime.Now; if (file1 == null) TempData["Msg"] = ""; else { //TempData["Msg"] = CommonCache.ImageUp(Server.MapPath("~/"), file1, Enumerations.ImageUseType.��̳ͼƬ, out imagePath); Public.ImageHelper.UpImageAttr upImageAttr1; TempData["Msg"] = Public.ImageHelper.ImageUp( file1, Enumerations.ImageUpPathType.bbs, "", 100, 0, 0, out upImageAttr1); if (TempData["Msg"].ToString() != "") { return RedirectToAction("Push", new { id = id }); } model.ImagePath = upImageAttr1.imagePath; } bp.Add(model); return Redirect("/bbs/pushlist/" + f["PushInfoTypeID"] + ".html?bbsMainID=" + id + "&source=" + source); }
public ActionResult PushMod(int id, FormCollection f) { string source = Request.QueryString["source"].ToString(); bizPushInfoType bpt = new bizPushInfoType(); bizPushInfo bp = new bizPushInfo(); PushInfo model = bp.Get(id); model.Attach(); model.Title = f["title"].Trim(); model.TitleUrl = f["titleurl"].Trim(); model.Remark = f["remark"].Trim(); model.Detach(); bp.Update(model); return Redirect("/bbs/pushlist/" + model.PushInfoTypeID + ".html?bbsMainID=" + Request.QueryString["bbsMainID"].ToString() + "&source="+source); }
public ActionResult PushMod(int id) { string source = Request.QueryString["source"].ToString(); bizPushInfoType bpt = new bizPushInfoType(); bizPushInfo bp = new bizPushInfo(); PushInfo model = bp.Get(id); PushInfoType modelType = bpt.Get(model.PushInfoTypeID); ViewData["modelType"] = modelType; ViewData["source"] = source; return View(model); }
public ActionResult PushList(int id) { string source = Request.QueryString["source"].ToString(); bizPushInfoType bpt = new bizPushInfoType(); bizPushInfo bp = new bizPushInfo(); PushInfoType model = bpt.Get(id); ViewData["listType"] = bpt.ListByTypeSource(model.TypeSource); ViewData["Type"] = model; ViewData["id"] = id; ViewData["source"] = source; List<PushInfo> listInfo = bp.ListByTypeID(id, 10); return View(listInfo); }
public ContentResult PushDelete(int id) { bizPushInfo bp = new bizPushInfo(); //PushInfo model = bp.Get(id); bp.Delete(id); return Content(""); }