public ActionResult Add()
        {
            //HelperMetots.isAdmin();
            TempData["subject"]   = sRepo.GetAll();
            TempData["classroom"] = cRepo.GetAll();

            return(View());
        }
        public void RefreshList()
        {
            SubjectTypes.Arts.GetCode();
            SubjectList = SubjectRepo.GetAll();

            foreach (var item in SubjectList)
            {
                item.CompulsoryDescription = Utilities.GetEnumDescriptionFromString <CompulsoryTypes>(item.Compulsory);
                item.TypeDescription       = Utilities.GetEnumDescriptionFromString <SubjectTypes>(item.Type);
            }
        }
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (FormMode == FormModes.Edit || FormMode == FormModes.View)
     {
         ClassDetail           = ClassRepo.FindByID(_classid);
         SelectedSubjectList   = ClassSubjectRepo.GetSelectedSubjects(_classid);
         UnSelectedSubjectList = ClassSubjectRepo.GetUnSelectedSubjects(_classid);
     }
     if (FormMode == FormModes.New)
     {
         UnSelectedSubjectList = SubjectRepo.GetAll();
     }
 }
        public List <ChartClass> ChartValue()
        {
            List <Subject> liste = subRepo.GetAll();

            foreach (var item in liste)
            {
                int count = qRepo.GetAll().Where(p => p.SubjectID == item.Id).ToList().Count;
                if (count > 0)
                {
                    ChartClass c = new ChartClass();
                    c.value     = count;
                    c.highlight = "#006391";
                    c.label     = item.Name;
                    c.color     = "#0072A5";
                    chartList.Add(c);
                }
            }
            return(chartList);
        }
        public ActionResult Add([System.ComponentModel.DefaultValue(0)] int id)
        {
            //HelperMetots.IsLogin();
            Question ques = quesRepo.GetById(id);

            QuestionVM mdl = new QuestionVM();

            mdl.SubjectList = (subRepo.GetAll().Select(x => new SelectListItem
            {
                Text = x.Name,
                Value = x.Id.ToString()
            })).ToList();

            //mdl.QuestionType = new List<SelectListItem>
            //{    new SelectListItem { Text="Seçiniz",Value="0" },
            //     new SelectListItem { Text="Test",Value="1" },
            //     new SelectListItem { Text="Proje",Value="2" }
            //};

            mdl.AnswerDropDown = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "Seçiniz", Value = ""
                },
                new SelectListItem {
                    Text = "A Seçeneği", Value = "A"
                },
                new SelectListItem {
                    Text = "B Seçeneği", Value = "B"
                },
                new SelectListItem {
                    Text = "C Seçeneği", Value = "C"
                },
                new SelectListItem {
                    Text = "D Seçeneği", Value = "D"
                },
                new SelectListItem {
                    Text = "E Seçeneği", Value = "E"
                },
            };

            if (ques != null)
            {
                mdl.A  = ques.A;
                mdl.B  = ques.B;
                mdl.C  = ques.C;
                mdl.D  = ques.D;
                mdl.E  = ques.E;
                mdl.Id = ques.Id;
                //mdl.Type = ques.Type;
                mdl.RightAnswer = ques.RightAnswer;
                //mdl.UserID = ques.UserID;
                mdl.SubjectID = ques.SubjectID;
                mdl.Content   = ques.Content;
                mdl.IsUpdate  = true;
                mdl.Deleted   = ques.Deleted;
            }
            else
            {
                mdl.IsUpdate = false;
            }

            return(View(mdl));
        }