public void AtualizarCliente(Dominio.TbCliente cliente) { try { Message msg; var repo = new Repositorio.Models.Cliente(); msg = repo.EditarClienteService(cliente); if (msg.Resultado != TipoResultado.Sucesso) throw msg.Exception; } catch (BusinessException be) { BusinessFault bf = new BusinessFault(); bf.Titulo = "Erro de negócio"; bf.Mensagem = be.Message; bf.StackTrace = be.StackTrace; throw new FaultException<BusinessFault>(bf, bf.Titulo); } catch (Exception ex) { throw ex; } }
public TbCliente ObterClientePorId(int id) { MessageInstance<TbCliente> msg; var repo = new Repositorio.Models.Cliente(); msg = repo.ObterClientePorId(id); if (msg.Resultado != TipoResultado.Sucesso) throw msg.Exception; return msg.Instance; }
public List<TbCliente> ObterClientesIncompletos() { MessageCollection<TbCliente> msg; List<TbCliente> clientes = new List<TbCliente>(); var a = WebConfigurationManager.AppSettings["cliente"]; var repo = new Repositorio.Models.Cliente(); msg = repo.ObterClientesIncompletos(); clientes = msg.Instances.ToList(); return msg.Instances.ToList(); }