Exemplo n.º 1
0
        public async Task <CorpClient> Update(UpdateCorpClient model)
        {
            var entity = context.CorpClients.Find(model.CorpClientId);

            entity.DBAName        = model.DbaName;
            entity.Currency       = model.Currency;
            entity.Name           = model.Name;
            entity.CustomerTypeId = model.CustomerTypeId;
            entity.Mobile         = model.Mobile;
            entity.Email          = model.Email;
            if (model.CustomerTypeId == 1)
            {
                entity.CPF  = model.SocialIdentifier;
                entity.CNPJ = null;
            }
            else
            {
                entity.CNPJ = model.SocialIdentifier;
                entity.CPF  = null;
            }
            context.Update(entity);
            var rows = await context.SaveChangesAsync();

            return(mapper.Map <CorpClient>(entity));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <CorpClient> > Update(UpdateCorpClient model)
        {
            var data = await service.Update(model);

            if (data != null)
            {
                return(Ok(data));
            }
            return(new StatusCodeResult(304));
        }
Exemplo n.º 3
0
 public async Task <CorpClient> Update(UpdateCorpClient model)
 {
     return(await corpClientRepository.Update(model));
 }
Exemplo n.º 4
0
 public async Task <CorpClient> Update(UpdateCorpClient model)
 {
     return(await corpClientApp.Update(model));
 }