Exemplo n.º 1
0
        public ActionResult Subjects()
        {
            var subjects = Models.Subject.GetSubject(null);

            ViewBag.Areas = TopicArea.GetTopicArea(null);
            return(View(subjects));
        }
Exemplo n.º 2
0
        public ActionResult ProfileDetails()
        {
            UserProfile user = new UserProfile(User.Identity.GetUserId());

            ViewBag.Countries = Country.GetCountries();
            ViewBag.Areas     = TopicArea.GetTopicArea(null);

            return(PartialView(user));
        }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 4
0
 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();
     }
 }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
        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;
                    }
                }
            }
        }
Exemplo n.º 7
0
 public ActionResult FindStudent()
 {
     ViewBag.Interests = TopicArea.GetTopicArea(null);
     return(View());
 }