public ActionResult Search([Bind(Include = "PartNr, SourceType, State")] UnDoneStockSearchModel q)
        {
            int pageIndex = 0;

            int.TryParse(Request.QueryString.Get("page"), out pageIndex);
            pageIndex = PagingHelper.GetPageIndex(pageIndex);

            IUnDoneStockService uss = new UnDoneStockService(Settings.Default.db);

            IPagedList <UnDoneStock> undoneStocks = uss.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize);

            ViewBag.Query = q;
            SetPartTypeList(q.SourceType);
            SetUnDoneStockStateList(q.State);

            return(View("Index", undoneStocks));
        }
        public ActionResult Index(int?page)
        {
            int pageIndex = PagingHelper.GetPageIndex(page);

            UnDoneStockSearchModel q = new UnDoneStockSearchModel();

            IUnDoneStockService uss = new UnDoneStockService(Settings.Default.db);

            IPagedList <UnDoneStock> undonestocks = uss.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize);

            ViewBag.Query = q;

            SetPartTypeList(null);
            SetUnDoneStockStateList(null);

            return(View(undonestocks));
        }