Exemple #1
0
        public IActionResult Index()
        {
            try
            {
                var viewModel = new ConnectRequestsViewModel
                {
                    ShowMultipleRequestsModal = true,
                    Requests = requestService.GetAllConnectActive()
                };

                return(View(viewModel));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemple #2
0
        public IActionResult Filter(string id)
        {
            try
            {
                var requestDb = requestService.GetById(id);
                var viewModel = new ConnectRequestsViewModel
                {
                    ShowMultipleRequestsModal = false,
                    Requests = requestService.FilterByTrailerId(requestDb.Trailer.Id)
                };

                return(PartialView("_ConnectRequestsTable", viewModel));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemple #3
0
        public IActionResult ConnectHistory()
        {
            try
            {
                var requestsList = requestService.GetConnectHistory().OrderBy(request => request.Date);
                var viewModel    = new ConnectRequestsViewModel
                {
                    AreRequestsActive = false,
                    Employees         = requestService.GetAllSenders(requestsList),
                    Requests          = requestsList
                };

                return(PartialView("_ConnectRequestsTable", viewModel));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemple #4
0
        public IActionResult ConnectRequestsTable()
        {
            try
            {
                var requestsList = requestService.GetAllConnectActive().ToList();

                var viewModel = new ConnectRequestsViewModel
                {
                    AreRequestsActive         = true,
                    ShowMultipleRequestsModal = true,
                    Employees = requestService.GetAllSenders(requestsList),
                    Requests  = requestsList.OrderBy(request => request.Date)
                };

                return(PartialView("_ConnectRequestsTable", viewModel));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }