コード例 #1
0
        public ActionResult Export(Guid id)
        {
            var assessment = Db.Assessments.SingleOrDefault(x => x.Id == id);

            var model = new AssessmentStageCreateModel
            {
                AssessmentId = assessment.Id,
                Name         = assessment.Name,
            };

            return(View(model));
        }
コード例 #2
0
        public ActionResult EditStage(AssessmentStageCreateModel model)
        {
            var stage = Db.AssessmentStages.SingleOrDefault(x => x.Id == model.StageId);

            stage.Name              = model.Name;
            stage.Description       = model.Description;
            stage.OpeningDateTime   = DateTime.Parse(model.Start);
            stage.ClosingDateTime   = DateTime.Parse(model.End);
            stage.ReportingDateTime = DateTime.Parse(model.Publish);
            stage.IsAvailable       = model.IsAvailable;

            Db.SaveChanges();


            return(RedirectToAction("Details", new { id = model.AssessmentId }));
        }
コード例 #3
0
        public ActionResult CreateStage(Guid id)
        {
            var assessment = Db.Assessments.SingleOrDefault(x => x.Id == id);

            var model = new AssessmentStageCreateModel
            {
                AssessmentId = assessment.Id,
                Name         = "Neue Stufe",
                Description  = "",
                Start        = DateTime.Now.ToString(),
                End          = DateTime.Now.ToString(),
                Publish      = DateTime.Now.ToString(),
                IsAvailable  = false
            };

            return(View(model));
        }
コード例 #4
0
        public ActionResult EditStage(Guid id)
        {
            var stage = Db.AssessmentStages.SingleOrDefault(x => x.Id == id);

            var model = new AssessmentStageCreateModel
            {
                AssessmentId = stage.Assessment.Id,
                StageId      = stage.Id,
                Name         = stage.Name,
                Description  = stage.Description,
                Start        = stage.OpeningDateTime.ToString(),
                End          = stage.ClosingDateTime.ToString(),
                Publish      = stage.ReportingDateTime.ToString(),
                IsAvailable  = stage.IsAvailable
            };

            return(View(model));
        }