예제 #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));
        }
예제 #4
0
        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));
        }