예제 #1
0
        //GET : Teacher/Details
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var model = new TeacherDetailsModel();

            model.Teacher = th.GetById(id.Value);
            model.Courses = await crs.GetTaughtByTeacherId(id.Value);

            var cl = cls.GetByTeacherId(id.Value);

            if (cl != null)
            {
                model.Classe = cl.Name;
            }

            if (model == null)
            {
                return(NotFound());
            }



            return(View(model));
        }
        // GET: ClassAssign/Create id teacher
        public PartialViewResult Create(int id)
        {
            var model = new ClassAssignModel();

            model.Teacher   = th.GetById(id);
            model.TeacherId = model.Teacher.Id;
            DropDownList(model.ClassId);
            return(PartialView(model));
        }
        //GET :
        public PartialViewResult Create(int id)
        {
            var model = new CourseAssignModel();

            model.Teacher   = th.GetById(id);
            model.Courses   = crs.GetAll();
            model.TeacherId = model.Teacher.Id;

            return(PartialView(model));
        }
예제 #4
0
        public IActionResult Editar(int id)
        {
            var data = _teacher.GetById(id);

            var teacherEducation = new TeacherEducation();

            var model = CopyPropierties.Convert <Teacher, TeacherModel>(data);

            model.HigherTeacherEducation = teacherEducation;
            model.Name        = data.Contact.ContactName;
            model.LastName    = data.Contact.ContactLastname;
            model.Document    = data.Contact.ContactDocumentNumber;
            model.Nacionality = data.Contact.Nationality;


            ViewBag.ContactTypes      = new SelectList(_contactType.GetAll, "ContactTypeId", "ContactTypeName");
            ViewBag.DocumentType      = new SelectList(_documentType.GetAll, "DocumentTypeId", "DocumentTypeName");
            ViewBag.Countries         = new SelectList(_country.GetAll, "CountryId", "CountryName");
            ViewBag.Cities            = new SelectList(_city.Cities, "CityId", "CityName");
            ViewBag.AddressTypes      = new SelectList(_addressType.addressTypes, "AddressTypeId", "AddressTypeName");
            ViewBag.TeacherHiringType = new SelectList(_teacherHiringType.GetAll, "TeacherHiringTypeId", "TeacherHiringTypeName");
            ViewBag.EducationType     = new SelectList(_educationType.GetAll, "EducationTypeId", "EducationTypeName");
            ViewBag.TeacherEducation  = new SelectList(_teacherEducation.GetAll, "TeacherEducationId", "TeacherEducationTitle");
            ViewBag.Nationality       = new SelectList(_nationality.GetAll, "NationalityId", "NationalityName");
            ViewBag.MatirialStatus    = new SelectList(_matirialStatus.GetAll, "MaritalStatusId", "MaritalStatusName");
            ViewBag.University        = new SelectList(_university.Universities, "UniversityId", "UniversityName");


            return(View("Crear", model));
        }
예제 #5
0
        public IActionResult Editar(int id)
        {
            var data = _teacher.GetById(id);

            var model = CopyPropierties.Convert <Teacher, TeacherModel>(data);

            ViewBag.ContactTypes = new SelectList(_contactType.GetAll, "ContactTypeId", "ContactTypeName");
            ViewBag.DocumentType = new SelectList(_documentType.GetAll, "DocumentTypeId", "DocumentTypeName");
            ViewBag.Countries    = new SelectList(_country.GetAll, "CountryId", "CountryName");
            ViewBag.Cities       = new SelectList(_city.Cities, "CityId", "CityName");
            ViewBag.AddressTypes = new SelectList(_addressType.addressTypes, "AddressTypeId", "AddressTypeName");
            //ViewBag.Status = new SelectList(_status);
            ViewBag.EducationType    = new SelectList(_educationType.GetAll, "EducationTypeId", "EducationTypeName");
            ViewBag.TeacherEducation = new SelectList(_teacherEducation.GetAll, "TeacherEducationId", "TeacherEducationTitle");
            ViewBag.Nationality      = new SelectList(_nationality.GetAll, "NationalityId", "NationalityName");
            ViewBag.MatirialStatus   = new SelectList(_matirialStatus.GetAll, "MaritalStatusId", "MaritalStatusName");

            return(View("Crear", model));
        }
예제 #6
0
        public IActionResult Editar(int id, int scholarshipProgramUniversityId)
        {
            var data = _subjectMatter.GetById(id);

            var model = CopyPropierties.Convert <SubjectMatter, SubjectMatterModel>(data);

            if (model.TracingStudyPlanDevelopment.TeacherId == null)
            {
                model.TracingStudyPlanDevelopment.TeacherId = 0;
            }

            var univerityTeacherSelected = _teacher.GetById((int)model.TracingStudyPlanDevelopment.TeacherId);

            model.UniversityTeacherSelectedName = univerityTeacherSelected?.Contact?.ContactName?.ToString() + "" + univerityTeacherSelected?.Contact?.ContactLastname?.ToString();

            var universityId = _scholarshipProgramUniversity.GetUniversityIdByScholarshipProgramUniversityId(scholarshipProgramUniversityId);

            var teachers = _teacher.GetTeachersByUSerUniversityId(universityId);

            ViewBag.Teachers = new SelectList(TeachersByUniverityIdList(universityId), "TeacherId", "TeacherFullName");
            ViewBag.Status   = new SelectList(_status.Status, "StatusId", "StatusName");
            return(View("Crear", model));
        }