Example #1
0
        protected void InitFlowInfo()
        {
            string AppInstanceID = Request.QueryString["AppInstanceID"] == null ? string.Empty : Request.QueryString["AppInstanceID"].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");

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

                    txtCreatedByUserName.Value = hrsLeaveEntity.CreatedUserName;
                    txtCreatedDateTime.Value   = hrsLeaveEntity.CreatedDate.ToString("yyyy-MM-dd");
                }
            }
        }
Example #2
0
        protected void InitFlowInfo()
        {
            int AppInstanceID = Request.QueryString["AppInstanceID"] == null ? 0 : Helper.ConverToInt32(Request.QueryString["AppInstanceID"].ToString());

            if (AppInstanceID > 0)
            {
                HrsLeaveEntity hrsLeaveEntity = WorkFlows.GetHrsLeaveModel(AppInstanceID);
                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");

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

                    txtCreatedByUserName.Value = hrsLeaveEntity.CreatedUserName;
                    txtCreatedDateTime.Value   = hrsLeaveEntity.CreatedDate.ToString("yyyy-MM-dd");
                }
            }
        }
Example #3
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;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }