示例#1
0
        public static EmployeePayrollRecordResult MapToRecordResult(EmployeePayrollRecordActionFormMode formMode)
        {
            switch (formMode)
            {
            case EmployeePayrollRecordActionFormMode.InputSuggestion:
                return(EmployeePayrollRecordResult.ApprovedWithSuggestions);

            case EmployeePayrollRecordActionFormMode.Approve:
                return(EmployeePayrollRecordResult.Approved);

            case EmployeePayrollRecordActionFormMode.ApproveWithSuggestions:
                return(EmployeePayrollRecordResult.ApprovedWithSuggestions);

            case EmployeePayrollRecordActionFormMode.FinalApproveHDCuratorVersion:
                return(EmployeePayrollRecordResult.FinalApprovedHDCuratorVersion);

            case EmployeePayrollRecordActionFormMode.FinalApproveHDVersion:
                return(EmployeePayrollRecordResult.FinalApprovedHDVersion);

            case EmployeePayrollRecordActionFormMode.FinalApproveWithSuggestions:
                return(EmployeePayrollRecordResult.FinalApprovedWithSuggestions);

            case EmployeePayrollRecordActionFormMode.Reject:
                return(EmployeePayrollRecordResult.Rejected);

            default:
                return(EmployeePayrollRecordResult.None);
            }
        }
示例#2
0
        public static int GetActionFormModeIndex(EmployeePayrollRecordActionFormMode formMode)
        {
            var values = Enum.GetValues(typeof(EmployeePayrollRecordActionFormMode)).Cast <EmployeePayrollRecordActionFormMode>().OrderBy(v => v);

            for (int i = 0; i < values.Count(); i++)
            {
                if (values.ElementAt(i) == formMode)
                {
                    return(i);
                }
            }
            return(-1);
        }