public void SaveClient(Client client) { ClientServices clientServices = new ClientServices(); clientServices.AddClient(client); clients.Add(client); }
public ActionResult Index(ClientModel model) { if (ModelState.IsValid) { ClientServices.AddClient(model); return(RedirectToAction("TicketView")); } return(View(model)); }
public ActionResult <ClientConfirmationDto> AddClient(ClientCreationDto client) { try { var createdClient = ClientServices.AddClient(client); string location = LinkGenerator.GetPathByAction("GetClientById", "Client", new { createdClient.Id }); return(Created(location, createdClient)); } catch (ValidationException) { return(BadRequest()); } }
public void Post([FromBody] Cliente cliente) { try { var clienteService = new ClientServices(); { clienteService.AddClient(cliente); } } catch (Exception e) { throw e; } }
private async void ExecuteSaveAsync() { if (AccountStart == null || NewClient.Name == null) { return; } if (_clientServ.GetClient(_newClient.Name) != null) { await _currentWindow.ShowMessageAsync("فشل الإضافة", "هذاالعميل موجود مسبقاً", MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = "موافق", DialogMessageFontSize = 25, DialogTitleFontSize = 30 }); } else { if (_accountStartType == true) { _newClient.AccountStart = _accountStart; } else { _newClient.AccountStart = -_accountStart; } _clientServ.AddClient(_newClient); _namesSuggestions.Add(_newClient.Name); _addressSuggestions.Add(_newClient.Address); clients.Add(_newClient); NewClient = new Client(); AccountStart = null; await _currentWindow.ShowMessageAsync("نجاح الإضافة", "تم الإضافة بنجاح", MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = "موافق", DialogMessageFontSize = 25, DialogTitleFontSize = 30 }); } }
public ActionResult ClientRegister(Client Newclient) { if (ModelState.IsValid) { var isExist = em.ClintEmail(Newclient.Email); if (isExist) { ModelState.AddModelError("EmailExist", "Email already exist"); return(View(Newclient)); } else { cs.AddClient(Newclient); return(Redirect("/Admin/allCliernts")); } } return(View(Newclient)); }
public ActionResult CreateAccount(Client Newclient) { if (ModelState.IsValid) { var isExist = em.ClintEmail(Newclient.Email); if (isExist) { ModelState.AddModelError("EmailExist", "Email already exist"); return(View(Newclient)); } else { cl.AddClient(Newclient); return(RedirectToAction("Index")); } } return(View(Newclient)); }
public void addClient(Client client) { _clientServices.AddClient(client); }
public IHttpActionResult PostClient([FromBody] ClientDTO client) { //System.Diagnostics.Debug.WriteLine("This is my messaageeeeee "+client.firstname+" " + client.lastname); return(Ok(clientSevices.AddClient(client))); }