public void LoadTest() { DegreeTypeList degreeTypes = new DegreeTypeList(); degreeTypes.Load(); Assert.AreEqual(5, degreeTypes.Count); }
public DegreeTypeList Get() { DegreeTypeList degreetypes = new DegreeTypeList(); degreetypes.Load(); return(degreetypes); }
// GET: Program/Create public ActionResult Create() { ProgramDegreeTypeList pdtl = new ProgramDegreeTypeList(); Program program = new Program(); pdtl.Program = program; DegreeTypeList degreeTypes = new DegreeTypeList(); degreeTypes.Load(); pdtl.DegreeTypeList = degreeTypes; return(View(pdtl)); }
public void DeleteTest() { DegreeType degreeType = new DegreeType(); DegreeTypeList degreeTypes = new DegreeTypeList(); degreeTypes.Load(); degreeType = degreeTypes.Where(p => p.Description == "Test Degree Type").FirstOrDefault(); int result = degreeType.Delete(); Assert.IsTrue(result > 0); }
protected void Page_Load(object sender, EventArgs e) { // If not a post back, get info from database if (!IsPostBack) { degreeTypes = new DegreeTypeList(); degreeTypes.Load(); Rebind(); Session["degreetypes"] = degreeTypes; } else { // Get the objects from session degreeTypes = (DegreeTypeList)Session["degreeTypes"]; } }
public void UpdateTest() { DegreeType degreeType = new DegreeType(); DegreeTypeList degreeTypes = new DegreeTypeList(); degreeTypes.Load(); degreeType = degreeTypes.Where(p => p.Description == "Test Degree Type").FirstOrDefault(); degreeType.Update(); DegreeType updatedDegreeType = new DegreeType(); updatedDegreeType.Id = degreeType.Id; updatedDegreeType.LoadById(); Assert.AreEqual(degreeType.Description, updatedDegreeType.Description); }
protected void Page_Load(object sender, EventArgs e) { // If not a post back, get info from database if (!IsPostBack) { programs = new ProgramList(); programs.Load(); degreeTypes = new DegreeTypeList(); degreeTypes.Load(); Rebind(); // put objects into session Session["programs"] = programs; Session["degreetypes"] = degreeTypes; // review to see if i typed this right } else { // Get the objects from session programs = (ProgramList)Session["programs"]; degreeTypes = (DegreeTypeList)Session["degreeTypes"]; } }
// GET: DegreeTypes public ActionResult Index() { degreeTypes = new DegreeTypeList(); degreeTypes.Load(); return(View(degreeTypes)); }