Exemplo n.º 1
0
        /// <summary>
        /// Gets the Job Histories in ascending or decending order ( of Start Date) and returns Job History partial view.
        /// </summary>
        /// <param name="sortOrder"></param>
        /// <param name="media"></param>
        /// <returns></returns>
        public ActionResult GetSortedStartDate(string sortOrder, string media)
        {
            Trace.WriteLine("Entering GetSortedStartDate method");
            ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date";
            switch (sortOrder)
            {
            case "Date":
                var jobHistories1 = DocumentDBDataController.GetJobHistories(media);
                ViewBag.Mediaserver = media;
                return(PartialView("JobHistory", jobHistories1));

            case "date_desc":
                var jobHistories2 = DocumentDBDataController.GetStartDateInDescOrder(media);
                ViewBag.Mediaserver = media;
                return(PartialView("JobHistory", jobHistories2));

            default:
                var jobHistories = DocumentDBDataController.GetStartDateInDescOrder(media);
                ViewBag.Mediaserver = media;
                return(PartialView("JobHistory", jobHistories));
            }
        }