コード例 #1
0
        public IActionResult AddMark(int id)
        {
            var model = new MarkProfileFullToAddViewModel
            {
                StudentId = id
            };

            return(this.View(model));
        }
コード例 #2
0
        [RequestSizeLimit(50 * 1024 * 1024)] //PT: By default is 30MB
        public IActionResult AddMark(MarkProfileFullToAddViewModel markProfileToAdd, int id)
        {
            var markProfileServiceModelToAdd = new MarkProfileFullServiceModel
            {
                StudentId    = id,
                SubjectId    = (int)markProfileToAdd.Subject,
                Title        = markProfileToAdd.Title,
                Comment      = markProfileToAdd.Comment,
                DateReceived = markProfileToAdd.DateReceived,
                TeacherId    = 25,
                ValueMark    = (int)markProfileToAdd.ValueMark,
            };

            this.markService.AddNewMarkProfileToStudentByStudentId(markProfileServiceModelToAdd);

            //PT: TEMP-DATA
            //PT: It is a KEY-VALUE pair that can be passes until it is used. Then it is automatically deleted!
            this.TempData["InfoMessage"] = "This message is coming from MarksController -> [Http Post] AddMark() Action -> MarkApproved() Action -> this.View(). It confirms that YOUR MARK WAS SUBMITTED SUCCESSFULLY!";

            return(this.RedirectToAction("MarkApproved", new { id = id }));
        }