Пример #1
0
        /// <summary>
        /// 获取审核对象根据委托
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="activityAssignmentId"></param>
        public static ACTIVITY_ASSIGNMENT GetInnvatorByAgent(Innovator inn, UserInfo userInfo, string activityId, string activityAssignmentId, ref string delegateName)
        {
            ACTIVITY_ASSIGNMENT obj       = null;
            AgentAuthEntity     agentAuth = null;
            IDENTITY            dentity   = IdentityDA.GetIdentityByActivityAssignmentId(activityAssignmentId);

            if (userInfo.AgentAuth != null)
            {
                agentAuth = userInfo.AgentAuth.Where(x => x.agentRoles.Contains(dentity.ID)).FirstOrDefault();
                if (agentAuth != null)
                {
                    delegateName = agentAuth.delegateName;
                }
            }

            //当人员信息权限中没有当前Identity权限 并且  Identity在委托的的权限中存在时!则为委托审核
            if (!userInfo.Roles.Contains(dentity.ID) && agentAuth != null)
            {
                //获取当前人员的Id
                Item   identity   = IdentityDA.GetIdentityByKeyedName(inn, userInfo.UserName);
                string identityId = identity.getProperty("id");

                var ActivityAssignmentItem = ActivityAssignmentDA.GetActivityAssignmentById(inn, activityAssignmentId);
                int voting_weight          = int.Parse(ActivityAssignmentItem.getItemByIndex(0).getProperty("voting_weight"));
                //修改当前审核权限为0
                ActivityAssignmentDA.UpdateActivityAssignmentVotingWeight(inn, activityAssignmentId, 0);
                //插入委托人员权限
                ActivityAssignmentDA.AddActivityAssignment(inn, activityId, identityId, voting_weight);
                //获取插入权限的ID
                obj = ActivityAssignmentDA.GetActivity_AssignmentByCondition(activityId, identityId);
            }
            return(obj);
        }
Пример #2
0
        /// <summary>
        /// 获取角色列表数据
        /// </summary>
        /// <returns></returns>
        public JsonResult GetRoleManageList(DataTableParameter para, string searchValue)
        {
            int total = 0;
            List <RoleManageModel> list = new List <RoleManageModel>();
            var dataList = IdentityDA.GetRoleManageList(out total, para, searchValue);

            if (dataList.Count() > 0)
            {
                for (int index = 0; index < dataList.Count(); index++)
                {
                    RoleManageModel model   = new RoleManageModel();
                    IDENTITY        item    = dataList[index];
                    string          strHtml = "<div class='row'><div class='col-md-8'>{0}</div><div class='col-md-4' style='text-align:right'>{1}</div></div>";

                    string linkAList = "<a class='glyphicon glyphicon-cog configRole' title='配置'  RoleId='" + item.ID + "'></a>";
                    if (Userinfo.LoginName == "admin")
                    {
                        linkAList += "&nbsp;&nbsp;&nbsp;&nbsp;<a class='glyphicon glyphicon-trash deleteRole' title='删除' RoleId='" + item.ID + "'></a>";
                    }
                    strHtml          = string.Format(strHtml, item.KEYED_NAME, linkAList);
                    model.KEYED_NAME = strHtml;
                    model.Id         = item.ID;
                    if (item.DESCRIPTION.Contains(";"))
                    {
                        List <string> listStr = item.DESCRIPTION.Split(';').ToList();
                        if (listStr.Count >= 2)
                        {
                            model.Region = listStr[1];
                        }
                    }
                    //获取成员列表
                    List <IDENTITY> memberList = IdentityDA.GetMemberById(model.Id);
                    foreach (var member in memberList)
                    {
                        model.PersonList = model.PersonList + member.NAME + ";";
                    }
                    list.Add(model);
                }
            }
            return(Json(new
            {
                sEcho = para.sEcho,
                iTotalRecords = total,
                iTotalDisplayRecords = total,
                aaData = list
            }, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        /// <summary>
        /// 保存转办
        /// </summary>
        /// <returns></returns>
        public JsonResult SaveWorkflowTurnToDo(CompleteActivityModel model)
        {
            var retModel = new JsonReturnModel();

            try
            {
                var user = UserDA.GetUserByFirstName(model.delegateToName);
                if (user == null)
                {
                    retModel.AddError("errorMessage", "选择的转办不存在!");
                    return(Json(retModel, JsonRequestBehavior.AllowGet));
                }

                if (model.delegateToName == Userinfo.UserName)
                {
                    retModel.AddError("errorMessage", "转办人不能选择自己!");
                    return(Json(retModel, JsonRequestBehavior.AllowGet));
                }

                IDENTITY dentity      = IdentityDA.GetIdentityByActivityAssignmentId(model.activityAssignmentId);
                string   identityName = dentity.KEYED_NAME;
                if (identityName.Trim() != Userinfo.UserName)
                {
                    retModel.AddError("errorMessage", "代理权限不能进行转办!");
                    return(Json(retModel, JsonRequestBehavior.AllowGet));
                }

                string errorString = ActivityDA.CompleteActivity(inn, model.activityId, model.activityAssignmentId, "", "Delegate", model.delegateToName, Userinfo.UserName + "转办到:" + model.delegateToName, Userinfo);
                if (string.IsNullOrEmpty(errorString))
                {
                    WorkFlowBll.TurnToDoSendEmail(Userinfo.UserName, model.delegateToName, model.recordNo, model.linkStr, user.EMAIL);
                }
            }
            catch (Exception ex)
            {
                retModel.AddError("errorMessage", ex.Message);
            }
            return(Json(retModel, JsonRequestBehavior.AllowGet));
        }