Example #1
0
        /// <summary>
        /// NAME : Derek Taylor
        /// DATE: 2/14/2020
        /// CHECKED BY:
        ///
        /// This Method returns the ViewList of Applicants and allows for sorting based on
        /// the last name of the Applicant.
        /// </summary>
        /// <remarks>
        /// UPDATED BY: NA
        /// UPDATE DATE: NA
        /// CHANGE: NA
        ///
        /// </remarks>
        /// <returns>ViewList of applicants</returns>
        public ActionResult ApplicantList(string sortOrder)
        {
            ViewBag.NameSortParam = String.IsNullOrEmpty(sortOrder) ? "name_descending" : "";
            var applicants = from a in _applicantManager.RetrieveApplicants()
                             select a;

            switch (sortOrder)
            {
            case "name_descending":
                applicants = applicants.OrderByDescending(a => a.LastName);
                break;

            default:
                applicants = applicants.OrderBy(a => a.LastName);
                break;
            }
            ApplicantListViewModel viewModel = new ApplicantListViewModel
            {
                Applicants = applicants.ToList()
            };

            return(View(viewModel));
        }
		}// End Page_Loaded()

		/// <summary>
		/// CREATED BY: Matt Deaton
		/// DATE: 2020-04-11
		/// CHECKED BY: Steve Coonrod
		/// 
		/// Method that populates the Data Grid using a method from the Applicant Manager.
		/// 
		/// </summary>
		/// <remarks>
		/// UPDATED BY:
		/// UPDATED:
		/// CHANGE:
		/// </remarks>
		private void populateApplicantList()
		{
			dgViewAllApplicants.ItemsSource = _applicantManager.RetrieveApplicants();
		}// End populateApplicantList()