using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QMAPP.Common.Web.Controllers;
using QMAPP.Entity.Sys;
using QMAPP.Web.Models.Sys;
using QMFrameWork.WebUI.Attribute;
namespace QMAPP.Web.Controllers
{
///
/// 工作流
///
public class WorkFlowController : QController
{
#region 获取流程设置机构信息
///
/// 支持交互流程设置
///
///
[HandleException]
public ActionResult SIFlowSetList()
{
FlowSetModel flowSetModel = null;
try
{
FlowSet flowSet = new FlowSet();
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
flowSet = agent.InvokeServiceFunction("WorkFlowBLL_GetWorkFlow", flowSet);
flowSetModel = CopyToModel(flowSet);
return View(flowSetModel);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取当前结点下的人员信息
///
/// 获取当前结点下的人员信息
///
///
[HandleException]
public ActionResult GetCurrentUserFlowLevel(FlowSetModel model)
{
try
{
if (model == null)
{
model = new FlowSetModel();
}
List list = null;
//获取部门列表
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
list = agent.InvokeServiceFunction>("UserManageBLL_GetUserOrgaList", "");
//所有机构列表
List orgaizationList = new List();
foreach (Orgaization orga in list)
{
OrgaizationModel tm = new OrgaizationModel();
tm = CopyToModel(orga);
orgaizationList.Add(tm);
}
model.orgaizationList = orgaizationList;
//已选择的机构列表
ZPFlow zpFlow = new ZPFlow();
zpFlow.FlowLevel = Convert.ToInt32(model.FlowLevel);
List selList = agent.InvokeServiceFunction>("WorkFlowBLL_GetUserByFlowLevel", zpFlow);
List zpList = new List();
foreach (ZPFlow zp in selList)
{
ZPFlowModel tm = new ZPFlowModel();
tm = CopyToModel(zp);
zpList.Add(tm);
}
model.zpFlowList = zpList;
return View("SelectOrga", model);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 保存当前选择的用户
///
/// 保存当前选择的用户
///
///
[HandleException]
public ActionResult SaveSelectOrganization(string FlowLevel, string selectKey)
{
try
{
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
agent.InvokeServiceFunction("WorkFlowBLL_SaveSelectOrganization", FlowLevel, selectKey);
return this.GetJsViewResult(string.Format("parent.updatePage();parent.showTitle('{0}');parent.closeAppWindow1();"
, AppResource.SaveMessge));
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}