public IActionResult Details(int?id) { if (HttpContext.Session.GetString("AdminId") != null) { if (id == null) { return(NotFound()); } Invoice getInvoiceInfoById = _iInvoiceManager.GetById(id); Account getAccountInfoByInvoiceAccountId = _iAccountManager.GetAll() .Where(a => a.Id == getInvoiceInfoById.AccountId) .FirstOrDefault(); if (getInvoiceInfoById == null) { return(NotFound()); } ICollection <InvoiceDetails> customerInvoiceDetails = _iInvoiceDetailsManager.GetAll() .Where(ind => ind.InvoiceId == id) .ToList(); ViewBag.AccountInfo = getAccountInfoByInvoiceAccountId; ViewBag.InvoiceInfo = getInvoiceInfoById; return(View(customerInvoiceDetails)); } return(RedirectToAction("Index", "Login")); }
public IActionResult Index() { if (HttpContext.Session.GetString("AdminId") != null) { ViewBag.InvoiceDetailsList = _invoiceDetailsManager.GetAll(); return(View(_iProductManager.GetAll())); } return(RedirectToAction("Index", "Login")); }
public IActionResult Details(int?id) { if (HttpContext.Session.GetString("CustomerId") != null) { if (id == null) { return(NotFound()); } ICollection <InvoiceDetails> customerInvoiceDetails = _iInvoiceDetailsManager.GetAll() .Where(ide => ide.InvoiceId == id) .ToList(); return(View(customerInvoiceDetails)); } return(RedirectToAction("CustomerLogin", "Login")); }