public static string ToStandardRepresentation(SuccessOrFailure successOrFailure)
        {
            switch (successOrFailure)
            {
            case SuccessOrFailure.Failure:
                return(SuccessOrFailureHelper.StandardRepresentation.Failure);

            case SuccessOrFailure.Success:
                return(SuccessOrFailureHelper.StandardRepresentation.Success);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(successOrFailure);
            }
        }
        public static bool ToBoolean(this SuccessOrFailure successOrFailure)
        {
            switch (successOrFailure)
            {
            case SuccessOrFailure.Failure:
                return(false);

            case SuccessOrFailure.Success:
                return(true);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(successOrFailure);
            }
        }
예제 #3
0
        public static string ToStandardRepresentation(ApprovalStatus approvalStatus)
        {
            switch (approvalStatus)
            {
            case ApprovalStatus.Approved:
                return(ApprovalStatusHelper.StandardRepresentation.Approved);

            case ApprovalStatus.Denied:
                return(ApprovalStatusHelper.StandardRepresentation.Denied);

            case ApprovalStatus.Pending:
                return(ApprovalStatusHelper.StandardRepresentation.Pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(approvalStatus);
            }
        }
예제 #4
0
        public static T Switch <T>(this ApprovalStatus approvalStatus, T approved, T denied, T pending)
        {
            switch (approvalStatus)
            {
            case ApprovalStatus.Approved:
                return(approved);

            case ApprovalStatus.Denied:
                return(denied);

            case ApprovalStatus.Pending:
                return(pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(approvalStatus);
            }
        }
예제 #5
0
        public static T Switch <T>(this OrganizationCourtStatus organizationCourtStatus, T approved, T denied, T pending)
        {
            switch (organizationCourtStatus)
            {
            case OrganizationCourtStatus.Approved:
                return(approved);

            case OrganizationCourtStatus.Denied:
                return(denied);

            case OrganizationCourtStatus.DeniedWithReroute:
                return(denied);

            case OrganizationCourtStatus.Pending:
                return(pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(organizationCourtStatus);
            }
        }
        public static string ToStandardRepresentation(OrganizationCourtStatus organizationCourtStatus)
        {
            switch (organizationCourtStatus)
            {
            case OrganizationCourtStatus.Approved:
                return(OrganizationCourtStatusHelper.StandardRepresentation.Approved);

            case OrganizationCourtStatus.Denied:
                return(OrganizationCourtStatusHelper.StandardRepresentation.Denied);

            case OrganizationCourtStatus.DeniedWithReroute:
                return(OrganizationCourtStatusHelper.StandardRepresentation.DeniedWithReroute);

            case OrganizationCourtStatus.Pending:
                return(OrganizationCourtStatusHelper.StandardRepresentation.Pending);

            default:
                throw EnumerationHelper.SwitchDefaultCaseException(organizationCourtStatus);
            }
        }