예제 #1
0
        public ActionResult Documents()
        {
            GetDocumentsQueryResult result = Query.For <GetDocumentsQueryResult>().With(new EmptyCriterion());
            DocumentsViewModel      vm     = ToViewModel(result);

            return(View(vm));
        }
예제 #2
0
        protected DocumentsViewModel ToViewModel(GetDocumentsQueryResult model)
        {
            DocumentsViewModel vm = Mapper.Map <DocumentsViewModel>(model.Documents);

            vm.FileUrl   = model.DocumentsLink;
            vm.FileName  = model.FileName;
            vm.UpdatedAt = DateTime.TryParse(vm.UpdatedAt, out DateTime date)
                ? date.ToShortDateString()
                : null;
            return(vm);
        }
예제 #3
0
        public ActionResult Index()
        {
            GetContactsMapQueryResult map         = Query.For <GetContactsMapQueryResult>().With(new EmptyCriterion());
            GetQuestionQueryResult    question    = Query.For <GetQuestionQueryResult>().With(new EmptyCriterion());
            GetDocumentsQueryResult   documents   = Query.For <GetDocumentsQueryResult>().With(new EmptyCriterion());
            GetKeepInTouchQueryResult keepInTouch = Query.For <GetKeepInTouchQueryResult>().With(new EmptyCriterion());

            IndexViewModel vm = new IndexViewModel
            {
                Map         = ToViewModel(map.Map),
                Documents   = ToViewModel(documents),
                Question    = ToViewModel(question.Question),
                KeepInTouch = ToViewModel(keepInTouch.KeepInTouch)
            };

            return(View(vm));
        }