public List <Course> getAllElectiveDetailsForSWEN() { /* using (CPSCreationEntities db = new CPSCreationEntities()) * { * var results = db.Catalog16_17.Where(p => p.SWEN.Contains("E")).Select(p => new Course * { * CourseShortName = p.Course, * CourseFullName = p.LongTitle, * CourseSubject = p.Subject, * Courselevel = p.Catalog, * CreditHrs = p.creditHrs * * }).ToList(); * * return results; * } */ using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var results = db.AcademicCatalog16_17.Where(p => p.SWEN.Contains("E")).Select(p => new Course { CourseShortName = p.Course, CourseFullName = p.Long_Title, CourseSubject = p.Dept, Courselevel = p.Course_No, CreditHrs = p.Credit_Hr }).ToList(); return(results); } }
private List <string> getElectiveSubjectsForSWEN() { using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var results = db.AcademicCatalog16_17.Where(j => j.SWEN == "E").Select(c => c.Dept).Distinct().ToList(); return(results); } }
public List <Course> getElectiveListWithDepartmentAndLevel(string subject, string level) { string firstNumber = level.Substring(level.Length - 3); using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var results = db.AcademicCatalog16_17.Where(p => p.Dept.Contains(subject) && p.Course_No.StartsWith(firstNumber)).Select(p => new Course { CourseShortName = p.Course, CourseFullName = p.Long_Title, CourseSubject = p.Dept, Courselevel = p.Course_No, CreditHrs = p.Credit_Hr }).ToList(); return(results); } }
public List <String> getAllCoreForSWEN() { /* using (CPSCreationEntities db = new CPSCreationEntities()) * { * var results = db.Catalog16_17.Where(p => p.SWEN.Contains("C")).Select(p => new * { * p.Course * }).Cast<string>().ToList(); ; * * return results; * }*/ using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var results = db.AcademicCatalog16_17.Where(p => p.SWEN.Contains("C")).Select(p => new { p.Course }).Cast <string>().ToList();; return(results); } }
public List <string> getElectiveWholeNameListWithDepartmentAndLevel(string subject, string level) { string str = ""; List <String> list = new List <string>(); string firstNumber = level.Substring(level.Length - 3); using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var results = db.AcademicCatalog16_17.Where(p => p.Dept.Contains(subject) && p.Course_No.StartsWith(firstNumber)).Select(p => new Course { CourseShortName = p.Course, CourseFullName = p.Long_Title, CourseSubject = p.Dept, Courselevel = p.Course_No, CreditHrs = p.Credit_Hr }).ToList(); foreach (Course c in results) { list.Add(c.CourseShortName + " " + c.CourseFullName); } return(list); } }
}//end of getRegisteredCourseDetails public Course getCourseDetailUsingCourseShortName(string csname, string ctlg, string mjr) { Course crs = new Course(); if (ctlg.Equals("Catalog16_17")) { if (mjr.Equals("SWEN")) { using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var course = db.AcademicCatalog16_17.Where(o => o.Course.ToLower().Equals(csname)); if (course.Any()) { string csShortName = course.FirstOrDefault().Course; string csLongName = course.FirstOrDefault().Long_Title; string csCredits = course.FirstOrDefault().Credit_Hr; string csType = course.FirstOrDefault().SWEN; string csSubject = course.FirstOrDefault().Dept; string csCatalog = course.FirstOrDefault().Course_No; crs = new Course(csShortName, csLongName, csSubject, csCatalog, csCredits, csType); crs.CourseWholeName = csShortName + " " + csLongName; } } return(crs); } else if (mjr.Equals("CSCI")) { using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var course = db.AcademicCatalog16_17.Where(o => o.Course.ToLower().Equals(csname)); if (course.Any()) { string csShortName = course.FirstOrDefault().Course; string csLongName = course.FirstOrDefault().Long_Title; string csCredits = course.FirstOrDefault().Credit_Hr; string csType = course.FirstOrDefault().CSCI; string csSubject = course.FirstOrDefault().Dept; string csCatalog = course.FirstOrDefault().Course_No; crs = new Course(csShortName, csLongName, csSubject, csCatalog, csCredits, csType); } } return(crs); } else if (mjr.Equals("SENG")) { using (c533317sp04prakhyanEntities db = new c533317sp04prakhyanEntities()) { var course = db.AcademicCatalog16_17.Where(o => o.Course.ToLower().Equals(csname)); if (course.Any()) { string csShortName = course.FirstOrDefault().Course; string csLongName = course.FirstOrDefault().Long_Title; string csCredits = course.FirstOrDefault().Credit_Hr; string csType = course.FirstOrDefault().SENG; string csSubject = course.FirstOrDefault().Dept; string csCatalog = course.FirstOrDefault().Course_No; crs = new Course(csShortName, csLongName, csSubject, csCatalog, csCredits, csType); } } return(crs); } } else if (ctlg.Equals("Catalog17_18")) { } return(crs); }//getCourseDetailsUsingCourseShortName