Пример #1
0
        private async Task <ActionResult> ShowMasterClaimList(int projectId, string export, string title,
                                                              [AspMvcView] string viewName, IReadOnlyCollection <Claim> claims)
        {
            var error = await AsMaster(claims, projectId);

            if (error != null)
            {
                return(error);
            }

            var view = new ClaimListViewModel(CurrentUserId, claims, projectId);

            var exportType = GetExportTypeByName(export);

            if (exportType == null)
            {
                ViewBag.MasterAccessColumn = true;
                ViewBag.Title = title;
                return(View(viewName, view));
            }
            else
            {
                var project = await GetProjectFromList(projectId, claims);

                return
                    (await
                     ExportWithCustomFronend(view.Items, title, exportType.Value,
                                             new ClaimListItemViewModelExporter(project.ProjectFields, UriService), project.ProjectName));
            }
        }
        public ActionResult ClaimList()
        {
            var claimListDomainModel = _claimService.GetAllActive();
            var claimListViewModel   = new ClaimListViewModel(claimListDomainModel);

            return(View(claimListViewModel));
        }
Пример #3
0
        public ActionResult ClaimList(int projectId, string button, ClaimListViewModel vm, FormCollection input)
        {
            var uploadId = AppHelper.GetSessionUploadId(Session);

            return(button == "more" ? RedirectToAction("Create", "Sample", new { id = projectId })
                                : RedirectToAction("Details", "Upload", new { id = uploadId }));
        }
Пример #4
0
        public async Task <ActionResult> My(string?export)
        {
            var user = await GetCurrentUserAsync();

            var title = "Мои заявки";

            ViewBag.Title = title;

            var viewModel = new ClaimListViewModel(
                CurrentUserId,
                user.Claims.ToList(),
                projectId: null,
                showCount: false,
                showUserColumn: false);

            var exportType = ExportTypeNameParserHelper.ToExportType(export);

            if (exportType == null)
            {
                return(base.View("Index", viewModel));
            }
            else
            {
                return(await ExportWithCustomFrontend(
                           viewModel.Items,
                           title,
                           exportType.Value,
                           new MyClaimListItemViewModelExporter(UriService),
                           user.PrefferedName));
            }
        }
Пример #5
0
        public ActionResult ClaimList(string sessionKey, int id, DateTime due)
        {
            var project = PatService.GetProject(id);
            var vm      = new ClaimListViewModel {
                SessionKey = sessionKey, ProjectId = id, ProjectName = project.ProjectName, DueDate = due
            };

            //  display it for selection and or submission
            //  generate a scrollable grid
            ViewData["grid"]   = GenerateSampleGrid(sessionKey);
            ViewBag.Selections = PatService.GetSampleSelections(sessionKey);
            return(View(vm));
        }