public ActionResult AdminComment() { bizAdminComment bc = new bizAdminComment(); int pageSize = 10; int page = Request.QueryString["page"] == null ? 1 : int.Parse(Request.QueryString["page"].ToString()); int count; List<AdminComment> list = bc.List(page - 1, pageSize, out count); ViewData["PageList"] = Page.GetPageList("AdminComment", count, pageSize, page, false); return View(list); }
public ActionResult AdminCommentAdd(FormCollection f) { bizAdminComment bc = new bizAdminComment(); AdminComment model = new AdminComment(); model.UserID = UserID; model.UserName = UserName; model.Remark = f["txtRemark"].Trim(); model.AddTime = DateTime.Now; bc.Add(model); return RedirectToAction("AdminComment"); }
public ActionResult AdminCommentMod(int id) { bizAdminComment bc = new bizAdminComment(); AdminComment model = bc.Get(id); if (model.UserID != UserID) { return RedirectToAction("AdminComment"); } return View(model); }
public ActionResult AdminCommentMod(int id, FormCollection f) { bizAdminComment bc = new bizAdminComment(); AdminComment model = bc.Get(id); if (model.UserID != UserID) { return RedirectToAction("AdminComment"); } model.Attach(); model.Remark = f["txtRemark"]; model.Detach(); bc.Update(model); return RedirectToAction("AdminComment"); }
public ActionResult AdminCommentDelete(int id) { bizAdminComment bc = new bizAdminComment(); AdminComment model = bc.Get(id); if (model.UserID != UserID) { return RedirectToAction("AdminComment"); } bc.Delete(id); return RedirectToAction("AdminComment"); }