public ActionResult AjaxGetItens(int pageIndex = 1, int type = 0) { base.pageSize = 15; var list = FSHistorySer.GetItemModel(pageIndex, out TotalPage, "", base.pageSize, 0, true); return(WriteSuccess("", list)); }
public ActionResult Index() { base.pageSize = 15; var list = FSHistorySer.GetItemModel(1, out TotalPage, "", base.pageSize, 0, true); SetViewBagPage(); ViewBag.list = list; return(View()); }
public ActionResult GetModel(int id) { if (id <= 0) { return(WriteError("参数错误")); } var model = FSHistorySer.QueryWhere(c => c.id == id).FirstOrDefault(); return(Json(model)); }
public ActionResult GetModel(int id) { model.FSHistory model = null; if (id > 0) { model = FSHistorySer.QueryWhere(c => c.id == id).FirstOrDefault(); } ViewBag.model = model; return(View()); }
public ActionResult DeleteFSHistory(int id) { var model = FSHistorySer.QueryWhere(c => c.id == id).FirstOrDefault(); FSHistorySer.Delete(model, false); var result = FSHistorySer.SaveChanges(); if (result > 0) { return(WriteSuccess("删除成功")); } return(WriteError("删除失败")); }
// GET: /Home/ public ActionResult Index() { HomeViewModel model = new HomeViewModel(); model.FSHistoryList = FSHistorySer.GetItemModel(1, out TotalPage, "", 10, 0, true).ToList(); model.ImageList = siteService.GetItems(1, 5, 0, true).ToList(); model.NewList = news.NewPageList(1, 1, "", out TotalPage, 10, true); model.NewListType = news.NewPageList(1, 3, "", out TotalPage, 10, true); model.vipUserImageList = Commerce.GetItemModel(1, "", out TotalPage, 2, 1000, true).ToList(); model.MemberTellList = memberSer.GetMemberMsgByPage(1, pageSize, out TotalPage, 1, false); model.MemberNewsList = memberSer.GetMemberMsgByPage(1, pageSize, out TotalPage, 2, false); model.MemberZhaoList = memberSer.GetMemberMsgByPage(1, pageSize, out TotalPage, 3, false); ViewBag.ModelList = model; return(View()); }
/// <summary> /// 给前台页面浏览次数 /// </summary> /// <returns></returns> public ActionResult UpdateLook(int id) { if (id <= 0) { return(WriteError("数据错误")); } var model = FSHistorySer.QueryWhere(c => c.id == id).FirstOrDefault(); FSHistory newModel = new FSHistory(); newModel.id = id; newModel.Look = model.Look + 1; FSHistorySer.Edit(newModel, new string[] { "Look" }); var result = FSHistorySer.SaveChanges(); return(WriteSuccess("浏览成功")); }
/// <summary> /// 给前台页面浏览次数 /// </summary> /// <returns></returns> public ActionResult UpdateDisplay(int id, int val) { if (id <= 0) { return(WriteError("数据错误")); } FSHistory newModel = new FSHistory(); newModel.id = id; newModel.Display = val; FSHistorySer.Edit(newModel, new string[] { "Display" }); var result = FSHistorySer.SaveChanges(); if (result > 0) { return(WriteSuccess("设置成功")); } return(WriteError("设置失败")); }
public ActionResult AddZan(int count, int id) { if (id < 0) { return(WriteError("网络错误")); } model.FSHistory model = new crm16.model.FSHistory(); model.id = id; model.Likes = ++count; FSHistorySer.Edit(model, new string[] { "Likes" }); var result = FSHistorySer.SaveChanges(); if (result > 0) { return(WriteSuccess("", count)); } return(WriteError("网络错误")); }
[ValidateInput(false)]//防止对文本验证,保存不了HTML元素 public ActionResult UpdateFsHistory(string title, string Content, int id) { if (string.IsNullOrWhiteSpace(title)) { return(WriteError("标题不能为空")); } if (string.IsNullOrWhiteSpace(Content)) { return(WriteError("内容不能为空")); } FSHistory model = new FSHistory(); model.Title = title; model.Contents = Content; model.Image = GetImageUrl(Content); if (id > 0)//是不是编辑 { model.id = id; FSHistorySer.Edit(model, new string[] { "Title", "Contents", "Image" }); } else { model.Likes = 150; //默认有150个点赞 model.Look = 200; //默认有250浏览次数 model.Creater = "丰顺商会"; model.Type = 1; model.CreaterTime = model.UpdateTime = DateTime.Now; FSHistorySer.Add(model); } var result = FSHistorySer.SaveChanges(); if (result > 0) { return(WriteSuccess("操作成功!")); } return(WriteError("操作失败")); }
// // GET: /admin/FSHistory/ public ActionResult Index() { ViewBag.DateList = FSHistorySer.GetItemModel(1, out TotalPage, ""); SetViewBagPage(); return(View()); }
public ActionResult SearchCommerce(int index, string name) { var list = FSHistorySer.GetItemModel(index, out TotalPage, name); return(Json(new { rowCount = TotalPage, pageCount = ViewBag.PageCount, date = list })); }