Beispiel #1
0
        // GET: TeachersApplicationForm
        public ActionResult ApplicationForm(string id)
        {
            int Id = Int32.Parse(id);
            InstituteDataEntities db = new InstituteDataEntities();
            Form form = new Form();

            var Slot = db.Slots.Where(m => m.Institutes.Select(c => c.Id).Contains(Id)).ToList();

            int durationValue             = 0;
            List <Given_Slots> givenSlots = new List <Given_Slots>();

            foreach (var value in Slot)
            {
                Given_Slots SlotValue = new Given_Slots();

                SlotValue.duration = value.slotstartTime.ToString() + " - " + value.slotendTime.ToString();
                SlotValue.value    = value.slotId;
                givenSlots.Add(SlotValue);
            }
            var Subject       = db.Subjects.ToList();
            var schoolSection = db.Sections.ToList();

            ViewBag.Slots   = new SelectList(givenSlots, "value", "duration");
            ViewBag.Subject = new SelectList(Subject, "Subjects", "Subjects");
            ViewBag.Section = new SelectList(schoolSection, "section1", "section1");
            form.selectedRequirement.selectedSchool = Id;
            return(View(form));
        }
        public ActionResult InstituteList(string id)
        {
            InstitutesofParticularArea institutes = new InstitutesofParticularArea();

            using (InstituteDataEntities db = new InstituteDataEntities())
            {
                var areaId = db.Areas.Where(m => m.Area1 == id).FirstOrDefault().areasId;
                institutes.institute = db.Institutes.Where(m => m.areasId == areaId).ToList();
            }
            institutes.area = id;
            return(View(institutes));
        }
        public ActionResult InstituteDetail(string id)
        {
            Institute   institute = new Institute();
            List <Slot> Slots     = new List <Slot>();

            using (InstituteDataEntities db = new InstituteDataEntities())
            {
                institute = db.Institutes.Where(m => m.fullName == id).FirstOrDefault();
                Slots     = db.Slots.Where(m => m.Institutes.Select(c => c.fullName).Contains(id)).ToList();
            }
            ViewBag.Slot = Slots;
            return(View(institute));
        }
        public ActionResult InstituteAreas()
        {
            List <AreaInstitute> areas          = new List <AreaInstitute>();
            AreaInstitute        particulararea = new AreaInstitute();

            using (InstituteDataEntities db = new InstituteDataEntities())
            {
                for (int i = 1; i <= db.Areas.Count(); i++)
                {
                    particulararea.area          = db.Areas.Where(m => m.areasId == i).FirstOrDefault();
                    particulararea.noofInstitute = db.Institutes.Where(m => m.areasId == i).Count();
                    areas.Add(particulararea);
                }
            }


            return(View(areas));
        }