示例#1
0
        /// <summary>
        /// 构造流转条件
        /// </summary>
        /// <param name="conditions">条件字符串</param>
        /// <returns></returns>
        protected Dictionary <string, string> GetCondition(string conditions)
        {
            //根据条件取得下一步骤
            Dictionary <string, string> condition = new Dictionary <string, string>();

            condition.Add("RoleID", LoginRoleID.ToString());//角色ID

            if (!string.IsNullOrEmpty(conditions))
            {
                string[] conditionItemArray = conditions.Split(',');
                foreach (string conditionItems in conditionItemArray)
                {
                    if (!string.IsNullOrEmpty(conditionItems))
                    {
                        string[] conditionItem = conditionItems.Split('-');
                        if (conditionItem.Length == 2)
                        {
                            string key   = conditionItem[0];
                            string value = conditionItem[1];

                            if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value))
                            {
                                condition.Add(key, value);
                            }
                        }
                    }
                }
            }
            return(condition);
        }
示例#2
0
        protected void InitFlowInfo()
        {
            string AppInstanceID      = Request.QueryString["AppInstanceID"] == null ? string.Empty : Request.QueryString["AppInstanceID"].ToString();
            string ProcessGUID        = Request.QueryString["ProcessGUID"] == null ? string.Empty : Request.QueryString["ProcessGUID"].ToString();
            int    ActivityInstanceID = Request.QueryString["ActivityInstanceID"] == null ? 0 : Helper.ConverToInt32(Request.QueryString["ActivityInstanceID"].ToString());

            if (!string.IsNullOrEmpty(AppInstanceID))
            {
                int            leaveID        = int.Parse(AppInstanceID);
                HrsLeaveEntity hrsLeaveEntity = WorkFlows.GetHrsLeaveModel(leaveID);
                if (hrsLeaveEntity != null && hrsLeaveEntity.ID > 0)
                {
                    selectLeaveType.Value          = hrsLeaveEntity.LeaveType.ToString();
                    selectLeaveType.Disabled       = true;
                    txtDays.Value                  = hrsLeaveEntity.Days.ToString();
                    txtFromDate.Value              = hrsLeaveEntity.FromDate.ToString("yyyy-MM-dd");
                    txtToDate.Value                = hrsLeaveEntity.ToDate.ToString("yyyy-MM-dd");
                    hiddenInstanceId.Value         = hrsLeaveEntity.ID.ToString();
                    hiddenActivityInstanceID.Value = ActivityInstanceID.ToString();

                    this.txtDepmanagerRemark.Value     = hrsLeaveEntity.DepManagerRemark;
                    this.txtDirectorRemark.Value       = hrsLeaveEntity.DirectorRemark;       //主管总监
                    this.txtDeputyGeneralRemark.Value  = hrsLeaveEntity.DeputyGeneralRemark;  //副总经理
                    this.txtGeneralManagerRemark.Value = hrsLeaveEntity.GeneralManagerRemark; //总经理


                    //权限设置
                    IWorkflowService       service = new WorkflowService();
                    ActivityInstanceEntity activityInstanceEntity = service.GetActivityInstance(ActivityInstanceID);
                    ProcessInstanceEntity  processInstanceEntity  = service.GetProcessInstance(activityInstanceEntity.ProcessInstanceID);

                    this.txtProcessGUID.Value = activityInstanceEntity.ProcessGUID;
                    if (activityInstanceEntity != null)
                    {
                        ActivityEntity activityEntity = service.GetActivityEntity(processInstanceEntity.ProcessGUID,
                                                                                  processInstanceEntity.Version,
                                                                                  activityInstanceEntity.ActivityGUID);

                        var roles = service.GetActivityRoles(processInstanceEntity.ProcessGUID,
                                                             processInstanceEntity.Version,
                                                             activityInstanceEntity.ActivityGUID);

                        if (activityEntity != null && roles != null && roles.Count > 0)
                        {
                            foreach (var role in roles)
                            {
                                if (role.ID == LoginRoleID.ToString())
                                {
                                    switch (role.ID)
                                    {
                                    case "2":    //部门经理
                                        this.txtDepmanagerRemark.Disabled = false;
                                        hiddenPerformField.Value          = "DepManager";
                                        break;

                                    case "4":    //主管总监
                                        this.txtDirectorRemark.Disabled = false;
                                        hiddenPerformField.Value        = "Director";
                                        break;

                                    case "7":    //副总经理
                                        this.txtDeputyGeneralRemark.Disabled = false;
                                        hiddenPerformField.Value             = "Deputy";
                                        break;

                                    case "8":    //总经理
                                        this.txtGeneralManagerRemark.Disabled = false;
                                        hiddenPerformField.Value = "General";
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }