private async Task <int> SaveOrderServices(double sum)
        {
            OrderServicesCarWashBll orderServices = new OrderServicesCarWashBll();

            orderServices.StatusOrder  = 1;
            orderServices.PaymentState = 3;

            orderServices.OrderDate = DateTime.Now;
            orderServices.TotalCostOfAllServices = sum;
            orderServices.DiscountPrice          = sum;
            orderServices.typeOfOrder            = (int)TypeService.DryCleaningKohler;

            return(await _orderServices.CreateOrder(orderServices));
        }
        public async Task <int> SaveOrderTireFitting(double Total, double TotalDiscontClient, int idPaymentState, int idStatusOrder, int?Client, int typeOfOrder)
        {
            OrderServicesCarWashBll orderservices = new OrderServicesCarWashBll();

            orderservices.IdClientsOfCarWash     = Client != null ? Client : null;
            orderservices.StatusOrder            = idStatusOrder;
            orderservices.PaymentState           = idPaymentState;
            orderservices.OrderDate              = DateTime.Now;
            orderservices.TotalCostOfAllServices = Total;
            orderservices.DiscountPrice          = TotalDiscontClient;
            orderservices.typeOfOrder            = typeOfOrder;

            if (idPaymentState != 3 && idStatusOrder != 1)
            {
                orderservices.ClosingData = DateTime.Now;
            }

            return(await _orderServices.CreateOrder(orderservices));
        }
Exemplo n.º 3
0
        public async Task <int> OrderForCarpetCleaning(OrderCarpetWashingBll orderCarpetWashing, int?idPaymentState, int prise, int clientId)
        {
            double?sumOrder      = orderCarpetWashing.area * (double)prise;
            var    resultClients = await _clientsOfCarWashServices.ClientWhereToInfoClient(clientId);

            OrderServicesCarWashBll orderservices = new OrderServicesCarWashBll();

            if (resultClients != null)
            {
                orderservices = new OrderServicesCarWashBll
                {
                    StatusOrder            = 1,
                    OrderDate              = orderCarpetWashing.orderDate,
                    IdClientsOfCarWash     = resultClients.id,
                    TotalCostOfAllServices = sumOrder,
                    DiscountPrice          = sumOrder,
                    typeOfOrder            = 3,
                    PaymentState           = idPaymentState
                };
            }
            else
            {
                orderservices = new OrderServicesCarWashBll
                {
                    StatusOrder            = 1,
                    OrderDate              = orderCarpetWashing.orderDate,
                    IdClientsOfCarWash     = null,
                    TotalCostOfAllServices = sumOrder,
                    DiscountPrice          = sumOrder,
                    typeOfOrder            = 3,
                    PaymentState           = idPaymentState
                };
            }


            return(await _orderServicesCarWash.CreateOrder(orderservices));
        }