public ActionResult SelectInvoices(string errorMessage) { try { int ContIndex = Convert.ToInt32(User.Identity.Name); var model = new SelectInvoicesModel { Client = engineService.GetClientDetails(ContIndex), Invoices = engineService.GetInvoiceDetails(ContIndex), ErrorMessage = errorMessage }; return View(model); } catch(Exception ex) { Console.WriteLine(ex); return RedirectToAction("Error"); } }