/// <summary>
        /// Converts a PayeeTypeEnum value to a corresponding string value
        /// </summary>
        /// <param name="enumValue">The PayeeTypeEnum value to convert</param>
        /// <returns>The representative string value</returns>
        public static string ToValue(PayeeTypeEnum enumValue)
        {
            switch (enumValue)
            {
            //only valid enum elements can be used
            //this is necessary to avoid errors
            case PayeeTypeEnum.BUSINESS:
            case PayeeTypeEnum.INDIVIDUAL:
                return(StringValues[(int)enumValue]);

            //an invalid enum value was requested
            default:
                return(null);
            }
        }
Example #2
0
        public RemitRecord CreateRemitRecordByUserArc(UserArc userArc, RemitRecord remitRecord, PayeeTypeEnum payeeTypeEnum)
        {
            remitRecord.UserId    = userArc.UserId;
            remitRecord.ArcName   = userArc.ArcName;
            remitRecord.ArcNo     = userArc.ArcNo;
            remitRecord.PayeeType = (byte)payeeTypeEnum;

            dbContext.RemitRecord.Add(remitRecord);
            dbContext.SaveChanges();
            dbContext.Entry(remitRecord).Reference(record => record.Beneficiary).Query()
            .Include(Beneficiary => Beneficiary.PayeeRelation)
            .Load();
            dbContext.Entry(remitRecord).Reference(record => record.ToCurrency).Load();

            return(remitRecord);
        }
Example #3
0
 public PayeeType GetPayeeTypeByType(PayeeTypeEnum type)
 {
     return(dbContext.PayeeType.First <PayeeType>(payeeType => payeeType.Type == (int)type));
 }