public ActionResult Subjects() { var subjects = Models.Subject.GetSubject(null); ViewBag.Areas = TopicArea.GetTopicArea(null); return(View(subjects)); }
public ActionResult ProfileDetails() { UserProfile user = new UserProfile(User.Identity.GetUserId()); ViewBag.Countries = Country.GetCountries(); ViewBag.Areas = TopicArea.GetTopicArea(null); return(PartialView(user)); }
public void EditThisArea(TopicAreaDTO model) { using (var context = new ApplicationDbContext()) { TopicArea topicAreaToEdit = context.TopicAreas.FirstOrDefault(x => x.TopicAreaId == model.TopicAreaId); topicAreaToEdit.Description = model.Description; context.SaveChanges(); } }
public void CreateNewArea(TopicAreaDTO model) { using (var context = new ApplicationDbContext()) { TopicArea topicArea = new TopicArea(); topicArea.TopicAreaId = context.TopicAreas.Count() + 1; topicArea.Description = model.Description; context.TopicAreas.Add(topicArea); context.SaveChanges(); } }
public ActionResult TeacherSkills() { List <TeacherSkillViewModel> skills = new List <TeacherSkillViewModel>(); List <Subject> subjects = Models.Subject.GetSubject(null); foreach (var subject in subjects) { List <Module> module = Module.GetModulesBySubjectId(subject.Id); TeacherSkillViewModel skill = new TeacherSkillViewModel(); skill.Subject = subject; skill.Modules = module; skills.Add(skill); } ViewBag.Skills = skills; ViewBag.Areas = TopicArea.GetTopicArea(null); ViewBag.SelectedSkills = TeacherSkillViewModel.GetSelectedSkills(User.Identity.GetUserId()); return(PartialView()); }
internal List <TopicArea> getAreaById(int?id) { using (SqlConnection sqlConnection = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand("sp_GetArea", sqlConnection)) { try { sqlConnection.Open(); command.CommandType = CommandType.StoredProcedure; if (id == null) { command.Parameters.AddWithValue("@Id", DBNull.Value); } else { command.Parameters.AddWithValue("@Id", id); } SqlDataReader rdr = command.ExecuteReader(); List <TopicArea> topicList = new List <TopicArea>(); while (rdr.Read()) { TopicArea topic = new TopicArea(); topic.Id = Convert.ToInt32(rdr["Id"]); topic.Name = rdr["Name"].ToString(); topicList.Add(topic); } return(topicList); } catch (Exception ex) { throw ex; } } } }
public ActionResult FindStudent() { ViewBag.Interests = TopicArea.GetTopicArea(null); return(View()); }