public IHttpActionResult Get(decimal SchoolYearID, decimal StudentID) { List <list_studentenrollment> _StudentEnrollmentList = null; using (var dbobj = new DB_Magic_StudentEntities()) { if (SchoolYearID != null && SchoolYearID != 0) { _StudentEnrollmentList = dbobj.PROC_GetStudentEnrollmentDetail(0, SchoolYearID).Select( Student => new list_studentenrollment() { StudentID = Student.StudentID , FirstName = Student.FirstName , LastName = Student.LastName , DateOfBirth = Student.DateOfBirth , Ssn = Student.Ssn , SchoolYear = Student.SchoolYear , StartDate = Student.StartDate.Value , EndDate = Student.EndDate.Value } ).ToList <list_studentenrollment>(); } else if (StudentID != null && StudentID != 0) { _StudentEnrollmentList = dbobj.PROC_GetStudentEnrollmentDetail(StudentID, 0).Select( Student => new list_studentenrollment() { StudentID = Student.StudentID , FirstName = Student.FirstName , LastName = Student.LastName , DateOfBirth = Student.DateOfBirth , Ssn = Student.Ssn , SchoolYear = Student.SchoolYear , StartDate = Student.StartDate.Value , EndDate = Student.EndDate.Value } ).ToList <list_studentenrollment>(); } } if (_StudentEnrollmentList.Count == 0) { return(NotFound()); } return(Ok(_StudentEnrollmentList)); }
public IHttpActionResult Get() { List <list_student> _StudentList = null; using (var dbobj = new DB_Magic_StudentEntities()) { _StudentList = dbobj.tbl_Master_Student .Where(Student => Student.IsActive == "Y") .Where(Student => Student.IsDeleted == "N") .Select( Student => new list_student() { StudentID = Student.StudentID , FirstName = Student.FirstName , LastName = Student.LastName , DateOfBirth = Student.DateOfBirth.Value , Ssn = Student.Ssn , Text = Student.FirstName + " " + Student.LastName , Value = Student.StudentID } ).ToList <list_student>(); } if (_StudentList.Count == 0) { return(NotFound()); } return(Ok(_StudentList)); }
public IHttpActionResult Get() { List <list_selectedlist> _SchoolYearList = null; using (var dbobj = new DB_Magic_StudentEntities()) { _SchoolYearList = dbobj.tbl_Master_SchoolYear.Select( School => new list_selectedlist() { Value = School.SchoolYearId , Text = School.SchoolYear } ).ToList <list_selectedlist>(); } if (_SchoolYearList.Count == 0) { return(NotFound()); } return(Ok(_SchoolYearList)); }
public IHttpActionResult Get() { List <list_selectedlist> _DistList = null; using (var dbobj = new DB_Magic_StudentEntities()) { _DistList = dbobj.tbl_Master_District.Select( Dis => new list_selectedlist() { Value = Dis.DistrictID , Text = Dis.DistrictName } ).ToList <list_selectedlist>(); } if (_DistList.Count == 0) { return(NotFound()); } return(Ok(_DistList)); }
public IHttpActionResult Get() { List <list_studentservice> _StudentServiceList = null; using (var dbobj = new DB_Magic_StudentEntities()) { _StudentServiceList = dbobj.PROC_GetStudentServiceDetail(0, 0).Select( Student => new list_studentservice() { StudentID = Student.StudentID , FirstName = Student.FirstName , LastName = Student.LastName , DateOfBirth = Student.DateOfBirth , Ssn = Student.Ssn , SchoolYear = Student.SchoolYear , StartDate = Student.StartDate.Value , EndDate = Student.EndDate.Value , ServiceName = Student.ServiceName } ).ToList <list_studentservice>(); } if (_StudentServiceList.Count == 0) { return(NotFound()); } return(Ok(_StudentServiceList)); }