public ActionResult Index() { var supplierGroups = supplierGroupBll.GetAllSupplierGroups(); var viewModel = supplierGroups.Select(g => SupplierGroupViewModel.FromSupplierGroup(g)); return(View(viewModel)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var supplierGroup = supplierGroupBll.GetSupplierGroup(id.Value); if (supplierGroup == null) { return(HttpNotFound()); } var viewModel = SupplierGroupViewModel.FromSupplierGroup(supplierGroup); return(View(viewModel)); }