public ActionResult UpdateSupplier(int supplierID) { if ((string)Session["roleName"] == "admin" || (string)Session["roleName"] == "moderator") { // create a new instance of the productViewModel SupplierViewModel _supplierViewModel = new SupplierViewModel(); // pass the supplier ID to the view method and pass to the product dataAccess //through the mapper then to the single supplier _supplierViewModel.singleSupplierPO = _mapper.Map(_supplierDataAccess.ViewOneSupplier(supplierID)); // return the view with supplierview.singleproduct return(View(_supplierViewModel.singleSupplierPO)); } return(RedirectToAction("ViewProducts")); }