private static void FindValueInMonthOrderNote(ChartValues <decimal> ValueRevenue, IEnumerable <OrderNote> valueM1, decimal totalMonthAmount1,
                                               IEnumerable <OrderNote> valueM2, decimal totalMonthAmount2, IEnumerable <OrderNote> valueM3, decimal totalMonthAmount3, IEnumerable <OrderNote> valueM4,
                                               decimal totalMonthAmount4, IEnumerable <OrderNote> valueM5, decimal totalMonthAmount5, IEnumerable <OrderNote> valueM6,
                                               decimal totalMonthAmount6, IEnumerable <OrderNote> valueM7, decimal totalMonthAmount7, IEnumerable <OrderNote> valueM8,
                                               decimal totalMonthAmount8, IEnumerable <OrderNote> valueM9, decimal totalMonthAmount9, IEnumerable <OrderNote> valueM10,
                                               decimal totalMonthAmount10, IEnumerable <OrderNote> valueM11, decimal totalMonthAmount11, IEnumerable <OrderNote> valueM12,
                                               decimal totalMonthAmount12)
 {
     if (valueM1 == null)
     {
         totalMonthAmount1 = 0;
     }
     else
     {
         foreach (var item in valueM1)
         {
             totalMonthAmount1 += item.TotalPrice;
         }
     }
     if (valueM2 == null)
     {
         totalMonthAmount2 = 0;
     }
     else
     {
         foreach (var item in valueM2)
         {
             totalMonthAmount2 += item.TotalPrice;
         }
     }
     if (valueM3 == null)
     {
         totalMonthAmount3 = 0;
     }
     else
     {
         foreach (var item in valueM3)
         {
             totalMonthAmount3 += item.TotalPrice;
         }
     }
     if (valueM4 == null)
     {
         totalMonthAmount4 = 0;
     }
     else
     {
         foreach (var item in valueM4)
         {
             totalMonthAmount4 += item.TotalPrice;
         }
     }
     if (valueM5 == null)
     {
         totalMonthAmount5 = 0;
     }
     else
     {
         foreach (var item in valueM5)
         {
             totalMonthAmount5 += item.TotalPrice;
         }
     }
     if (valueM6 == null)
     {
         totalMonthAmount6 = 0;
     }
     else
     {
         foreach (var item in valueM6)
         {
             totalMonthAmount6 += item.TotalPrice;
         }
     }
     if (valueM7 == null)
     {
         totalMonthAmount7 = 0;
     }
     else
     {
         foreach (var item in valueM7)
         {
             totalMonthAmount7 += item.TotalPrice;
         }
     }
     if (valueM8 == null)
     {
         totalMonthAmount8 = 0;
     }
     else
     {
         foreach (var item in valueM8)
         {
             totalMonthAmount8 += item.TotalPrice;
         }
     }
     if (valueM9 == null)
     {
         totalMonthAmount9 = 0;
     }
     else
     {
         foreach (var item in valueM9)
         {
             totalMonthAmount9 += item.TotalPrice;
         }
     }
     if (valueM10 == null)
     {
         totalMonthAmount10 = 0;
     }
     else
     {
         foreach (var item in valueM10)
         {
             totalMonthAmount10 += item.TotalPrice;
         }
     }
     if (valueM11 == null)
     {
         totalMonthAmount11 = 0;
     }
     else
     {
         foreach (var item in valueM11)
         {
             totalMonthAmount11 += item.TotalPrice;
         }
     }
     if (valueM12 == null)
     {
         totalMonthAmount12 = 0;
     }
     else
     {
         foreach (var item in valueM12)
         {
             totalMonthAmount12 += item.TotalPrice;
         }
     }
     ValueRevenue.Add(totalMonthAmount1);
     ValueRevenue.Add(totalMonthAmount2);
     ValueRevenue.Add(totalMonthAmount3);
     ValueRevenue.Add(totalMonthAmount4);
     ValueRevenue.Add(totalMonthAmount5);
     ValueRevenue.Add(totalMonthAmount6);
     ValueRevenue.Add(totalMonthAmount7);
     ValueRevenue.Add(totalMonthAmount8);
     ValueRevenue.Add(totalMonthAmount9);
     ValueRevenue.Add(totalMonthAmount10);
     ValueRevenue.Add(totalMonthAmount11);
     ValueRevenue.Add(totalMonthAmount12);
 }
 public FixAmontDiscountCalculator(decimal minimumAmount, decimal discountAmount)
 {
     this.minimumAmount = minimumAmount;
     this.discountAmount = discountAmount;
 }
 public override decimal Discount(decimal amount)
 {
     return discountAmount;
 }
 public override bool CanDiscount(decimal amount)
 {
     return false;
 }
 public PercentageDiscountCalculator(decimal ratio, decimal minimumAmount)
 {
     this.ratio = ratio;
     this.minimumAmount = minimumAmount;
 }
 public IShampoo CreateShampoo(string name, string brand, decimal price, GenderType gender, uint milliliters, UsageType usage)
 {
     return new Shampoo(name,brand,price,gender,milliliters,usage);
 }
 public abstract bool CanDiscount(decimal amount);
 public void UpdateCapitalAmount(long memid, decimal amount, decimal freezeAmount, decimal chargeAmount)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 public Variable(string name, decimal value)
 {
     Name  = name;
     Value = value;
     Type  = "decimal";
 }
 public Engineer(string id, string firstName, string lastName, decimal salary, Corps corp)
     : base(id, firstName, lastName, salary, corp)
 {
     this.repairs = new List <IRepair>();
 }
        public void AddCapital(CapitalDetailModel model)
        {
            decimal?      nullable;
            decimal?      nullable1;
            decimal?      nullable2;
            CapitalInfo   capitalInfo   = context.CapitalInfo.FirstOrDefault((CapitalInfo e) => e.MemId == model.UserId);
            decimal       num           = new decimal(0);
            decimal       num1          = new decimal(0);
            decimal       amount        = new decimal(0);
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(model.Remark);
            stringBuilder.Append(" ");
            stringBuilder.Append(model.PayWay);
            switch (model.SourceType)
            {
            case CapitalDetailInfo.CapitalDetailType.ChargeAmount:
            {
                decimal amount1 = model.Amount;
                num1 = amount1;
                num  = amount1;
                break;
            }

            case CapitalDetailInfo.CapitalDetailType.WithDraw:
            {
                amount = model.Amount;
                break;
            }

            default:
            {
                num = model.Amount;
                break;
            }
            }
            if (capitalInfo == null)
            {
                CapitalInfo capitalInfo1 = new CapitalInfo()
                {
                    MemId        = model.UserId,
                    Balance      = new decimal?(num),
                    ChargeAmount = new decimal?(num1),
                    FreezeAmount = new decimal?(amount)
                };
                List <CapitalDetailInfo> capitalDetailInfos = new List <CapitalDetailInfo>();
                CapitalDetailInfo        capitalDetailInfo  = new CapitalDetailInfo()
                {
                    Id         = CreateCode(model.SourceType),
                    Amount     = num,
                    CreateTime = new DateTime?(DateTime.Parse(model.CreateTime)),
                    SourceType = model.SourceType,
                    SourceData = model.SourceData,
                    Remark     = stringBuilder.ToString()
                };
                capitalDetailInfos.Add(capitalDetailInfo);
                capitalInfo1.Himall_CapitalDetail = capitalDetailInfos;
                capitalInfo = capitalInfo1;
                context.CapitalInfo.Add(capitalInfo);
            }
            else if (context.CapitalDetailInfo.FirstOrDefault((CapitalDetailInfo e) => e.Id == model.Id && e.Id != 0) == null)
            {
                CapitalDetailInfo capitalDetailInfo1 = new CapitalDetailInfo()
                {
                    Id         = CreateCode(model.SourceType),
                    Amount     = model.Amount,
                    CreateTime = new DateTime?(DateTime.Parse(model.CreateTime)),
                    CapitalID  = capitalInfo.Id,
                    SourceType = model.SourceType,
                    SourceData = model.SourceData,
                    Remark     = stringBuilder.ToString()
                };
                context.CapitalDetailInfo.Add(capitalDetailInfo1);
                CapitalInfo capitalInfo2 = capitalInfo;
                decimal?    balance      = capitalInfo2.Balance;
                decimal     num2         = num;
                if (balance.HasValue)
                {
                    nullable = new decimal?(balance.GetValueOrDefault() + num2);
                }
                else
                {
                    nullable = null;
                }
                capitalInfo2.Balance = nullable;
                CapitalInfo capitalInfo3 = capitalInfo;
                decimal?    chargeAmount = capitalInfo3.ChargeAmount;
                decimal     num3         = num1;
                if (chargeAmount.HasValue)
                {
                    nullable1 = new decimal?(chargeAmount.GetValueOrDefault() + num3);
                }
                else
                {
                    nullable1 = null;
                }
                capitalInfo3.ChargeAmount = nullable1;
                CapitalInfo capitalInfo4 = capitalInfo;
                decimal?    freezeAmount = capitalInfo4.FreezeAmount;
                decimal     num4         = amount;
                if (freezeAmount.HasValue)
                {
                    nullable2 = new decimal?(freezeAmount.GetValueOrDefault() + num4);
                }
                else
                {
                    nullable2 = null;
                }
                capitalInfo4.FreezeAmount = nullable2;
            }
            context.SaveChanges();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TypePerceelnummerVerschuiving" /> class.
 /// </summary>
 /// <param name="deltax">Verschuiving op de X as..</param>
 /// <param name="deltay">Verschuiving op de Y as..</param>
 public TypePerceelnummerVerschuiving(decimal deltax = default(decimal), decimal deltay = default(decimal))
 {
     this.Deltax = deltax;
     this.Deltay = deltay;
 }
Esempio n. 13
0
 public LoanAccount(Customer customer, decimal balance, decimal interest)
     : base(customer, balance, interest)
 {
 }
        private void LiveChartReceiptPage_Load(object sender, RoutedEventArgs e)
        {
            ValueRevenue.Clear();
            ValueExpense.Clear();
            Average1.Clear();
            Average2.Clear();
            decimal totalReceipt   = 0;
            decimal totalOrder     = 0;
            var     receiptList    = _unitofwork.ReceiptNoteRepository.Get();
            decimal AverageReceipt = 0;

            if (receiptList != null && receiptList.Any())
            {
                foreach (var n in receiptList)
                {
                    totalReceipt += n.TotalAmount;
                }
                AverageReceipt = totalReceipt / (receiptList.Count());
            }

            var     OrderList   = _unitofwork.OrderRepository.Get();
            decimal AveragOrder = 0;

            if (OrderList != null && OrderList.Any())
            {
                foreach (var n in OrderList)
                {
                    totalOrder += n.TotalPrice;
                }
                AveragOrder = totalOrder / (OrderList.Count());
            }



            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);
            Average1.Add(AverageReceipt);

            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);
            Average2.Add(AveragOrder);


            loadDataExpense(_unitofwork, ValueExpense);
            loadDataRevenue(_unitofwork, ValueRevenue);
        }
 public static decimal Resta(this Functions funct, decimal a, decimal b)
 {
     return a - b;
 }
