public ActionResult AllBrands()// <--method { ViewBag.Message = "All Brands"; BrandsViewModel viewModel = new BrandsViewModel();//gives me acces to this class viewModel.AllBrands = mapper.Map(brandDAL.GetBrands()); return(View(viewModel)); }
public void frmBrands_Load(object sender, System.EventArgs e) { DataTable dt = BrandDataAccess.GetBrands(); if (dt != null) { this.brandGridView.DataSource = dt; FormatGrid(ref this.brandGridView); } }
public ActionResult CreateProduct() { ProductsViewModel viewModel = new ProductsViewModel(); viewModel.AllSuppliers = mapper.Map(SuppliersDAL.GetSuppliers()); viewModel.AllBrands = mapper.Map(BrandsDAL.GetBrands()); viewModel.AllCategories = mapper.Map(CategoriesDAL.GetAllCategories()); switch ((int)Session["RoleID"]) { case 3: return(View(viewModel)); case 4: return(View(viewModel)); default: return(RedirectToAction("Index", "Home")); } }