Exemple #1
0
 public TeacherProfile()
 {
     Student = new Data.studenci();
     Subject = new Data.przedmioty();
     Classe  = new Data.zajecia();
     Project = new Data.projekty();
     Stage   = new Data.etapy();
 }
        public ActionResult CreateProject(Models.TeacherModels.TeacherProfile prof)
        {
            using (var entity = new Data.TestEntities())
            {
                Data.projekty project = new Data.projekty()
                {
                    nazwa_proj = prof.Project.nazwa_proj,
                    termin_wyk = Convert.ToDateTime(prof.Project.termin_wyk),
                    id_zajec   = prof.Classe.id_zajec,
                    id_prow    = _teaProfile.LoginModel.Teacher.id_prow
                };

                entity.projekty.Add(project);
                entity.SaveChanges();
            }

            return(RedirectToAction("TeaProjects", _teaProfile));
        }