Пример #1
0
        public SearchPageInfo <MenuVM> GetChildMenus(SearchPageInfo <MenuVM> search)
        {
            SearchPageInfo <MenuInfo> searchModule = search.ToModel();

            searchModule = _menuBizService.GetChildMenus(searchModule);
            return(searchModule.ToVM());
        }
        public DataTable GetProductList(int CategoryID, int PageIndex, int BrandID, decimal[] PriceRange, int OrderType, Hashtable Parameters, out int RecordCount, out int PageCount)
        {
            string where = String.Empty;

            int i = 0;

            if (Parameters != null)
            {
                foreach (string key in Parameters.Keys)
                {
                    CategoryParaModel para = new CategoryParaModelBll().GetModel(Convert.ToInt32(key), CategoryID);
                    if (i == Parameters.Count - 1)
                    {
                        where += String.Format(" and (pdproductpara.paraid = {0} and pdproductpara.paravalue like '%{1}%') ", key, para.ParaValues.Split(',')[Convert.ToInt32(Parameters[key])]);
                    }
                    else
                    {
                        where += String.Format(" and (pdproductpara.paraid = {0} and pdproductpara.paravalue like '%{1}%') ", key, para.ParaValues.Split(',')[Convert.ToInt32(Parameters[key])]);
                    }
                    i++;
                }
            }
            if (BrandID != 0)
            {
                where += " and pdproduct.brandid=" + BrandID;
            }
            if (PriceRange != null && PriceRange.Length == 2)
            {
                where += String.Format(" and pdproduct.merchantprice >= {0} and pdproduct.merchantprice <= {1}", PriceRange[0], PriceRange[1] + 0.99M);
            }

            string CategoryPath = Convert.ToString(GetCategoryInfo(CategoryID)["catepath"]);

            where += String.Format(" and pdproduct.catepath like '{0}%'", CategoryPath);
            where += " and pdproduct.status = 1";

            SearchPageInfo pageInfo = new SearchPageInfo();

            pageInfo.TableName     = "pdproductpara";
            pageInfo.PriKeyName    = "productid";
            pageInfo.FieldNames    = "pdproduct.productid,paraid,paravalue,productname,pdcategory.cateid,pdcategory.catepath,tradeprice,merchantprice,reduceprice,stock,smallimage,mediumimage,largeimage,keywords,brief,pageview,inserttime,changetime,pdproduct.status,score";
            pageInfo.TotalFieldStr = "";
            pageInfo.PageSize      = Config.ListPageSize;
            pageInfo.PageIndex     = PageIndex;
            pageInfo.OrderType     = GetOrderString(OrderType);
            pageInfo.StrWhere      = "1=1 " + where;
            pageInfo.StrJoin       = " inner join pdproduct on pdproduct.productid=pdproductpara.productid inner join pdcategory on pdproduct.cateid=pdcategory.cateid ";

            DataTable dt = CommDataHelper.GetDataFromMultiTablesByPage(pageInfo).Tables[0];

            RecordCount = pageInfo.TotalItem;
            PageCount   = pageInfo.TotalPage;

            return(dt);
        }
