示例#1
0
 public static string ParseStr(MoneyValue amountStr)
 {
     //var splittedAmount = amountStr.Split(' ');
     //string currency = splittedAmount[1];
     //Decimal value = Decimal.Parse(splittedAmount[0]);
     return("a");
 }
示例#2
0
        public async Task <bool> CarReserveAsync(Guid CarId, MoneyValue MoneyValue, DateTime RentalDate, DateTime DevolutionDate)
        {
            Reserve Reserve = new Reserve();

            Reserve.Id = Guid.NewGuid();

            var reserve = new Reserve();

            reserve.CarId          = CarId;
            reserve.ActionType     = CarType.Job;
            reserve.RentalDate     = RentalDate;
            reserve.DevolutionDate = DevolutionDate;
            reserve.Value          = MoneyValue;

            await _ReserveRepository.CreateAsync(Reserve);

            return(await _ReserveRepository.SaveChangesAsync() > 0);
        }
示例#3
0
 public static MoneyValue Sum <T>(this IEnumerable <T> source, Func <T, MoneyValue> selector)
 {
     return(MoneyValue.Of(source.Select(selector).Aggregate((x, y) => x + y)));
 }
示例#4
0
 public static MoneyValue Of(MoneyValue value)
 {
     return(new MoneyValue(value.Value, value.Currency));
 }
示例#5
0
 public MoneyValueOperationMustBePerformedOnTheSameCurrencyRule(MoneyValue left, MoneyValue right)
 {
     _left  = left;
     _right = right;
 }