Пример #1
0
 public Thesis(AddThesisViewModel addThesis)
 {
     this.Subject        = addThesis.Subject;
     this.EnglishSubject = addThesis.EnglishSubject;
     this.Objective      = addThesis.Objective;
     this.Tasks          = addThesis.Tasks;
     this.Status         = addThesis.Status;
     this.Version        = addThesis.Version;
     this.Category       = addThesis.Category;
 }
Пример #2
0
        public ActionResult Create(int year, AddThesisViewModel addThesis)
        {
            if (ModelState.IsValid)
            {
                Thesis thesis = new Thesis(addThesis);
                thesis.AcademicYearID   = year;
                thesis.LecturerID       = User.Identity.GetUserId();
                thesis.CompletionDate   = DateTime.Now;
                thesis.DefenseDate      = DateTime.Now;
                thesis.EducationProfile = "ogólnoakademicki";

                db.Thesis.Add(thesis);
                db.SaveChanges();
                return(RedirectToAction("Details", "AcademicYear"));
            }

            return(View(addThesis));
        }