public void frmSuppliers_Load(object sender, System.EventArgs e)
        {
            DataTable dt = SupplierDataAccess.GetSuppliers();

            if (dt != null)
            {
                this.supplierDataGridView.DataSource = dt;
                FormatGrid(ref this.supplierDataGridView);
            }
        }
        // GET: Suppliers
        public ActionResult AllSuppliers()
        {
            SupplierViewModel viewModel = new SupplierViewModel();

            switch ((int)Session["RoleID"])
            {
            case 2:
                viewModel.AllSuppliers = mapper.Map(SuppliersDAL.GetSuppliers());
                return(View(viewModel));

            case 3:
                viewModel.AllSuppliers = mapper.Map(SuppliersDAL.GetSuppliers());
                return(View(viewModel));

            case 4:
                viewModel.AllSuppliers = mapper.Map(SuppliersDAL.GetSuppliers());
                return(View(viewModel));

            default:
                return(RedirectToAction("Index", "Home"));
            }
        }
        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"));
            }
        }
Beispiel #4
0
 public IList GetSuppliers()
 {
     return(_supplierDataAccess.GetSuppliers());
 }