Пример #1
0
        // GET: IRMA/LessonsLearned
        public ActionResult Index()
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.LessonLearned);
            var lessonsLearned = dataModel.GetAllItems().Cast <LessonLearnedModel>().ToList();

            return(View(lessonsLearned));
        }
Пример #2
0
        private void LessonLearnedViewBag(dynamic viewBag)
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.LessonLearnedType);
            IEnumerable <LessonLearnedType> types = dataModel.GetAllItems().Cast <LessonLearnedType>();

            viewBag.LessonTypes = types;
        }
Пример #3
0
        // GET: IRMA/Comments
        public ActionResult GetAllComments()
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.Comment);
            IEnumerable <CommentModel> comments = dataModel.GetAllItems().Cast <CommentModel>();

            foreach (CommentModel comment in comments)
            {
                UserModel user = ServiceSystem.GetUser((int)comment.CommenterPassport); // Populates position field
                comment.Position = (int)user.Position;
            }
            return(PartialView("GetAllComments", comments));
        }
Пример #4
0
        public ActionResult GetAllReviews()
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.Review);
            IEnumerable <ReviewModel> reviews = dataModel.GetAllItems().Cast <ReviewModel>();

            foreach (ReviewModel review in reviews)
            {
                review.Attachments = ServiceSystem.GetAttachments("Review", review.Id.ToString());
            }

            return(PartialView("GetAllReviews", reviews));
        }
Пример #5
0
        public PartialViewResult IndexLessonsGridView()
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.LessonLearned);
            var lessonsLearned = dataModel.GetAllItems().Cast <LessonLearnedModel>().ToList();

            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.LessonLearnedType);
            LessonLearnedViewBag(ViewBag);
            foreach (var lesson in lessonsLearned)
            {
                if (lesson.TypeId != null)
                {
                    lesson.Type = dataModel.GetItem(string.Format("Id={0}", lesson.TypeId), "Id");
                }
            }
            return(PartialView("IndexLessonsGridView", lessonsLearned));
        }