示例#1
0
        // GET api/values
        public List <ClientViewModel> GetUsers()
        {
            IEnumerable <Client>   clients = _clientApp.GetAll();
            List <ClientViewModel> list    = Mapper.Map <List <ClientViewModel> >(clients);

            return(list);
        }
示例#2
0
        public ActionResult Index()
        {
            Client          client1 = _clientApp.GetAll().FirstOrDefault();
            ClientViewModel list2   = Mapper.Map <ClientViewModel>(client1);


            IEnumerable <Client>   clients = _clientApp.GetAll();
            List <ClientViewModel> list    = Mapper.Map <List <ClientViewModel> >(clients);

            //var clientViewModel = _clientApp.GetAll();

            return(View());
        }
        // GET: Client
        public ActionResult Index()
        {
            var clients          = _serviceApp.GetAll();
            var clientsViewModel = _mapper.Map <IEnumerable <ClientViewModel> >(clients);

            return(View(clientsViewModel));
        }
        public IActionResult GetAll()
        {
            var clients      = clientService.GetAll();
            var clientsModel = mapper.Map <ICollection <ClientModel> >(clients);

            return(Ok(clientsModel));
        }
示例#5
0
        // GET: Clients
        public ActionResult Index()
        {
            var clientViewModel =
                Mapper.Map <IEnumerable <Client>, IEnumerable <ClientViewModel> >(_clientAppService.GetAll());

            return(View(clientViewModel));
        }
示例#6
0
        public async Task <ActionResult> Index()
        {
            var output = await _ClientAppService.GetAll();

            var model = new IndexViewModel(output.Items);

            return(View(model));
        }
示例#7
0
 public HttpResponseMessage Get()
 {
     try
     {
         var clients = _clientAppService.GetAll();
         return(Request.CreateResponse(HttpStatusCode.OK, clients));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
     }
 }
示例#8
0
        public async Task <IEnumerable <ClientViewModel> > GetClients()
        {
            var clients = await clientAppService.GetAll();

            return(clients);
        }
 // GET: Product/Create
 public ActionResult Create()
 {
     ViewBag.ClientId = new SelectList(_clientApp.GetAll(), "Id", "FirstName");
     return(View());
 }
示例#10
0
        public Task <HttpResponseMessage> GetClients()
        {
            HttpResponseMessage response = new HttpResponseMessage();

            try
            {
                var clients = Mapper.Map <IEnumerable <Client>, IEnumerable <ClientViewModel> >(_service.GetAll());
                response = Request.CreateResponse(HttpStatusCode.OK, clients);
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
            }

            var tsc = new TaskCompletionSource <HttpResponseMessage>();

            tsc.SetResult(response);
            return(tsc.Task);
        }
示例#11
0
 public ActionResult Index()
 {
     return(View(_clientAppService.GetAll()));
 }
示例#12
0
        // GET: Sp/Clients
        public ActionResult Index(DateTime?birthDay, string cpf = "")
        {
            var clients = Mapper.Map <IEnumerable <Client>, IEnumerable <ClientViewModel> >(_clientAppService.GetAll());

            clients = clients
                      .Where(c =>
                             (birthDay != null ? c.BirthDay == birthDay : true) &&
                             (!string.IsNullOrEmpty(cpf) ? c.Cpf.Contains(cpf) : true)
                             );
            ObjIndex obj = new ObjIndex();

            obj.Cpf      = cpf;
            obj.BirthDay = birthDay;
            obj.Clients  = clients;
            return(View(obj));
        }
示例#13
0
 // GET: api/Clients
 public IEnumerable <ClientViewModel> Get()
 {
     return(_clientAppService.GetAll());
 }
示例#14
0
 public async Task <IActionResult> GetAll()
 {
     try
     {
         return(Ok(ResponceViewModel <IEnumerable <ClientViewModel> > .GenerateRepsonce(await appService.GetAll())));
     }
     catch (Exception ex)
     {
         logger.LogError($"Exception thrown in get all clients: {ex}");
         return(BadRequest(ResponceViewModel <string> .GenerateError($"Get all clients failed. {ex.Message}")));
     }
 }
示例#15
0
 // GET: Product/Create
 public ActionResult Create()
 {
     ViewBag.ClientID = new SelectList(_clientApp.GetAll(), nameof(Client.ClientID), nameof(Client.Name));
     return(View());
 }
示例#16
0
        public async Task <IActionResult> Index()
        {
            var clients = await clientAppService.GetAll();

            return(View(clients));
        }