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; }
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)); }