public ActionResult Search(string searchString, int amount, DateTime?date1, DateTime?date2, string department, string gl, int?page)
        {
            int count    = 0;
            int pageSize = 10;
            int pageNum  = (page ?? 1);

            int amount1 = 0;
            int amount2 = 0;


            var tempArray = new int[2];

            tempArray = amountList[amount];

            amount1 = tempArray.ElementAt(0);

            amount2 = tempArray.ElementAt(1);


            IEnumerable <DONATION> Donations = new List <DONATION>();

            if (searchString != null)
            {
                page      = 1;
                Donations = dnRepo.FindBy(searchString, amount1, amount2, date1, date2, department, gl);
            }

            count = Donations.Count();

            ChartDispalyViewModel model = new ChartDispalyViewModel();

            model.Donations = Donations.Take(count).ToPagedList(pageNum, pageSize);

            model.searchString = searchString;
            model.amount       = amount;
            model.date1        = date1;
            model.date2        = date2;
            model.department   = department;
            model.gl           = gl;

            LoadSelectList();


            return(View("~/Views/Chart/Index.cshtml", model));
        }
        public ActionResult LoadData(int?page)
        {
            int count    = 0;
            int pageSize = 10;
            int pageNum  = (page ?? 1);

            var donations = from DONATION d in dnRepo.GetDonations()
                            select d;

            var donors = from DONOR d in drRepo.GetDonors
                         select d;

            ChartDispalyViewModel model = new ChartDispalyViewModel();

            count = donations.Count();

            model.Donors    = donors.Take(count).ToPagedList(pageNum, pageSize);
            model.Donations = donations.Take(count).ToPagedList(pageNum, pageSize);

            return(View("~/Views/Chart/Index.cshtml", model));
        }