Exemplo n.º 1
0
        // GET: Admin/Vendor
        public ActionResult Index(string SearchName = null, string SearchEmail = null, int page = 1, int pageSize = 10)
        {
            var vendorDao = new VendorDao();
            var model     = vendorDao.GetVendors(SearchName, SearchEmail, page, pageSize);

            ViewBag.SearchName  = SearchName;
            ViewBag.SearchEmail = SearchEmail;
            return(View(model));
        }
Exemplo n.º 2
0
        public void SetViewBag(int?selectedId = null)
        {
            var customerRoleDao = new CustomerRoleDao();
            var customerRoles   = customerRoleDao.ListAll();

            Vendor vendor = new Vendor
            {
                Name = "Not a vendor",
                Id   = 0,
            };
            var vendorDao = new VendorDao();
            var vendors   = vendorDao.GetVendors();

            vendors.Add(vendor);

            ViewBag.AvailableCustomerRoles = new SelectList(customerRoles, "Id", "Name", selectedId);
            ViewBag.AvailableVendors       = new SelectList(vendors, "Id", "Name", selectedId);
        }