Пример #3
0
        public ActionResult Index(Guid id, SearchCondition searchCondition, PageInfo pageInfo, Guid?MenuIndexLevel1, Guid?MenuIndexLeve12)
        {
            //检测分页信息
            PageInfoHelper.CheckedPageInfo(pageInfo, "Sort");
            SearchPageInfo <MenuVM> search = new SearchPageInfo <MenuVM>()
            {
                PageInfo        = pageInfo,
                SearchCondition = searchCondition
            };

            Guid?parentNo = MenuIndexLeve12 ?? MenuIndexLevel1;

            if (parentNo.HasValue)
            {
                search.SearchCondition.Items.Add(new ConditionItem()
                {
                    Field  = "ParentNo",
                    Method = QueryMethod.Equal,
                    Value  = parentNo.Value
                });

                search = _moduleBizProcess.GetChildMenus(search);
            }
            else
            {
                search = _moduleBizProcess.GetMainMenus(search);
            }

            //设置分页信息到界面
            ViewData.SetPageInfo(search.PageInfo);
            //设置状态信息
            ViewBag.StatusList = DDLValueExtensions.EnumToSelectListItems <CommonStatus>(AppendItemType.All);

            //重新绑定查询信息到界面
            ViewData.ReBindSearchData(searchCondition);

            var menuLevel1 = _moduleBizProcess.GetMainMenu();

            ViewBag.MenuLevel1List = menuLevel1.ListToSelectListItems(x => { return(x.MenuName); },
                                                                      x => { return(x.SysNo.ToString()); }, AppendItemType.All);

            var menuLevel2 = new List <MenuVM>();

            if (MenuIndexLevel1.HasValue)
            {
                menuLevel2 = _moduleBizProcess.GetChildMenus(MenuIndexLevel1.Value);
            }

            ViewBag.MenuLevel2List = menuLevel2.ListToSelectListItems(x => { return(x.MenuName); },
                                                                      x => { return(x.SysNo.ToString()); }, AppendItemType.All);

            ViewBag.navId = id.ToString();
            return(View(search.DataList));
        }
        public SearchPageInfo <ExceptionLogInfo> GetLogs(SearchPageInfo <ExceptionLogInfo> search)
        {
            Check.NotNull(search, "search");
            Check.NotNull(search.PageInfo, "search.PageInfo");
            if (string.IsNullOrEmpty(search.PageInfo.OrderField))
            {
                throw ExceptionHelper.ThrowBusinessException("分页获取数据必须指定排序列");
            }

            search = _logRepository.GetPageEntities(search);
            return(search);
        }
Пример #5
0
        public SearchPageInfo <MenuInfo> GetMainMenus(SearchPageInfo <MenuInfo> search)
        {
            Check.NotNull(search, "search");
            Check.NotNull(search.PageInfo, "search.PageInfo");
            if (string.IsNullOrEmpty(search.PageInfo.OrderField))
            {
                throw ExceptionHelper.ThrowBusinessException("分页获取数据必须指定排序列");
            }

            search = _menuRepository.GetPageEntities(search, x => !x.IsLeaf && x.ParentNo.HasValue == false);

            return(search);
        }
        public SearchPageInfo <ExceptionLogInfo> GetLogs(PageInfo pageInfo)
        {
            if (string.IsNullOrEmpty(pageInfo.OrderField))
            {
                throw ExceptionHelper.ThrowBusinessException("分页获取数据必须指定排序列");
            }

            SearchPageInfo <ExceptionLogInfo> seachPage = new SearchPageInfo <ExceptionLogInfo>();

            seachPage.PageInfo = pageInfo;
            seachPage          = _logRepository.GetPageEntities(seachPage);
            return(seachPage);
        }
        /// <summary>
        /// PermissionLookup分页获取权限类别
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public SearchPageInfo <PermissionInfo> GetLookupPermissions(SearchPageInfo <PermissionInfo> search)
        {
            Check.NotNull(search, "search");
            Check.NotNull(search.PageInfo, "search.PageInfo");
            if (string.IsNullOrEmpty(search.PageInfo.OrderField))
            {
                throw ExceptionHelper.ThrowBusinessException("分页获取数据必须指定排序列");
            }

            search = _permissionRepository.GetPageEntities(search,
                                                           x => x.ParentID.HasValue == false);

            return(search);
        }
        public DataTable GetProductList(int CategoryID, int PageIndex, int BrandID, decimal[] PriceRange, int OrderType, out int RecordCount, out int PageCount)
        {
            SearchPageInfo pageinfo = new SearchPageInfo();

            string CategoryPath = Convert.ToString(GetCategoryInfo(CategoryID)["catepath"]);

            string where = String.Format(" catepath like '{0}%'", CategoryPath);
            where       += " and status = " + (int)ProductStatus.架;

            if (BrandID != 0)
            {
                where += " and pdproduct.brandid=" + BrandID;
            }
            if (PriceRange != null && PriceRange.Length == 2)
            {
                if (PriceRange[1] == 0)
                {
                    where += String.Format(" and pdproduct.merchantprice >= {0} ", PriceRange[0]);
                }
                else
                {
                    where += String.Format(" and pdproduct.merchantprice >= {0} and pdproduct.merchantprice <= {1}", PriceRange[0], PriceRange[1] + 0.99M);
                }
            }


            pageinfo.FieldNames    = "[ProductId],[ProductName],[ProductCode],[CatePath],[CateId],[TradePrice],[MerchantPrice],[ReducePrice],[Stock],[SmallImage],[MediumImage],[LargeImage],[Keywords],[Brief],[PageView],[InsertTime],[ChangeTime],[Status],[SortValue],[Score]";
            pageinfo.OrderType     = "SortValue asc";
            pageinfo.PageIndex     = PageIndex;
            pageinfo.PageSize      = Config.ListPageSize;
            pageinfo.PriKeyName    = "ProductId";
            pageinfo.StrWhere      = where;
            pageinfo.TableName     = "pdproduct";
            pageinfo.OrderType     = GetOrderString(OrderType);
            pageinfo.TotalFieldStr = "";
            pageinfo.TotalItem     = 0;
            pageinfo.TotalPage     = 0;

            DataTable dt = CommDataHelper.GetDataFromSingleTableByPage(pageinfo).Tables[0];

            RecordCount = pageinfo.TotalItem;
            PageCount   = pageinfo.TotalPage;

            return(dt);
        }
        public DataSet GetList(int PageIndex, int PageSize, string Condition, out int RecordCount)
        {
            SearchPageInfo info = new SearchPageInfo();

            info.FieldNames = "*";
            info.OrderType = " showorder desc";
            info.PageIndex = PageIndex;
            info.PageSize = PageSize;
            info.PriKeyName = "brandid";
            info.StrJoin = "";
            info.StrWhere = " 1=1 " + Condition;
            info.TableName = "pdbrand";
            info.TotalFieldStr = "";

            DataSet ds = CommDataHelper.GetDataFromSingleTableByPage(info);

            RecordCount = info.TotalItem;

            return ds;
        }