Esempio n. 16
0
 public HistDataLine(DateTime time, decimal open, decimal high, decimal low, decimal close, decimal volume, decimal basevol)
 {
     T = time;
     O = open;
     H = high;
     L = low;
     C = close;
     V = volume;
     BV = basevol;
 }
Esempio n. 17
0
        public async Task Handle_invalid_item(string productCodigo, string productNome, int productQuantity, decimal productUnitPrice)
        {
            //arrange
            CancellationToken  token   = default(CancellationToken);
            CreateOrderCommand command = new CreateOrderCommand(new List <CreateOrderCommandItem>
            {
                new CreateOrderCommandItem(productCodigo, productNome, productQuantity, productUnitPrice)
            }
                                                                , "customerId", "customerName", "*****@*****.**", "phone", "address", "additionalAddress", "district", "city", "state", "12345-678");
            IdentifiedCommand <CreateOrderCommand, bool> request = new IdentifiedCommand <CreateOrderCommand, bool>(command, Guid.NewGuid());
            var handler = new CreateOrderCommandHandler(loggerMock.Object, orderRepositoryMock.Object, busMock.Object, configurationMock.Object);

            //act
            //assert
            await Assert.ThrowsAsync <InvalidItemException>(async() => await handler.Handle(request, token));
        }
