Example #1
0
 public ActionResult fieldabnormalview(int? page, int? pagesize)
 {
     string list_id = WebRequest.GetString("list_id", true);
     dynamic data = new System.Dynamic.ExpandoObject();
     AbnormalManagementList one = new AbnormalManagementList();
     AbnormalProcessDetail last = new AbnormalProcessDetail();
     #region 单个对象
     try
     {
         one = managementService.GetOneAbnormalManagementList(Masterpage.CurrUser.client_code, int.Parse(list_id));
         if (one == null) return RedirectToAction("fieldabnormal");
         if (one.AbnormalStatus == "已关闭") last = managementService.GetLastAbnormalProcessDetail(Masterpage.CurrUser.client_code, int.Parse(list_id));
     }
     catch
     {
         return RedirectToAction("fieldabnormal");
     }
     #endregion
     var list = managementService.GetAbnormalProcessDetail(Masterpage.CurrUser.client_code, int.Parse(list_id));
     int _page = page.HasValue ? page.Value : 1;
     int _pagesize = pagesize.HasValue ? pagesize.Value : 14;
     var vs = list.ToPagedList(_page, _pagesize);
     data.list = vs;
     data.pageSize = _pagesize;
     data.pageIndex = _page;
     data.totalCount = vs.TotalCount;
     data.one = one;
     data.last = last;
     data.ddltype = managementService.GetAbnormalType();
     string otherparam = "";
     if (list_id != "") otherparam += "&list_id=" + list_id;
     data.otherParam = otherparam;
     return View(data);
 }
Example #2
0
 public ActionResult fieldabnormaldetailpage(string t, int? list_id, int? detail_id)
 {
     dynamic data = new System.Dynamic.ExpandoObject();
     AbnormalManagementList ml = new AbnormalManagementList();
     string number = "";
     #region 现场异常
     try
     {
         ml = managementService.GetOneAbnormalManagementList(Masterpage.CurrUser.client_code, list_id.Value);
         if (ml == null) return RedirectToAction("fieldabnormal");
         number = ml.AbnormalManagementNO;
     }
     catch
     {
         return RedirectToAction("fieldabnormal");
     }
     #endregion
     AbnormalProcessDetail one = new AbnormalProcessDetail();
     string person = Masterpage.CurrUser.alias;
     if ((t == "edit" || t == "show") && t != "" && t != "0")
     {
         one = managementService.GetOneAbnormalProcessDetail(Masterpage.CurrUser.client_code, list_id.Value, detail_id.Value);
         person = one.Employee.EmployeeChineseName;
     }
     data.one = one;
     data.person = person;
     data.number = number;
     data.type = t;
     data.list_id = list_id.Value;
     data.detail_id = detail_id.Value;
     return View(data);
 }