Exemplo n.º 1
0
        public decimal InsertFlowByManagerCreator(ManagerCreator MC, decimal targetManagerCreatorID, decimal accessGroupID, string flowName, IList <UnderManagment> UnderManagmentList)
        {
            decimal flowID = 0;

            switch (MC)
            {
            case ManagerCreator.Personnel:
                flowID = this.InsertFlowByPerson(targetManagerCreatorID, accessGroupID, flowName, UnderManagmentList);
                break;

            case ManagerCreator.OrganizationPost:
                flowID = this.InsertFlowByOrganization(targetManagerCreatorID, accessGroupID, flowName, UnderManagmentList);
                break;

            case ManagerCreator.None:
                break;
            }
            return(flowID);
        }
Exemplo n.º 2
0
        public string[] UpdateUnderManagement_UnderManagementPersonnelPage(string state, string SelectedManagerID, string managerCreator, string PersonnelID, string OrganizationPostID, string AccessGroupID, string FlowID, string FlowName, string strUnderManagementList, string GroupID)
        {
            this.InitializeCulture();

            string[] retMessage = new string[4];

            try
            {
                AttackDefender.CSRFDefender(this.Page);
                decimal        retFlowID = 0;
                decimal        targetManagerCreatorID = 0;
                decimal        selectedManagerID      = decimal.Parse(this.StringBuilder.CreateString(SelectedManagerID), CultureInfo.InvariantCulture);
                ManagerCreator Mc                 = (ManagerCreator)Enum.Parse(typeof(ManagerCreator), this.StringBuilder.CreateString(managerCreator));
                decimal        personnelID        = decimal.Parse(this.StringBuilder.CreateString(PersonnelID), CultureInfo.InvariantCulture);
                decimal        organizationPostID = decimal.Parse(this.StringBuilder.CreateString(OrganizationPostID), CultureInfo.InvariantCulture);
                decimal        accessGroupID      = decimal.Parse(this.StringBuilder.CreateString(AccessGroupID), CultureInfo.InvariantCulture);
                decimal        flowID             = decimal.Parse(this.StringBuilder.CreateString(FlowID), CultureInfo.InvariantCulture);
                decimal        groupID            = decimal.Parse(this.StringBuilder.CreateString(GroupID), CultureInfo.InvariantCulture);
                FlowName = this.StringBuilder.CreateString(FlowName);
                IList <UnderManagment> UnderManagmentList = this.CreateUnderManagementList_UnderManagementPersonnel(this.StringBuilder.CreateString(strUnderManagementList));
                UIActionType           uam = (UIActionType)Enum.Parse(typeof(UIActionType), this.StringBuilder.CreateString(state).ToUpper());

                switch (uam)
                {
                case UIActionType.ADD:
                    switch (Mc)
                    {
                    case ManagerCreator.Personnel:
                        targetManagerCreatorID = personnelID;
                        break;

                    case ManagerCreator.OrganizationPost:
                        targetManagerCreatorID = organizationPostID;
                        break;

                    case ManagerCreator.None:
                        retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, new Exception(GetLocalResourceObject("FlowPersonOrOrganizationMustSpecified").ToString()), retMessage);
                        return(retMessage);
                    }
                    retFlowID = this.ManagerBusiness.InsertFlowByManagerCreator(Mc, targetManagerCreatorID, accessGroupID, FlowName, UnderManagmentList, groupID);
                    break;

                case UIActionType.EDIT:
                    if (flowID == 0)
                    {
                        retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, new Exception(GetLocalResourceObject("NoFlowforEdit").ToString()), retMessage);
                        return(retMessage);
                    }
                    retFlowID = this.ManagerBusiness.UpdateFlow(flowID, accessGroupID, FlowName, UnderManagmentList, groupID);
                    break;
                }

                retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
                string SuccessMessageBody = string.Empty;
                switch (uam)
                {
                case Business.UIActionType.ADD:
                    SuccessMessageBody = GetLocalResourceObject("AddComplete").ToString();
                    break;

                case Business.UIActionType.EDIT:
                    SuccessMessageBody = GetLocalResourceObject("EditComplete").ToString();
                    break;

                default:
                    break;
                }
                retMessage[1] = SuccessMessageBody;
                retMessage[2] = "success";
                retMessage[3] = retFlowID.ToString();
                return(retMessage);
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                return(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                return(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                return(retMessage);
            }
        }