Exemplo n.º 1
0
        public IActionResult UpdateCliente(UpdateClienteViewModel model)
        {
            Client c**t = new Client(model.clt_Id, model.clt_RagioneSociale, model.clt_Indirizzo, model.clt_Mail, model.clt_Telefono, model.clt_Mobile);

            this._data.UpdateCliente(c**t);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public IActionResult UpdateCliente(int clt_Id)
        {
            var c**t = this._data.GetClient(clt_Id);

            if (c**t == null)
            {
                return(NotFound());
            }
            var model = new UpdateClienteViewModel();

            model.clt_Id             = clt_Id;
            model.clt_RagioneSociale = c**t.clt_RagioneSociale;
            model.clt_Indirizzo      = c**t.clt_Indirizzo;
            model.clt_Telefono       = c**t.clt_Telefono;
            model.clt_Mobile         = c**t.clt_Mobile;
            model.clt_Mail           = c**t.clt_Mail;
            return(PartialView(model));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Update([FromBody] UpdateClienteViewModel cliente)
        {
            await _clienteAppService.UpdateAsync(cliente);

            return(Ok());
        }
        public async Task <ValidationResult> UpdateAsync(UpdateClienteViewModel clienteViewModel)
        {
            var updateCommand = _mapper.Map <UpdateClienteCommand>(clienteViewModel);

            return(await _mediator.SendCommand(updateCommand));
        }