Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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"));
            }
        }