예제 #1
0
        public async Task <EmployeeSalariesBll> EmployeeSalaries(DateTime?startDate)
        {
            var orderCarWashWorker = await _orderCarWashWorkers.Reports(startDate.Value);

            var brigade = await _brigadeForToday.Reports(startDate.Value);

            return(AccruedSalaries(orderCarWashWorker, brigade));
        }
예제 #2
0
        public async Task <ActionResult> CompletedEmployeeOrders(DateTime start, DateTime?finlDate, int?idEmployee, string Name)
        {
            List <DateTime> dateTimesGrups = new List <DateTime>();

            if (finlDate != null)
            {
                for (DateTime date = start.Date; date <= finlDate.Value.Date; date = date.AddDays(1.0))
                {
                    dateTimesGrups.Add(date);
                }
            }
            else
            {
                dateTimesGrups.Add(start.Date);
            }

            var result = Mapper.Map <IEnumerable <OrderCarWashWorkersView> >(await _orderCarWashWorkers.Reports(start));
            var resultOrderGetEmployee = result.Where(x => x.IdCarWashWorkers == idEmployee);
            var resultSum   = resultOrderGetEmployee.Sum(x => x.OrderServicesCarWash.DiscountPrice).Value;
            var resultCount = resultOrderGetEmployee.Count();

            OrderInformation orderInformation = new OrderInformation(resultOrderGetEmployee, "", Name, resultCount, resultSum, start, finlDate);

            ViewBag.ExpensesDate = dateTimesGrups;

            return(View(orderInformation));
        }
예제 #3
0
        public async Task <IEnumerable <DayResultModelBll> > DayResultViewInfo()
        {
            //  var resultGetInclud = await _orderCarWashWorkersServices.GetClosedDay();
            var resultGetInclud = await _orderCarWashWorkersServices.Reports(DateTime.Now);

            return(resultGetInclud.GroupBy(x => x.IdCarWashWorkers)
                   .Select(y => new DayResultModelBll
            {
                carWashWorkersId = y.First().CarWashWorkers.id,
                orderCount = y.Count(),
                surname = y.First().CarWashWorkers.Surname,
                name = y.First().CarWashWorkers.Name,
                patronymic = y.First().CarWashWorkers.Patronymic,
                calculationStatus = y.First().CalculationStatus,
                payroll = y.Sum(s => s.Payroll),
                salaryDate = test(y.First().salaryDate)
            }));
        }
예제 #4
0
        // Проверить надобность и удалить
        public async Task <ActionResult> PaymentForTheCompletedOrder(int?idCarWash, DateTime?date)
        {
            if (idCarWash != null && date != null)
            {
                return(View(Mapper.Map <IEnumerable <OrderCarWashWorkersView> >(await _orderCarWashWorkers.Reports(idCarWash.Value, date.Value))));
            }

            return(RedirectToAction("ShiftInformation"));
        }
        public async Task <ActionResult> CompletedOrdersOfOneEmployee(int?idEmploee)
        {
            if (idEmploee != null)
            {
                var carWashWorkersDayTotal = Mapper.Map <IEnumerable <OrderCarWashWorkersView> >(await _orderCarWashWorker.Reports(idEmploee.Value, DateTime.Now));

                ViewBag.CarWashWorker = Mapper.Map <CarWashWorkersView>(await _carWashWorkers.CarWashWorkersId(idEmploee));
                ViewBag.SumOrder      = carWashWorkersDayTotal.Sum(x => x.Payroll);
                ViewBag.Sum           = carWashWorkersDayTotal.Sum(x => x.OrderServicesCarWash.DiscountPrice);

                return(View(carWashWorkersDayTotal));
            }

            return(View());
        }
 public async Task <IEnumerable <OrderCarWashWorkersBll> > AnalyticsWages(DateTime date) =>
 await _orderCarWashWorkers.Reports(date);