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)); }
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(); }
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)); }
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)); }
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)); }
// 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)); }
// 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)); }
//----------------------------------------------- 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)); }
private void OpenClientDetails() { ClientInfoView clientInfo = new ClientInfoView(); clientInfo.Show(); }