/// <summary> /// Deletes the data. /// </summary> /// <returns></returns> public ActionResult DeleteData() { CourseListingDataAccess dataAccess = new CourseListingDataAccess(RavenSession); dataAccess.DeleteAllCourseData(); return RedirectToAction("Assignment5", "Assignments"); }
/// <summary> /// Assignment4s the specified refresh data. /// </summary> /// <param name="refreshData">The refresh data.</param> /// <param name="reloadData">The reload data.</param> /// <param name="recalculateStats">The recalculate stats.</param> /// <returns></returns> public ActionResult Assignment4(string reloadData, string recalculateStats, string deleteData) { CourseListingDataAccess dataAccess = new CourseListingDataAccess(RavenSession); Assignment4ViewModel model = new Assignment4ViewModel(); if(!string.IsNullOrEmpty(reloadData) && reloadData.Trim() == "1") { dataAccess.LoadAllCourseDataToDatabase(); } if(!string.IsNullOrEmpty(deleteData) && deleteData.Trim() == "1") { dataAccess.DeleteAllCourseData(); } if(!string.IsNullOrEmpty(recalculateStats) && recalculateStats.Trim() == "1") { dataAccess.PopulateHistoricalData(); } model.Courses = dataAccess.GetCoursesBySemesterIDandDepartmentID("Fall2013", "IT"); return View("Assignment4", model); }