// GET: BankAccounts public ActionResult Index() { BankAccountQueryViewModel result = new BankAccountQueryViewModel(); result.BankAccounts = BankAccountsRepo.Search(result.Query, result.Paging); return(View(result)); }
public ActionResult GetExcel(BankAccountQueryViewModel cond = null) { using (var wb = GetExcelFile(cond)) { // Add ClosedXML.Extensions in your using declarations return(wb.Deliver($"ExportCustomerBankAccount_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx")); } }
public ActionResult Index(BankAccountQueryViewModel data = null) { BankAccountQueryViewModel result = new BankAccountQueryViewModel(); result.BankAccounts = BankAccountsRepo.Search(data.Query, data.Paging); result.Paging.Count = BankAccountsRepo.SearchCount(data.Query); result.Paging.Take = data.Paging.Take; result.Query = data.Query; return(View(result)); }
private XLWorkbook GetExcelFile(BankAccountQueryViewModel cond = null) { List <BankAccountViewModel> list = BankAccountsRepo.Search(cond.Query); return(ClosedXmlHelper.ToClosedXmlExcel(list)); }