Esempio n. 18
0
 public BussinesTripProvider(decimal price)
 {
     Price = price;
 }
 public IToothpaste CreateToothpaste(string name, string brand, decimal price, GenderType gender, IList<string> ingredients)
 {
     return new Toothpaste(name,brand,price,gender,ingredients);
 }
Esempio n. 20
0
        public async Task Post(decimal money, int userid)
        {
            await _chooser.GetRendomGift(money, userid);
            await _unitOfWorks.Save();

        }
 public abstract decimal Discount(decimal amount);
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FormatTest" /> class.
 /// </summary>
 /// <param name="integer">integer.</param>
 /// <param name="int32">int32.</param>
 /// <param name="int64">int64.</param>
 /// <param name="number">number (required).</param>
 /// <param name="_float">_float.</param>
 /// <param name="_double">_double.</param>
 /// <param name="_decimal">_decimal.</param>
 /// <param name="_string">_string.</param>
 /// <param name="_byte">_byte (required).</param>
 /// <param name="binary">binary.</param>
 /// <param name="date">date (required).</param>
 /// <param name="dateTime">dateTime.</param>
 /// <param name="uuid">uuid.</param>
 /// <param name="password">password (required).</param>
 /// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
 /// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
 public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
 {
     this.Number = number;
     // to ensure "_byte" is required (not null)
     this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null");
     this.Date = date;
     // to ensure "password" is required (not null)
     this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null");
     this.Integer = integer;
     this.Int32 = int32;
     this.Int64 = int64;
     this.Float = _float;
     this.Double = _double;
     this.Decimal = _decimal;
     this.String = _string;
     this.Binary = binary;
     this.DateTime = dateTime;
     this.Uuid = uuid;
     this.PatternWithDigits = patternWithDigits;
     this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
 }
 public override decimal Discount(decimal amount)
 {
     throw new InvalidOperationException();
 }
