//----------发起任务视图----------------------- public ActionResult ClientBList() { int page = 1; if (!String.IsNullOrEmpty(Request["p"])) { page = Convert.ToInt32(Request["p"]); } String search_criteria = ""; if (!String.IsNullOrEmpty(Request.QueryString["s"])) { search_criteria = Request.QueryString["s"]; } int total; T_Task entity = new T_Task(); if (!String.IsNullOrEmpty(Request.QueryString["status"])) { entity.statusId = Int32.Parse(Request.QueryString["status"]); } List <T_Task> entitys = entityDao.Search(entity, page, this.pageSize, search_criteria, T_Task.Columns.statusId, AscDesc.ASC, out total); T_Task_StatusDAO sdao = new T_Task_StatusDAO(); T_UserDAO udao = new T_UserDAO(); T_TaskDAO tdao = new T_TaskDAO(); String uid = Convert.ToString(Session["uid"]); T_User q = udao.GetByModel(new T_User() { id = uid }); Session["roleid"] = q.roleId; ViewBag.status = sdao.GetAllByModel(null); ViewBag.total = total; ViewBag.pageSize = this.pageSize; ViewBag.status = sdao.GetAllByModel(null); ViewBag.list = entitys; return(View(entitys)); }
public ActionResult List() { String uid = Convert.ToString(Session["uid"]); if (String.IsNullOrWhiteSpace(uid)) { return(Fail("没有足够的参数")); } else { //翻页,页数查询条件 int page = 1; if (!String.IsNullOrEmpty(Request["p"])) { page = Convert.ToInt32(Request["p"]); } //关键字模糊查询 String search_criteria = ""; if (!String.IsNullOrEmpty(Request.QueryString["s"])) { search_criteria = Request.QueryString["s"]; } int total; T_Task entity = new T_Task(); //任务状态查询 if (!String.IsNullOrEmpty(Request.QueryString["status"])) { entity.statusId = Int32.Parse(Request.QueryString["status"]); } T_TaskDAO entityDao = new T_TaskDAO(); List <T_Task> entitys = entityDao.Search(entity, page, this.pageSize, search_criteria, T_Task.Columns.statusId, AscDesc.ASC, out total); ViewBag.list = entitys; T_UserDAO udao = new T_UserDAO(); T_User q = udao.GetByModel(new T_User() { id = uid }); T_Task_StatusDAO sdao = new T_Task_StatusDAO(); ViewBag.uid = uid; Session["roleid"] = q.roleId; ViewBag.status = sdao.GetAllByModel(null); //ViewBag.list = taskList; return(View()); } }
public ActionResult List() { int page = 1; if (!String.IsNullOrEmpty(Request["p"])) { page = Convert.ToInt32(Request["p"]); } String search_criteria = ""; if (!String.IsNullOrEmpty(Request.QueryString["s"])) { search_criteria = Request.QueryString["s"]; } int total; T_Task entity = new T_Task(); if (!String.IsNullOrEmpty(Request.QueryString["status"])) { entity.statusId = Int32.Parse(Request.QueryString["status"]); } List <T_Task> entitys = entityDao.Search(entity, page, this.pageSize, search_criteria, T_Task.Columns.statusId, AscDesc.ASC, out total); T_Task_StatusDAO sdao = new T_Task_StatusDAO(); T_UserDAO udao = new T_UserDAO(); T_TaskDAO tdao = new T_TaskDAO(); String uid = Convert.ToString(Session["uid"]); T_User q = udao.GetByModel(new T_User() { id = uid }); Session["username"] = q.name; Session["dept"] = q.dept; Session["roleid"] = q.roleId; ViewBag.total = total; ViewBag.pageSize = this.pageSize; ViewBag.status = sdao.GetAllByModel(null); ViewBag.list = entitys; return(View(entitys)); if (String.IsNullOrWhiteSpace(uid)) { return(Fail("没有足够的参数")); } else { T_TaskDAO taskdao = new T_TaskDAO(); T_Task task = new T_Task() { }; List <T_Task> tasklist = taskdao.GetAllByModel(task); T_Task_StatusDAO statusdao = new T_Task_StatusDAO(); T_Task_Status status = new T_Task_Status() { }; List <T_Task_Status> statuslist = statusdao.GetAllByModel(status); ViewBag.uid = Session["uid"]; ViewBag.list = tasklist; ViewBag.statuslist = statuslist; return(View()); } }