123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.DQPSystem;
- using EMIS.ViewModel.DQPSystem;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.Entities;
- using EMIS.Utility.FormValidate;
- namespace EMIS.Web.Controllers.DQPSystem
- {
- [Authorization]
- public class SOCDocController : Controller
- {
- public ISOCDocServices SOCDocServices { get; set; }
- public ActionResult DispPOC()
- {
- return View();
- }
- public ActionResult AdminList()
- {
- return View();
- }
- public ActionResult UserList()
- {
- return View();
- }
- public ActionResult Edit(Guid? documentID)
- {
- var documentView = new SOCDocView();
- if (documentID.HasValue)
- {
- documentView = this.SOCDocServices.GetSOCDocView(documentID.Value);
- }
- else
- {
- documentView.IsShow = true;
- }
- return View(documentView);
- }
- public ActionResult View(Guid documentID)
- {
- var documentView = this.SOCDocServices.GetSOCDocView(documentID);
- return View(documentView);
- }
- [HttpPost]
- public ActionResult AdminList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var socDocTypeID = pararms.getExtraInt("ddlSOCDocType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSOCDocType");
- var collegeID = pararms.getExtraGuid("cgbCreateCollege");
- var targetRoleID = pararms.getExtraGuid("cbgRole");
- var targetCollegeID = pararms.getExtraGuid("cgbTargetCollege");
- return base.Json(SOCDocServices.GetSOCDocViewList(configuretView, socDocTypeID, collegeID, targetRoleID, targetCollegeID, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult Delete(string documentIDs)
- {
- try
- {
- var documentIDList = documentIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- SOCDocServices.Delete(documentIDList);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败,原因:" + ex.Message + "!" });
- }
- }
- [HttpPost]
- public ActionResult Edit(SOCDocView docView)
- {
- try
- {
- var roleList = DataGrid.GetTableData<Sys_Role>("dgRoleList");
- var departmentList = DataGrid.GetTableData<CF_Department>("dgDepartmentList");
- docView.Content = HttpContext.Server.HtmlDecode(docView.Content);
- SOCDocServices.Save(docView, roleList.Select(x => (Guid?)x.RoleID).ToList(), departmentList.Select(x => (Guid?)x.DepartmentID).ToList());
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败:" + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult UserList(QueryParamsModel pararms)
- {
- var roleID = CustomPrincipal.Current.RoleID;
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var socDocTypeID = pararms.getExtraInt("ddlSOCDocType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSOCDocType");
- var collegeID = pararms.getExtraGuid("cgbCreateCollege");
- var targetRoleID = pararms.getExtraGuid("cbgRole");
- var targetCollegeID = pararms.getExtraGuid("cgbTargetCollege");
- return base.Json(SOCDocServices.GetUserSOCDocViewList(configuretView, roleID ?? Guid.Empty, socDocTypeID, collegeID, targetRoleID, targetCollegeID, (int)pararms.page, (int)pararms.rows));
- }
- }
- }
|