Esempio n. 24
0
        /// <summary>
        /// 把秒转换成分钟,往小取整
        /// </summary>
        /// <param name="Second">秒</param>
        /// <returns>分钟</returns>
        public static int SecondToMinute(int Second)
        {
            decimal mm = (decimal)((decimal)Second / (decimal)60);

            return(Convert.ToInt32(Math.Ceiling(mm)));
        }
 public override decimal Discount(decimal amount)
 {
     return ratio * amount;
 }
Esempio n. 26
0
 public Product(string name, decimal purchasePrice)
 {
     Name          = name;
     PurchasePrice = purchasePrice;
 }
 public override bool CanDiscount(decimal amount)
 {
     return amount > minimumAmount;
 }
 public static decimal Div(this Functions fn, decimal a, decimal b)
 {
     return a / b;
 }
Esempio n. 29
0
 public Mortgage(Customer customer, decimal initialBalance, decimal interestRate)
     : base(customer, initialBalance, interestRate)
 {
 }
Esempio n. 30
0
        public void BasicAccountWithdrawRuleTest(string accountNumber, string name, decimal balance, AccountType type, decimal amount, decimal newBalance, bool expected)
        {
            IWithdraw withdraw = new BasicAccountWithdrawRule();
            Account   account  = new Account()
            {
                AccountNumber = accountNumber, Name = name, Balance = balance, Type = type
            };

            AccountWithdrawResponse response = withdraw.Withdraw(account, amount);

            Assert.AreEqual(expected, response.Success);
            Assert.AreEqual(newBalance, response.Account.Balance);
        }