Exemplo n.º 1
0
        private ListNews SearchNews(SearchNewsRequest request)
        {
            var     total     = 0;
            var     ds        = _newsDa.Search(request, ref total);
            var     lstNew    = CBO.Fill2ListFromDataSet <News>(ds, typeof(News));
            decimal totalPage = Math.Ceiling(((decimal)total / (decimal)ConfigInfo.RecordOnPage));
            var     paging    = HtmlControllHelpers.WritePaging(totalPage, request.CurrentPage, total, ConfigInfo.RecordOnPage, "Tin tức");
            var     listNews  = new ListNews
            {
                Start       = request.Start,
                Collection  = lstNew,
                Paging      = paging,
                TotalRecord = total,
                TotalPage   = totalPage,
                CurrentPage = request.CurrentPage
            };

            return(listNews);
        }
Exemplo n.º 2
0
        private ListProject SearchProject(SearchProjectRequest request)
        {
            var total     = 0;
            var ds        = _projectDa.Search(request, ref total);
            var lstNew    = CBO.Fill2ListFromDataSet <Project>(ds, typeof(Project));
            var totalPage = Math.Ceiling(((decimal)total / ConfigInfo.RecordOnPage));
            var paging    = HtmlControllHelpers.WritePaging(totalPage, request.CurrentPage, total, ConfigInfo.RecordOnPage, "Công trình");
            var listNews  = new ListProject()
            {
                Start       = request.Start,
                Collection  = lstNew,
                Paging      = paging,
                TotalRecord = total,
                TotalPage   = totalPage,
                CurrentPage = request.CurrentPage
            };

            return(listNews);
        }
Exemplo n.º 3
0
        private ListProducts FindProduct(SearchProductRequest request)
        {
            var total           = 0;
            var ds              = _productDa.SearchProduct(request, ref total);
            var lstGroupProduct = CBO.Fill2ListFromDataSet <Products>(ds, typeof(Products));
            var totalPage       = Math.Ceiling(((decimal)total / ConfigInfo.RecordOnPage));
            var paging          = HtmlControllHelpers.WritePaging(totalPage, request.CurrentPage, total, ConfigInfo.RecordOnPage,
                                                                  "nhóm sản phẩm");
            var listGroupProducts = new ListProducts()
            {
                Start       = request.Start,
                Collection  = lstGroupProduct,
                Paging      = paging,
                TotalRecord = total,
                TotalPage   = totalPage,
                CurrentPage = request.CurrentPage
            };

            return(listGroupProducts);
        }
        private ListColorWarehouse SearchColorWarehouse(SearchColorWarehouseRequest request)
        {
            var total = 0;
            var ds    = _colorWarehouseDa.Search(request, ref total);
            //var lstNew = CBO.Fill2ListFromDataSet<Project>(ds, typeof(Project));
            var lstNew = CBO <ColorWarehouse> .FillCollectionFromDataSet(ds);

            var totalPage = Math.Ceiling((decimal)total / ConfigInfo.RecordOnPage);
            var paging    = HtmlControllHelpers.WritePaging(totalPage, request.CurrentPage, total, ConfigInfo.RecordOnPage,
                                                            "bản ghi");
            var listNews = new ListColorWarehouse()
            {
                Start       = request.Start,
                Collection  = lstNew,
                Paging      = paging,
                TotalRecord = total,
                TotalPage   = totalPage,
                CurrentPage = request.CurrentPage
            };

            return(listNews);
        }