public ActionResult ListActive() { //GetData(); IEnumerable <expense> ExpenseList; ExpenseList = ExpenseRepository.GetExpenseByStatus("Unpaid"); ViewBag.RecordCount = ExpenseList.Count(); foreach (var i in ExpenseList) { i.subcategory = SubCategoryRepository.GetBySubCategoryID(i.subCategoryID); i.bankaccount = BankAccountRepository.GetBankAccountByID(i.bankAccountID); } return(PartialView(ExpenseList)); }
public ActionResult List(DateTime bDate, DateTime eDate, string code = "", int codeID = 0, string ReportType = "") { ViewBag.ReportType = ReportType; GetData(); IEnumerable <expense> ExpenseList; if (code == "BankAccountSearch") { ExpenseList = ExpenseRepository.GetExpenseByBankAccount(codeID, bDate, eDate); } else if (code == "CategorySearch") { ExpenseList = ExpenseRepository.GetExpenseByCategory(codeID, bDate, eDate); } else if (code == "DateRangeSearch") { ExpenseList = ExpenseRepository.GetExpenseByDateRange(bDate.Date, eDate.Date); } else if (code == "CurrentExpense") { ExpenseList = ExpenseRepository.GetExpenseByStatus("Unpaid"); } else { ExpenseList = ExpenseRepository.GetExpenseByDate(bDate); } ViewBag.RecordCount = ExpenseList.Count(); foreach (var i in ExpenseList) { i.subcategory = SubCategoryRepository.GetBySubCategoryID(i.subCategoryID); i.bankaccount = BankAccountRepository.GetBankAccountByID(i.bankAccountID); } ViewBag.TotalExpense = ExpenseList.Sum(e => e.Amount); return(PartialView(ExpenseList)); }