private EarningSubcategoryViewModel CreateEarningSubcategoryWithSelectList() { var earningSubCategoryVm = new EarningSubcategoryViewModel(); var earningCategories = _earningCategoriesRepository.GetWhere(x => x.Id > 0).ToList(); earningSubCategoryVm.SelectListOfEarningCategories = new SelectList(earningCategories, "Id", "CategoryName"); return(earningSubCategoryVm); }
private EarningViewModel CreateVmWithLists() { var earningVm = new EarningViewModel(); var bankAccounts = _bankAccountRepository.GetWhere(x => x.Id > 0).ToList(); var categories = _categoriesRepository.GetWhere(x => x.Id > 0).ToList(); var subCategories = _subCategoriesRepository.GetWhere(x => x.Id > 0).ToList(); earningVm.SelectListOfBankAccounts = new SelectList(bankAccounts, "Id", "AccountName"); earningVm.SelectListOfEarningCategories = new SelectList(categories, "Id", "CategoryName"); earningVm.SelectListOfEarningSubCategories = new SelectList(subCategories, "Id", "SubCategoryName"); return(earningVm); }
// GET: EarningCategories public ActionResult Index() { return(View(_earningCategoriesRepository.GetWhere(cat => cat.Id > 0).ToList())); }