Пример #10
0
        public DataTable GetList(int PageIndex, int PageSize, string Condition, out int RecordCount)
        {
            SearchPageInfo info = new SearchPageInfo();

            info.FieldNames    = "*";
            info.OrderType     = " newsid desc";
            info.PageIndex     = PageIndex;
            info.PageSize      = PageSize;
            info.PriKeyName    = "newsid";
            info.StrJoin       = "";
            info.StrWhere      = " 1=1 " + Condition;
            info.TableName     = "nenews";
            info.TotalFieldStr = "";

            DataTable dt = CommDataHelper.GetDataFromSingleTableByPage(info).Tables[0];

            RecordCount = info.TotalItem;

            return(dt);
        }
Пример #11
0
        public ActionResult PermissionLookup(Guid id, SearchCondition searchCondition, PageInfo pageInfo)
        {
            //检测分页信息
            PageInfoHelper.CheckedPageInfo(pageInfo, "PermissionController");
            SearchPageInfo <PermissionVM> search = new SearchPageInfo <PermissionVM>()
            {
                PageInfo        = pageInfo,
                SearchCondition = searchCondition
            };

            search = _permissionBizProcess.GetLookupPermissions(search);

            //设置分页信息到界面
            ViewData.SetPageInfo(search.PageInfo);
            //设置状态信息
            ViewBag.StatusList = DDLValueExtensions.EnumToSelectListItems <CommonStatus>(AppendItemType.All);
            //重新绑定查询信息到界面
            ViewData.ReBindSearchData(searchCondition);

            ViewBag.navId = id.ToString();
            return(View(search.DataList));
        }
