Example #1
0
        private IEnumerable <SumOfAmountOutgoingType> PrepereSumOfAmountInTypes(IEnumerable <Outgoing> outgoings, string userId)
        {
            var tempSumOfAmount = new List <SumOfAmountOutgoingType>();

            foreach (var outgoingType in _typeOfOutgoingService.GetTypeOfOutgoings(userId))
            {
                var tempSum = new SumOfAmountOutgoingType
                {
                    TypeOfOutgoing = outgoingType,
                    Sum            = outgoings.Where(x => x.TypeId.Equals(outgoingType.Id)).Sum(x => x.Amount)
                };
                tempSumOfAmount.Add(tempSum);
            }

            return(tempSumOfAmount);
        }
 public virtual ActionResult GetTypeOfOutgoings()
 {
     return(Json(_typeOfOutgoingService.GetTypeOfOutgoings(_idLoggedUser), JsonRequestBehavior.AllowGet));
 }