Ejemplo n.º 1
0
        public IActionResult GetAll(Customers customers)
        {
            var result = _customersService.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult GetAll()
        {
            Thread.Sleep(3000);
            var result = _customersService.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result.Message));
        }
 public IActionResult GetAllCustomers()
 {
     try
     {
         return(Ok(customersService.GetAll()));
     }
     catch (Exception e)
     {
         log.LogError(e.Message + "\nin:" + e.StackTrace);
         return(Problem(null));
     }
 }
 public ActionResult getAllCustomer()
 {
     try
     {
         List <Customers> customers = _customersService.GetAll().ToList();
         return(Ok(customers));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
        public IActionResult TestCustomers()
        {
            var result = _customersService.GetAll();

            return(new JsonResult(result));
        }
Ejemplo n.º 6
0
 public IEnumerable <ICustomerModel> Get()
 {
     return(_customerService.GetAll());
 }
Ejemplo n.º 7
0
        public async Task <IWrappedResponse> Get()
        {
            var user = _userRepo.FindAll()
                       .ProjectTo <User>(Mapper.ConfigurationProvider)
                       .SingleOrDefault();

            var isNotDplEmployee = AuthData.GetUserRole() != Common.Enumerations.UserRole.DplEmployee;

            if (!isNotDplEmployee)
            {
                user.Role = Common.Enumerations.UserRole.DplEmployee;
            }

            var customersServiceResponse = (IWrappedResponse <IEnumerable <Customer> >) await _customersService.GetAll();

            var customers = isNotDplEmployee ? customersServiceResponse.Data : new Customer[] { };
            var postingAccountsServiceResponse = (IWrappedResponse <IEnumerable <PostingAccount> >) await _postingAccountsService.GetAll();

            var postingAccounts = isNotDplEmployee ? postingAccountsServiceResponse.Data : new PostingAccount[] { };
            var permssions      = isNotDplEmployee ? await _permissionsService.GetPermissions() : new UserPermission[]
            {
            };

            user.Customers       = customers;
            user.PostingAccounts = postingAccounts;
            user.Permissions     = permssions;

            return(Ok(user));
        }
Ejemplo n.º 8
0
        public ActionResult All(string order)
        {
            IEnumerable <CustomerViewModel> customers = service.GetAll(order);

            return(this.View(customers));
        }
Ejemplo n.º 9
0
        public IActionResult Get()
        {
            var result = _customersService.GetAll();

            return(Ok(result));
        }
Ejemplo n.º 10
0
 public IActionResult GetAll()
 {
     return(Ok(customerService.GetAll()));
 }
Ejemplo n.º 11
0
 public Task <ActionResult <IEnumerable <Customer> > > Get()
 {
     return(_customersService.GetAll().Convert <IEnumerable <Customer> >(this));
 }
Ejemplo n.º 12
0
        public async Task <IActionResult> Get(CancellationToken cancellationToken = default)
        {
            var customers = await _customersService.GetAll(cancellationToken);

            return(Ok(customers));
        }
Ejemplo n.º 13
0
 public List <CustomersVM> getAll()
 {
     return(customerService.GetAll());
 }