Пример #12
0
        public ActionResult Index(Guid id, SearchCondition searchCondition, PageInfo pageInfo)
        {
            //检测分页信息
            PageInfoHelper.CheckedPageInfo(pageInfo, "CreateDate", SortOrder.desc);
            SearchPageInfo <SysUserVM> search = new SearchPageInfo <SysUserVM>()
            {
                PageInfo        = pageInfo,
                SearchCondition = searchCondition
            };

            search = _accountBizProcess.GetSysUsers(search);

            //设置分页信息到界面
            ViewData.SetPageInfo(search.PageInfo);
            //设置状态信息
            ViewBag.StatusList = DDLValueExtensions.EnumToSelectListItems <CommonStatus>(AppendItemType.All);

            //重新绑定查询信息到界面
            ViewData.ReBindSearchData(searchCondition);

            ViewBag.navId = id.ToString();
            return(View(search.DataList));
        }
        public DataTable GetNewsList(int PageIndex, int PageSize, int CategoryID, out int RecordCount, out int PageCount)
        {
            SearchPageInfo pageinfo = new SearchPageInfo();

            string where = String.Format(" dbo.GetNewsCategoryPath(cateid)+'/' like dbo.GetNewsCategoryPath({0})+'/%'", CategoryID);

            pageinfo.FieldNames    = "*";
            pageinfo.OrderType     = "newsid desc";
            pageinfo.PageIndex     = PageIndex;
            pageinfo.PageSize      = PageSize;
            pageinfo.PriKeyName    = "newsid";
            pageinfo.StrWhere      = where;
            pageinfo.TableName     = "nenews";
            pageinfo.TotalFieldStr = "";
            pageinfo.TotalItem     = 0;
            pageinfo.TotalPage     = 0;

            DataTable dt = CommDataHelper.GetDataFromSingleTableByPage(pageinfo).Tables[0];

            RecordCount = pageinfo.TotalItem;
            PageCount   = pageinfo.TotalPage;

            return(dt);
        }
Пример #14
0
 public static SearchPageInfo <ExceptionLogVM> ToVM(this SearchPageInfo <ExceptionLogInfo> searchModule)
 {
     return(AutoMapper.Mapper.Map <SearchPageInfo <ExceptionLogVM> >(searchModule));
 }
Пример #15
0
        /// <summary>
        /// PermissionLookup分页获取权限类别
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public SearchPageInfo <PermissionVM> GetLookupPermissions(SearchPageInfo <PermissionVM> search)
        {
            SearchPageInfo <PermissionInfo> whereSearch = search.ToModel();

            return(_permissionBizService.GetLookupPermissions(whereSearch).ToVM());
        }
Пример #16
0
        /// <summary>
        /// 分页获取角色类别
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public SearchPageInfo <RoleVM> GetRoles(SearchPageInfo <RoleVM> search)
        {
            SearchPageInfo <RoleInfo> whereSearch = search.ToModel();

            return(_roleBizService.GetRoles(whereSearch).ToVM());
        }
Пример #17
0
 public static SearchPageInfo <MenuInfo> ToModel(this SearchPageInfo <MenuVM> searchMenu)
 {
     return(AutoMapper.Mapper.Map <SearchPageInfo <MenuInfo> >(searchMenu));
 }
Пример #18
0
 public static SearchPageInfo <MenuVM> ToVM(this SearchPageInfo <MenuInfo> searchModule)
 {
     return(AutoMapper.Mapper.Map <SearchPageInfo <MenuVM> >(searchModule));
 }
Пример #19
0
 public static SearchPageInfo <PermissionVM> ToVM(this SearchPageInfo <PermissionInfo> searchModule)
 {
     return(AutoMapper.Mapper.Map <SearchPageInfo <PermissionVM> >(searchModule));
 }
Пример #20
0
 public static SearchPageInfo <ExceptionLogInfo> ToModel(this SearchPageInfo <ExceptionLogVM> searchMenu)
 {
     return(AutoMapper.Mapper.Map <SearchPageInfo <ExceptionLogInfo> >(searchMenu));
 }
Пример #21
0
        /// <summary>
        /// 分页获取权限类别
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public SearchPageInfo <SysUserVM> GetSysUsers(SearchPageInfo <SysUserVM> search)
        {
            SearchPageInfo <SysUserInfo> whereSearch = search.ToModel();

            return(_sysUserBizService.GetSysUsers(whereSearch).ToVM());
        }