// GET: Admin/Manufacturer
 public ActionResult Index()
 {
     SetActiveMenuItem();
     try
     {
         var model = ManufacturerBLL.GetManufacturerList();
         return(View(model: model));
     }
     catch (Exception ex)
     {
         TempData["ErrorMessage"] = ex.Message;
         return(Redirect("~/Admin/Home/Error"));
     }
 }
Esempio n. 2
0
        // GET: Admin/Gallery
        public ActionResult Index(int?PageNumber, int?NumberOfItems)
        {
            var _pageNumber    = 0;
            var _numberOfItems = 0;
            var result         = 0;
            var _numberOfPages = 0;

            if (int.TryParse(Convert.ToString(PageNumber), out result))
            {
                //Pagenumber was present so set it
                _pageNumber = (int)PageNumber;
            }
            else
            {
                //No page number was set so default to page 1
                _pageNumber = 1;
            }
            if (int.TryParse(Convert.ToString(NumberOfItems), out result))
            {
                //Number of items was present so set it
                _numberOfItems = (int)NumberOfItems;
            }
            else
            {
                //Number of items was not set, so default to page 1 with 8 items
                _numberOfItems = 8;
                _pageNumber    = 1;
            }

            //Retrieve gallery images
            var model = GalleryBLL.GetImageGallery(_pageNumber, _numberOfItems, out _numberOfPages);

            //Set these items to manage the pagers in the view
            ViewBag.NumberOfPages = _numberOfPages;
            ViewBag.NumberOfItems = _numberOfItems;
            ViewBag.CurrentPage   = _pageNumber;
            var ManufacturerList = ManufacturerBLL.GetManufacturerList();
            var DropDownList     = new SelectList(ManufacturerList, "Id", "Display");

            ViewBag.ManufacturerList = DropDownList;
            return(View(model));
        }
 public ActionResult Index(string searchInfo, int pageIndex = 1, int pageSize = 10, string orderBy = "", bool ascending = false)
 {
     try
     {
         var bll        = new ManufacturerBLL();
         int totalCount = 0;
         var list       = new List <WebManufacturer>();
         var cResult    = bll.GetManufacturerList(out totalCount, this.GetCurrentProjectID(), searchInfo, pageIndex, pageSize, orderBy, ascending);
         if (cResult.Code == 0)
         {
             list = cResult.Data;
         }
         var pageList = new PagedList <WebManufacturer>(list, pageIndex, pageSize, totalCount);
         ViewBag.SearchInfo = searchInfo;
         ViewBag.PageSize   = pageSize;
         return(View(pageList));
     }
     catch (Exception)
     {
     }
     return(View());
 }