Exemplo n.º 1
0
        public ActionResult getAllFaculties(int?skip)
        {
            PagedFaculty pagedFacultyModel = new PagedFaculty();

            if (HCRGCLIENT.ClientTypeID == 1)
            {
                pagedFacultyModel.IsHCRGAdmin = true;
            }
            else
            {
                pagedFacultyModel.IsHCRGAdmin = false;
            }

            if (skip == null)
            {
                var facultyList = _CollegeService.GetAllPagedFaculty(GlobalConst.Records.Skip, GlobalConst.Records.Take15, 0, HCRGCLIENT.ClientID);
                pagedFacultyModel.FacultyDetails = Mapper.Map <IEnumerable <Faculty> >(facultyList.FacultyDetails);
                pagedFacultyModel.FacultyDetails.ToList().ForEach(
                    faculty =>
                {
                    faculty.FullName = pagedFacultyModel.FacultyDetails.ToList().Find(faculties => faculties.FacultyID == faculty.FacultyID).FirstName + " " + pagedFacultyModel.FacultyDetails.ToList().Find(faculties => faculties.FacultyID == faculty.FacultyID).LastName;
                });
                pagedFacultyModel.TotalCount = facultyList.TotalCount;
                return(View(pagedFacultyModel));
            }
            else
            {
                var facultyList = _CollegeService.GetAllPagedFaculty(skip.Value, GlobalConst.Records.Take15, 0, HCRGCLIENT.ClientID);
                pagedFacultyModel.FacultyDetails = Mapper.Map <IEnumerable <Faculty> >(facultyList.FacultyDetails);
                pagedFacultyModel.FacultyDetails.ToList().ForEach(
                    faculty =>
                {
                    faculty.FullName = pagedFacultyModel.FacultyDetails.ToList().Find(faculties => faculties.FacultyID == faculty.FacultyID).FirstName + pagedFacultyModel.FacultyDetails.ToList().Find(faculties => faculties.FacultyID == faculty.FacultyID).LastName;
                });
                pagedFacultyModel.TotalCount = facultyList.TotalCount;
                return(Json(pagedFacultyModel, GlobalConst.Message.text_html));
            }
        }
Exemplo n.º 2
0
        public JsonResult GetAllFacultiesByOrganizationID(int skip, int OrganizationID)
        {
            PagedFaculty pagedFacultyModel = new PagedFaculty();

            if (HCRGCLIENT.ClientTypeID == 1)
            {
                pagedFacultyModel.IsHCRGAdmin = true;
            }
            else
            {
                pagedFacultyModel.IsHCRGAdmin = false;
            }
            var facultyList = _CollegeService.GetAllPagedFaculty(skip, GlobalConst.Records.Take15, OrganizationID, HCRGCLIENT.ClientID);

            pagedFacultyModel.FacultyDetails = Mapper.Map <IEnumerable <Faculty> >(facultyList.FacultyDetails);
            pagedFacultyModel.FacultyDetails.ToList().ForEach(
                faculty =>
            {
                faculty.FullName = pagedFacultyModel.FacultyDetails.ToList().Find(faculties => faculties.FacultyID == faculty.FacultyID).FirstName + pagedFacultyModel.FacultyDetails.ToList().Find(faculties => faculties.FacultyID == faculty.FacultyID).LastName;
            });
            pagedFacultyModel.TotalCount = facultyList.TotalCount;
            return(Json(pagedFacultyModel));
        }