コード例 #1
0
        public async Task <ActionResult> EditClient([Bind(Include = "id,Surname,Name,PatronymicName,Phone,DateRegistration,Email,barcode,note")] ClientInfoView client, int IdClient, int idCar, int?SelectGroupClient)
        {
            if (ModelState.IsValid)
            {
                ClientInfoView clientInfo = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(IdClient));
                clientInfo = client;

                ClientInfoBll clientInfoBll        = Mapper.Map <ClientInfoView, ClientInfoBll>(client);
                var           clientsOfCarWashView = Mapper.Map <IEnumerable <ClientsOfCarWashView> >(await _services.GetAll(idCar));

                foreach (var item in clientsOfCarWashView)
                {
                    item.IdClientsGroups = SelectGroupClient;

                    ClientsOfCarWashBll clients = Mapper.Map <ClientsOfCarWashView, ClientsOfCarWashBll>(item);
                    await _services.ClientCarUpdate(clients);
                }
                await _clientInfo.Update(clientInfoBll);

                return(RedirectToAction("Info", "ClientsOfCarWashViews", new RouteValueDictionary(new
                {
                    idClientInfo = idCar,
                    idClient = IdClient
                })));
            }

            ViewBag.Group = new SelectList(await _clientsGroups.GetClientsGroups(), "Id", "Name");
            return(View(client));
        }
コード例 #2
0
        private void ClientInfo_Click(object sender, RoutedEventArgs e)
        {
            ClientInfoView clientWindow = new ClientInfoView(currentUser.login);

            clientWindow.Show();
            clientWindow.Top    = this.Top;
            clientWindow.Left   = this.Left;
            clientWindow.Width  = this.Width;
            clientWindow.Height = this.Height;
            this.Close();
        }
コード例 #3
0
        public async Task <ActionResult> AddClient([Bind(Include = "Surname,Name,PatronymicName,Phone,DataFormatString,Email,note")] ClientInfoView client)
        {
            if (ModelState.IsValid)
            {
                ClientInfoBll clientInfo = Mapper.Map <ClientInfoView, ClientInfoBll>(client);
                await _clientInfo.Insert(clientInfo);

                return(RedirectToAction("ClientCarpetWashing"));
            }

            ViewBag.Group = new SelectList(await _clientsGroups.GetClientsGroups(), "Id", "Name");
            return(View(client));
        }
コード例 #4
0
        public async Task <ActionResult> EditClient(int?id)
        {
            if (id == null)
            {
                var infoLog = new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                return(RedirectToAction("Client"));
            }

            ClientInfoView clientInfo = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(id));

            ViewBag.IdClient = id;

            if (clientInfo == null)
            {
                return(HttpNotFound());
            }

            return(View(clientInfo));
        }
コード例 #5
0
        public async Task <ActionResult> EditClient([Bind(Include = "id,Surname,Name,PatronymicName,Phone,DateRegistration,Email,barcode,note")] ClientInfoView client, int idClient)
        {
            if (ModelState.IsValid)
            {
                ClientInfoView clientInfo = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(idClient));
                clientInfo = client;

                ClientInfoBll clientInfoBll = Mapper.Map <ClientInfoView, ClientInfoBll>(client);

                await _clientInfo.Update(clientInfoBll);

                return(RedirectToAction("ClientDetails", "ClientInfo", new RouteValueDictionary(new
                {
                    id = idClient
                })));
            }

            return(View(client));
        }
コード例 #6
0
        // GET: ClientInfo/Details/5
        public async Task <ActionResult> ClientDetails(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            ClientInfoView clientInfoView = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(id));
            var            clientCar      = Mapper.Map <IEnumerable <ClientsOfCarWashView> >(await _clientsOfCarWash.GetAll(id));

            if (clientCar != null)
            {
                ViewBag.ClientCar = clientCar;
            }

            if (clientInfoView == null)
            {
                return(HttpNotFound());
            }
            return(View(clientInfoView));
        }
コード例 #7
0
        // GET: OrderCarpetWashing/Edit/5
        public async Task <ActionResult> AboutOrder(int?idOrder, int?idClient, int?idPage)
        {
            if (idClient == null && idOrder == null)
            {
                var httpstatusCode = new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                return(RedirectToAction("OrderCarpetWashing"));
            }

            OrderCarpetWashingView orderCarpetWashingView = Mapper.Map <OrderCarpetWashingView>(await _orderCarpetWashingServices.SelectId(idOrder));
            ClientInfoView         clientInfoView         = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(idClient));

            var brigadeForToday = Mapper.Map <IEnumerable <BrigadeForTodayView> >(await _brigadeForToday.GetDateTimeNow());
            var orderServices   = Mapper.Map <OrderServicesCarWashView>(await _orderServicesCarWash.GetId(orderCarpetWashingView.orderServicesCarWashId));
            var test            = orderServices.OrderCarWashWorkers.FirstOrDefault(x => x.IdOrder == orderCarpetWashingView.orderServicesCarWashId);
            var getAllAdminDay  = Mapper.Map <IEnumerable <CarWashWorkersView> >(await _employeesFacade.ListOfEmployeesForService());

            ViewBag.Brigade      = Mapper.Map <IEnumerable <CarWashWorkersView> >(await _employeesFacade.ListOfEmployeesForService(3));
            ViewBag.Sum          = orderServices.DiscountPrice;
            ViewBag.BrigateOrder = test;
            ViewBag.ResultPay    = orderServices.PaymentState;

            ViewBag.TeamLead     = new SelectList(getAllAdminDay.Where(x => x.IdPosition <= 2), "id", "Name");
            ViewBag.Adminstrator = new SelectList(getAllAdminDay.Where(x => x.IdPosition == 4), "id", "Name");

            ViewBag.IdPage     = idPage;
            ViewBag.ClientInfo = clientInfoView;

            var paymentSate = Mapper.Map <IEnumerable <PaymentStateView> >(await _paymentState.GetTableAll());

            ViewBag.PaymentState       = new SelectList(paymentSate, "Id", "PaymentState1");
            ViewBag.PaymentStateResult = orderServices.PaymentState;
            ViewBag.ClientId           = idClient;

            if (orderCarpetWashingView == null)
            {
                return(HttpNotFound());
            }

            return(View(orderCarpetWashingView));
        }
コード例 #8
0
        //-----------------------------------------------

        public async Task <ActionResult> EditClient(int?id, int?idCar)
        {
            if (id == null && idCar == null)
            {
                var infoLog = new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                return(RedirectToAction("Client"));
            }

            ClientInfoView       clientInfo   = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(id));
            ClientsOfCarWashView clientsOfCar = Mapper.Map <ClientsOfCarWashView>(await _services.GetId(idCar));

            ViewBag.Group    = new SelectList(await _clientsGroups.GetClientsGroups(), "Id", "Name", clientsOfCar.IdClientsGroups);
            ViewBag.IdClient = id;
            ViewBag.IdCar    = idCar;

            if (clientInfo == null)
            {
                return(HttpNotFound());
            }

            return(View(clientInfo));
        }
コード例 #9
0
        private void OpenClientDetails()
        {
            ClientInfoView clientInfo = new ClientInfoView();

            clientInfo.Show();
        }