示例#1
0
        public JsonResult JsonDelete(Guid id)
        {
            try
            {
                RemoveFromQueue(id);

                var request = new GetPropertiesRequest();
                var queue = _cookieStorageService.Retrieve<QueueViewModel>("ws");

                request.Ids = queue.QueuedItems.Where(x => x.Id != id).Select(x => x.Id);

                GetPropertiesResponse<MultipleFamilyViewModel> response = _multipleFamilyService.GetProperties(request);

                if (!response.Success)
                {
                    TempData["message"] = response.Message;
                    return Json(TempData["message"]);
                }

                QueueResultViewModel viewModel = GetQueueResultViewFrom(response);

                return Json(viewModel);
            }
            catch
            {
                return Json(null);
            }
        }
示例#2
0
        //
        // GET: /Queue/
        public ActionResult Index()
        {
            var request = new GetPropertiesRequest();

            var queue = _cookieStorageService.Retrieve<QueueViewModel>("ws");

            if (queue != null)
            {
                request.Ids = queue.QueuedItems.Select(x => x.Id);
            }

            GetPropertiesResponse<MultipleFamilyViewModel> response = _multipleFamilyService.GetProperties(request);

            if (!response.Success)
            {
                TempData["message"] = response.Message;
                return View();
            }

            QueueResultViewModel viewModel = GetQueueResultViewFrom(response);

            return View(viewModel);
        }