Ejemplo n.º 1
0
        private void Button2_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(textBox6.Text) && !String.IsNullOrEmpty(textBox7.Text))
            {
                AdresseDto adresse = _adressesService.GetAdresses().Where(c => c.Id == Convert.ToInt32(comboBoxAdresses.SelectedValue)).FirstOrDefault();

                ClientDto client = new ClientDto();
                client.Nom     = textBox6.Text;
                client.Prenom  = textBox7.Text;
                client.Adresse = adresse;

                _clientsService.CreateNewClient(client);

                textBox6.ResetText();
                textBox7.ResetText();

                this.UpdateDataGrid();
            }
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> CreateNewClient(ClientsDto client)
 {
     return(await Task.Run(() => CallApi(() => _clientsService.CreateNewClient(client))));
 }