public ActionResult Index(LedgerCriteriaView vm)
 {
     vm.Result =
         _ledgerRepository.GetLedger(vm.TimeFrameBegin, vm.TimeFrameEnd, User.Identity.GetUserName()).ToList();
     if (vm.DoExport && vm.Result.Count > 0)
     {
         return LedgerExport(vm.Result);
     }
     return View(vm);
 }
 /// ---------------------------------------------------------------------
 /// <summary>
 ///     Display Ledger Criteria View
 ///     -------------------------------------
 ///     GET: Display/Ledger
 /// </summary>
 /// <returns>ActionResult</returns>
 /// ---------------------------------------------------------------------
 public ActionResult Index()
 {
     var vm = new LedgerCriteriaView();
     var cm = new TempDateCriteriaView();
     if (TempData["CriteriaModel"] == null)
     {
         var dateTime = DateTime.Today;
         vm.TimeFrameBegin = dateTime;
         vm.TimeFrameEnd = dateTime.AddMonths(1);
         cm.TimeFrameBegin = vm.TimeFrameBegin;
         cm.TimeFrameEnd = vm.TimeFrameEnd;
         TempData["CriteriaModel"] = cm;
     }
     else
     {
         cm = TempData["CriteriaModel"] as TempDateCriteriaView;
         if (cm != null) vm.TimeFrameBegin = cm.TimeFrameBegin;
         if (cm != null) vm.TimeFrameEnd = cm.TimeFrameEnd;
     }
     vm.Result =
         _ledgerRepository.GetLedger(vm.TimeFrameBegin, vm.TimeFrameEnd, User.Identity.GetUserName()).ToList();
     return View(vm);
 }