Esempio n. 1
0
        /// <summary>
        /// 加载最新公告节点
        /// </summary>
        /// <returns></returns>
        public ActionResult Announcement([DataSourceRequest] DataSourceRequest request)
        {
            if (request.Page <= 0)
            {
                request.Page = 1;
            }

            if (request.PageSize == 0)
            {
                request.PageSize = 10;
            }
            try
            {
                var condition = "[Type]=2";
                int pageCount;
                int totalCount;
                this.configPageService = new ConfigPageService();
                var paging = new Paging("[Config_Page]", null, "ID", condition, request.Page, request.PageSize, "CreateTime", 1);
                var list = this.configPageService.Paging(paging, out pageCount, out totalCount);

                var data = new DataSource
                {
                    Data = list,
                    Total = totalCount
                };
                return Json(data);
            }
            catch (Exception exception)
            {
                TextLogger.Instance.Log("查询出错", Category.Error, exception);
            }
            return this.Json(string.Empty, JsonRequestBehavior.AllowGet);
        }
Esempio n. 2
0
        /// <summary>
        /// 查询系统用户列表执行方法
        /// </summary>
        /// <param name="request">
        /// 数据源请求信息对象
        /// </param>
        /// <returns>
        /// 执行方法结果
        /// </returns>
        public ActionResult QueryLog([DataSourceRequest] DataSourceRequest request)
        {
            this.systemLogService = new SystemLogService();

            int pageCount;
            int totalCount;

            if (request.Page <= 0)
            {
                request.Page = 1;
            }

            var paging = new Paging("[System_Log]", null, "ID", null, request.Page, request.PageSize);

            var list = this.systemLogService.Query(paging, out pageCount, out totalCount);
            if (list == null)
            {
                return this.View();
            }

            var modelList = new List<System_Log>();
            foreach (var systemRole in list)
            {
                modelList.Add(DataTransfer.Transfer<System_Log>(systemRole, typeof(System_Log)));
            }

            var result = new DataSourceResult { Data = modelList, Total = totalCount };
            return this.Json(result, JsonRequestBehavior.AllowGet);
        }
Esempio n. 3
0
        /// <summary>
        /// The query product sold out.
        /// </summary>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="productName">
        /// The product name.
        /// </param>
        /// <param name="barcode">
        /// The barcode.
        /// </param>
        /// <param name="parentCategoryID">
        /// The parent category id.
        /// </param>
        /// <param name="productCategoryID">
        /// The product category id.
        /// </param>
        /// <param name="parentBrandID">
        /// The parent brand id.
        /// </param>
        /// <param name="productBrandID">
        /// The product brand id.
        /// </param>
        /// <param name="minPrice">
        /// The min price.
        /// </param>
        /// <param name="maxPrice">
        /// The max price.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult QueryProductOnSale([DataSourceRequest] DataSourceRequest request, string productName, string barcode, string parentCategoryID, string productCategoryID, string parentBrandID, string productBrandID, string minPrice, string maxPrice)
        {
            int totalCount;

            var stringBuilder = new StringBuilder();
            stringBuilder.Append("[Status] = 2");

            if (!string.IsNullOrEmpty(productName))
            {
                stringBuilder.Append(string.Format(" And [Name] like '%{0}%' ", productName));
            }

            if (!string.IsNullOrEmpty(barcode))
            {
                stringBuilder.Append(string.Format(" And [Barcode] like '%{0}%' ", barcode));
            }

            if (!string.IsNullOrEmpty(parentCategoryID) && parentCategoryID != "-1")
            {
                stringBuilder.Append(string.Format(" And [ParentCategoryID] = {0} ", parentCategoryID));
            }

            if (!string.IsNullOrEmpty(productCategoryID) && productCategoryID != "-1")
            {
                stringBuilder.Append(string.Format(" And [ProductCategoryID] = {0} ", productCategoryID));
            }

            if (!string.IsNullOrEmpty(parentBrandID) && parentBrandID != "-1")
            {
                stringBuilder.Append(string.Format(" And [ParentBrandID] = {0} ", parentBrandID));
            }

            if (!string.IsNullOrEmpty(productBrandID) && productBrandID != "-1")
            {
                stringBuilder.Append(string.Format(" And [ProductBrandID] = '{0}' ", productBrandID));
            }

            if (!string.IsNullOrEmpty(minPrice))
            {
                stringBuilder.Append(string.Format(" And [GoujiuPrice] >= '{0}' ", minPrice));
            }

            if (!string.IsNullOrEmpty(maxPrice))
            {
                stringBuilder.Append(string.Format(" And [GoujiuPrice] <= '{0}' ", maxPrice));
            }

            var condition = stringBuilder.ToString();
            var paging = new Paging("view_Product_Paging", null, "ID", condition, request.Page, request.PageSize, "CreateTime", 1);

            var productSearchResultModelList = new List<ProductSearchResultModel>();

            try
            {
                int pageCount;
                var searchResult = this.ProductService.Query(paging, out pageCount, out totalCount);
                if (searchResult != null)
                {
                    foreach (var productSearchResult in searchResult)
                    {
                        var item = DataTransfer.Transfer<ProductSearchResultModel>(
                            productSearchResult,
                            typeof(ProductSearchResult));

                        productSearchResultModelList.Add(item);
                    }
                }
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }

            var result = new DataSourceResult { Data = productSearchResultModelList, Total = totalCount };
            return this.Json(result);
        }
 /// <summary>
 /// 查询会员促销列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 会员促销列表
 /// </returns>
 public List<Promote_Vip> Query(Paging paging, out int pageCount, out int totalCount)
 {
     return this.promoteVipDA.Paging(paging, out pageCount, out totalCount);
 }
        /// <summary>
        /// 限时抢购.
        /// </summary>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="promoteName">
        /// 限时抢购促销名称.
        /// </param>
        /// <param name="startStartTime">
        /// 活动开始时间范围起始时间.
        /// </param>
        /// <param name="startEndTime">
        /// 活动开始时间范围结束时间.
        /// </param>
        /// <param name="endStartTime">
        /// 活动结束时间范围起始时间.
        /// </param>
        /// <param name="endEndTime">
        /// 活动结束时间范围结束时间.
        /// </param>
        /// <param name="searchStatus">
        /// The search Status.
        /// </param>
        /// <returns>
        /// The <see cref="JsonResult"/>.
        /// </returns>
        public JsonResult QueryLimitedDiscount(
           [DataSourceRequest] DataSourceRequest request,
           string promoteName,
           string productName,
           string startStartTime,
           string startEndTime,
           string endStartTime,
           string endEndTime,
            string searchStatus)
        {
            this.promoteLimitedDiscountService = new PromoteLimitedDiscountService();
            if (request.Page <= 0)
            {
                request.Page = 1;
            }

            if (request.PageSize == 0)
            {
                request.PageSize = 10;
            }

            int totalCount;
            var stringBuilder = new StringBuilder();

            if (!string.IsNullOrEmpty(promoteName))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("[Name] like '%" + promoteName + "%'");
            }

            if (!string.IsNullOrEmpty(productName))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("[ProductName] like '%" + productName + "%'");
            }

            if (!string.IsNullOrEmpty(startStartTime))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("[StartTime] >= '" + startStartTime + "'");
            }

            if (!string.IsNullOrEmpty(startEndTime))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("[StartTime] <= '" + startEndTime + "'");
            }

            if (!string.IsNullOrEmpty(endStartTime))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("[EndTime] >= '" + endStartTime + "'");
            }

            if (!string.IsNullOrEmpty(endEndTime))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("[EndTime] <= '" + endEndTime + "'");
            }

            switch (searchStatus)
            {
                case "1":
                    CheckCondition(stringBuilder);
                    stringBuilder.Append("[StartTime] > '" + DateTime.Now + "'");
                    break;
                case "2":
                    CheckCondition(stringBuilder);
                    stringBuilder.Append("'" + DateTime.Now + "' Between [StartTime] And [EndTime]");
                    break;
                case "3":
                    CheckCondition(stringBuilder);
                    stringBuilder.Append("([EndTime] < '" + DateTime.Now + "' or [Status] = 3)");
                    break;
            }

            var condition = stringBuilder.ToString();
            List<Promote_Limited_Discount> list;
            try
            {
                var paging = new Paging(
                    "[view_Promote_Limited_Discount]",
                    null,
                    "[ID]",
                    condition,
                    request.Page,
                    request.PageSize,
                    "[CreateTime]",
                    1);
                int pageCount;
                list = this.promoteLimitedDiscountService.Query(paging, out pageCount, out totalCount);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }

            if (list != null)
            {
                var modelList = new List<PromoteLimitedDiscountModel>();
                foreach (var limitedDiscount in list)
                {
                    modelList.Add(
                        DataTransfer.Transfer<PromoteLimitedDiscountModel>(limitedDiscount, typeof(Promote_Limited_Discount)));
                }

                var data = new DataSource { Data = modelList, Total = totalCount };
                return this.Json(data, JsonRequestBehavior.AllowGet);
            }

            return this.Json(string.Empty);
        }
 /// <summary>
 /// 查询满减券绑定列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 满减券绑定列表
 /// </returns>
 public List<Coupon_Decrease_Binding> Paging(Paging paging, out int pageCount, out int totalCount)
 {
     return this.SqlServer.Paging<Coupon_Decrease_Binding>(paging, out pageCount, out totalCount, null);
 }
 /// <summary>
 /// 查询多瓶装促销列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 多瓶装列表
 /// </returns>
 public List<Promote_MuchBottled> Paging(Paging paging, out int pageCount, out int totalCount)
 {
     return this.SqlServer.Paging<Promote_MuchBottled>(paging, out pageCount, out totalCount, null);
 }
 /// <summary>
 /// 查询系统权限列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 系统权限列表
 /// </returns>
 public List<System_Permission> Query(Paging paging, out int pageCount, out int totalCount)
 {
     return this.systemPermissionDA.Paging(paging, out pageCount, out totalCount);
 }
        /// <summary>
        /// The query product attribute.
        /// </summary>
        /// <param name="categoryID">
        /// The category ID.
        /// </param>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult QueryAttribute(string categoryID, [DataSourceRequest] DataSourceRequest request)
        {
            if (request.PageSize == 0)
            {
                request.PageSize = 10;
            }

            DataSourceResult result;
            try
            {
                var condition = "1 = 1";
                if (!string.IsNullOrEmpty(categoryID) && categoryID != "-1")
                {
                    condition += string.Format(" and [ProductCategoryID] = {0} ", categoryID);
                }

                var paging = new Paging("[Product_Attribute]", null, "ID", condition, request.Page, request.PageSize);
                int pageCount;
                int totalCount;
                var list = this.ProductAttributeService.Query(paging, out pageCount, out totalCount);
                result = new DataSourceResult();

                if (list != null)
                {
                    var modelList = new List<ProductAttributeModel>();
                    foreach (var product in list)
                    {
                        modelList.Add(
                            DataTransfer.Transfer<ProductAttributeModel>(product, typeof(Product_Attribute)));
                    }

                    result.Data = modelList;
                    result.Total = totalCount;

                    return Json(result);
                }

                result.Data = null;
                result.Total = 0;
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }

            return Json(result);
        }
Esempio n. 10
0
 /// <summary>
 /// 查询用户列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 用户列表
 /// </returns>
 public List<System_Log> Paging(Paging paging, out int pageCount, out int totalCount)
 {
     try
     {
         return this.SqlServer.Paging<System_Log>(paging, out pageCount, out totalCount, null);
     }
     catch (Exception exception)
     {
         throw new Exception(exception.Message, exception);
     }
 }
        public JsonResult ViewPaging([DataSourceRequest] DataSourceRequest request, string condition)
        {
            int totalCount;
            List<View_GroupBuy_Product> list;
            this.channelGroupBuyService = new ChannelGroupBuyService();
            try
            {
                var paging = new Paging("view_GroupBuy_Product", null, "ProductId", condition, request.Page, request.PageSize);
                int pageCount;
                list = this.channelGroupBuyService.Query(paging, out pageCount, out totalCount);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }

            var modelList = new List<ViewGroupBuyProductModel>();
            if (list != null)
            {
                foreach (var viewGroupBuyProduct in list)
                {
                    modelList.Add(DataTransfer.Transfer<ViewGroupBuyProductModel>(viewGroupBuyProduct, typeof(View_GroupBuy_Product)));

                }
            }

            var data = new DataSource
            {
                Data = modelList,
                Total = totalCount
            };
            return this.Json(data, JsonRequestBehavior.AllowGet);
        }
        /// <summary>
        /// 根据ProductID查询商品的团购信息
        /// </summary>
        /// <param name="productId">ProductID</param>
        /// <returns></returns>
        public PartialViewResult QueryChannelGroupByProductId(string productId)
        {
            string condition = string.Empty;
            if (!string.IsNullOrEmpty(productId))
            {
                condition = "ProductId=" + productId + string.Empty;
            }
            try
            {
                int totalCount = -1;
                int totalPage = -1;
                this.channelGroupBuyService = new ChannelGroupBuyService();
                var paging = new Paging("view_GroupBuy_Product", null, "ProudtcId", condition, 1, 1);
                var list = this.channelGroupBuyService.Query(paging, out totalCount, out totalPage);
                var ModelList = new List<ViewGroupBuyProductModel>();
                if (list != null && list.Any())
                {
                    foreach (var viewGroupBuyProduct in list)
                    {
                        ModelList.Add(DataTransfer.Transfer<ViewGroupBuyProductModel>(viewGroupBuyProduct, typeof(View_GroupBuy_Product)));
                    }
                }
                ViewGroupBuyProductModel singleModel = ModelList.FirstOrDefault();
                return this.PartialView("QueryChannelGroupByProductId", singleModel);
            }
            catch (Exception exception)
            {

                throw new ArgumentNullException(exception.Message, exception);
            }
        }
 /// <summary>
 /// 查询满就送促销列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 满就送列表
 /// </returns>
 public List<Promote_MeetMoney> Paging(Paging paging, out int pageCount, out int totalCount)
 {
     return this.SqlServer.Paging<Promote_MeetMoney>(paging, out pageCount, out totalCount, null);
 }
        /// <summary>
        /// LP活动列表.
        /// </summary>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="filterYear">
        /// The filter Year.
        /// </param>
        /// <param name="filterMonth">
        /// The filter Month.
        /// </param>
        /// <returns>
        /// The <see cref="JsonResult"/>.
        /// </returns>
        public JsonResult QueryLandingPage(
            [DataSourceRequest] DataSourceRequest request,
            string filterYear,
            string filterMonth)
        {
            this.promoteLandingPageService = new PromoteLandingPageService();

            if (request.Page <= 0)
            {
                request.Page = 1;
            }

            var stringBuilder = new StringBuilder();

            if (!string.IsNullOrEmpty(filterYear))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("DATEDIFF(yyyy,CreateTime,'" + filterYear + "')=0");
            }

            if (!string.IsNullOrEmpty(filterMonth))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("DATEDIFF(mm,CreateTime,'" + filterMonth + "-1')=0"); // (-1补全日期)
            }

            CheckCondition(stringBuilder);
            stringBuilder.Append("[IsDelete] = 0");
            var condition = stringBuilder.ToString();
            try
            {
                var paging = new Paging("[Promote_LandingPage]", null, "ID", condition, request.Page, request.PageSize, "CreateTime", 1);

                int pageCount;
                int totalCount;
                var list = this.promoteLandingPageService.QueryList(paging, out pageCount, out totalCount);
                if (list == null)
                {
                    return this.Json(null);
                }

                var modelList = new List<PromoteLandingPageModel>();
                foreach (var userLevelPrice in list)
                {
                    var model = DataTransfer.Transfer<PromoteLandingPageModel>(
                        userLevelPrice,
                        typeof(Promote_LandingPage));
                    if (model.EndTime > DateTime.Now)
                    {
                        switch (model.Status)
                        {
                            case 1:
                                model.StatusName = "正常";
                                break;
                            case 2:
                                model.StatusName = "暂停";
                                break;
                            case 3:
                                model.StatusName = "停止";
                                break;
                        }
                    }
                    else
                    {
                        model.StatusName = "过期";
                    }

                    modelList.Add(model);
                }

                var result = new DataSourceResult { Data = modelList, Total = totalCount };
                return this.Json(result, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }
        }
Esempio n. 15
0
 /// <summary>
 /// 商品查询分页方法
 /// </summary>
 /// <param name="paging">
 /// 分页对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 商品查询结果列表
 /// </returns>
 public List<int> QueryProductID(Paging paging, out int pageCount, out int totalCount)
 {
     return this.productDA.SelectProductID(paging, out pageCount, out totalCount);
 }
Esempio n. 16
0
        public JsonResult GetProductSubCategory(string parentCategoryID)
        {
            int totalCount;
            int pageCount;

            var condition = string.Format("ParentID = {0} And layer = 2 ", parentCategoryID);
            var paging = new Paging("[Product_Category]", null, "ID", condition, 1, 100);
            var list = this.ProductCategoryService.Query(paging, out pageCount, out totalCount);
            if (list == null || list.Count == 0) return null;

            var query = from p in list
                        select new
                        {
                            id = p.ID,
                            name = p.CategoryName
                        };
            return this.Json(query);
        }
        /// <summary>
        /// 获取链接的值
        /// </summary>
        /// <param name="request"></param>
        /// <param name="brandId"></param>
        /// <returns></returns>
        public ActionResult QueryBrandLinkSource([DataSourceRequest] DataSourceRequest request, int brandId)
        {
            try
            {
                string condidtion = "Type=4 And PID=" + brandId.ToString() + "";
                var paging = new Paging("Config_Page", null, "ID", condidtion, request.Page, request.PageSize);
                int pageCount;
                int totalCount;
                this.configPageService = new ConfigPageService();
                var list = this.configPageService.Paging(paging, out pageCount, out totalCount);
                var data = new DataSource
                {
                    Data = list,
                    Total = totalCount,
                    TotalPages = pageCount
                };
                return Json(data, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {

                throw new Exception(exception.Message, exception);
            }
        }
Esempio n. 18
0
        /// <summary>
        /// The query product attribute value.
        /// </summary>
        /// <param name="productAttrID">
        /// The product attr id.
        /// </param>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult QueryAttributeValue(string productAttrID, [DataSourceRequest] DataSourceRequest request)
        {
            DataSourceResult result;
            try
            {
                int totalCount;
                int pageCount;

                if (request.PageSize == 0)
                {
                    request.PageSize = 10;
                }

                string condition = string.Format("AttributeID = {0}", productAttrID);

                var paging = new Paging("[Product_AttributeValue]", null, "ID", condition, request.Page,
                    request.PageSize);

                var list = this.ProductAttributeValueService.Query(paging, out pageCount, out totalCount);
                result = new DataSourceResult();

                if (list != null)
                {
                    var modelList = new List<ProductAttributeValueModel>();

                    foreach (var product in list)
                    {
                        modelList.Add(
                            DataTransfer.Transfer<ProductAttributeValueModel>(product, typeof(Product_AttributeValue)));
                    }

                    result.Data = modelList;
                    result.Total = totalCount;
                    return Json(result);
                }

                result.Data = null;
                result.Total = 0;
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }

            return Json(result);
        }
Esempio n. 19
0
 /// <summary>
 /// 查询分页列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 查询结果
 /// </returns>
 public List<Order_Product> Paging(Paging paging, out int pageCount, out int totalCount)
 {
     paging.TableName = "view_Order_Products";
     return this.SqlServer.Paging<Order_Product>(paging, out pageCount, out totalCount, null);
 }
 /// <summary>
 /// 查询满就送促销列表
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// 满就送列表
 /// </returns>
 public List<Promote_MeetMoney> Query(Paging paging, out int pageCount, out int totalCount)
 {
     return this.promoteMeetMoneyDA.Paging(paging, out pageCount, out totalCount);
 }
 /// <summary>
 /// The query.
 /// </summary>
 /// <param name="paging">
 /// The paging.
 /// </param>
 /// <param name="pageCount">
 /// The page count.
 /// </param>
 /// <param name="totalCount">
 /// The total count.
 /// </param>
 /// <returns>
 /// The.
 /// </returns>
 public List<Product_AttributeValue> Query(Paging paging, out int pageCount, out int totalCount)
 {
     return this.productAttributeValueDA.Paging(paging, out pageCount, out totalCount);
 }
Esempio n. 22
0
        /// <summary>
        /// 查询子权限列表
        /// </summary>
        /// <param name="request">
        /// 数据源请求信息对象
        /// </param>
        /// <param name="permissionID">
        /// 上级权限编号
        /// </param>
        /// <returns>
        /// 执行方法结果
        /// </returns>
        public ActionResult QueryPermissionByID([DataSourceRequest] DataSourceRequest request, int permissionID)
        {
            this.systemPermissionService = new SystemPermissionService();

            int pageCount;
            int totalCount;

            var paging = new Paging("[System_Permission]", null, "ID", string.Format("ParentID = {0}", permissionID), request.Page, request.PageSize);

            var list = this.systemPermissionService.Query(paging, out pageCount, out totalCount);

            if (request.Page <= 0)
            {
                request.Page = 1;
            }

            if (list == null)
            {
                return this.View();
            }

            var permissionModels = new List<PermissionModel>();

            foreach (var systemPermission in list)
            {
                permissionModels.Add(DataTransfer.Transfer<PermissionModel>(systemPermission, typeof(System_Permission)));
            }

            var result = new DataSourceResult { Data = permissionModels, Total = totalCount };
            return this.Json(result, JsonRequestBehavior.AllowGet);
        }
 /// <summary>
 /// 分页查询
 /// </summary>
 /// <param name="paging"></param>
 /// <param name="pageCount"></param>
 /// <param name="totalCount"></param>
 /// <returns></returns>
 public List<Advertise_Config> Paging(Paging paging, out int pageCount, out int totalCount)
 {
     return this.advertiseConfigDA.Paging(paging, out pageCount, out totalCount);
 }
Esempio n. 24
0
        /// <summary>
        /// The query select list.
        /// </summary>
        /// <param name="id">
        /// The id.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult QueryPermissionTreeViewItems(int? id)
        {
            if (id == null)
            {
                id = 0;
            }

            this.systemPermissionService = new SystemPermissionService();

            int pageCount;
            int totalCount;

            var paging = new Paging("[System_Permission]", null, "ID", string.Format("ParentID = {0}", id), 1, 1000);

            var list = this.systemPermissionService.Query(paging, out pageCount, out totalCount);
            if (list == null)
            {
                return this.Json(null);
            }

            var modelList = new List<dynamic>();
            foreach (var systemPermission in list)
            {
                modelList.Add(new { id = systemPermission.ID, Name = systemPermission.Name, hasChildren = this.systemPermissionService.HasChildren(systemPermission.ID) });
            }

            return this.Json(modelList, JsonRequestBehavior.AllowGet);
        }
 /// <summary>
 /// 查询LP列表(编码、父级编码、名称、制作人).
 /// </summary>
 /// <param name="paging">
 /// 分页数据对象
 /// </param>
 /// <param name="pageCount">
 /// 总页数
 /// </param>
 /// <param name="totalCount">
 /// 总记录数
 /// </param>
 /// <returns>
 /// LP列表
 /// </returns>
 public List<Promote_LandingPage> QueryList(Paging paging, out int pageCount, out int totalCount)
 {
     return this.landingPageDA.Paging(paging, out pageCount, out totalCount);
 }
Esempio n. 26
0
        /// <summary>
        /// 查询子权限选择项列表
        /// </summary>
        /// <param name="permissionID">
        /// The permission ID.
        /// </param>
        /// <returns>
        /// 子权限选择项列表
        /// </returns>
        public ActionResult QuerySubPermissionSelectListItems(int permissionID)
        {
            this.systemPermissionService = new SystemPermissionService();

            int pageCount;
            int totalCount;

            var paging = new Paging("[System_Permission]", null, "ID", string.Format("ParentID = {0}", permissionID), 1, 1000);

            var list = this.systemPermissionService.Query(paging, out pageCount, out totalCount);
            return list != null ? this.Json(list, JsonRequestBehavior.AllowGet) : this.Json(null);
        }
 /// <summary>
 /// 分页查询运费信息
 /// </summary>
 /// <param name="paging">
 /// 分页对象
 /// </param>
 /// <param name="pageCount">
 /// 页数
 /// </param>
 /// <param name="totalCount">
 /// 行数
 /// </param>
 /// <returns>
 /// 查询结果
 /// </returns>
 public List<Config_Delivery_Cost> Query(Paging paging, out int pageCount, out int totalCount)
 {
     return this.configDeliveryCostDA.Paging(paging, out pageCount, out totalCount);
 }
Esempio n. 28
0
        /// <summary>
        /// 获取商品属性列表
        /// </summary>
        /// <param name="categoryID">
        /// 商品类别编号
        /// </param>
        /// <returns>
        /// 商品属性列表
        /// </returns>
        private IEnumerable<Product_Attribute> GetAttributes(string categoryID)
        {
            var condition = "1 = 1";
            if (!string.IsNullOrEmpty(categoryID))
            {
                condition += " and [ProductCategoryID] = '" + categoryID + "' ";
            }

            int totalCount;
            int pageCount;

            var paging = new Paging("[Product_Attribute]", null, "ID", condition, 1, 1000);
            var productAttributes = this.ProductAttributeService.Query(paging, out pageCount, out totalCount);

            if (productAttributes != null)
            {
                foreach (var productAttribute in productAttributes)
                {
                    if (productAttribute == null)
                    {
                        continue;
                    }

                    paging = new Paging("[Product_AttributeValue]", null, "[ID]", string.Format("AttributeID = {0}", productAttribute.ID), 1, 1000);
                    productAttribute.ProductAttributeValues = this.ProductAttributeValueService.Query(paging, out pageCount, out totalCount);
                }
            }
            return productAttributes;
        }
Esempio n. 29
0
        public ActionResult QueryProductOnSaleSimple(int pageIndex, int pageSize, string sortField, string sortOrder, string Name, string condition = "")
        {
            int totalCount, pageCount;

            var stringBuilder = new StringBuilder();
            stringBuilder.Append("[Status] = 2");

            if (!string.IsNullOrEmpty(Name))
            {
                stringBuilder.Append(string.Format(" And [Name] like '%{0}%' ", Name));
            }

            if (string.IsNullOrEmpty(sortField))
            {
                sortField = "CreateTime";
            }

            if (string.IsNullOrEmpty(sortOrder))
            {
                sortOrder = "1";
            }

            if (string.IsNullOrEmpty(condition))
            {
                condition = stringBuilder.ToString();
            }
            else
            {
                condition += " And " + stringBuilder.ToString();
            }

            var paging = new Paging("view_Product_Paging", null, "ID", condition, pageIndex, pageSize, sortField, int.Parse(sortOrder));
            var searchResult = this.ProductService.Query(paging, out pageCount, out totalCount);
            foreach (var result in searchResult)
            {
                result.Path = Utils.GetProductImage(result.Path, "0");
            }
            return this.Json(new { data = searchResult, total = totalCount });
        }
Esempio n. 30
0
        public JsonResult GetProductParentCategory()
        {
            int totalCount;
            int pageCount;

            var paging = new Paging("[Product_Category]", null, "ID", "ParentID = 0 and layer = 1 ", 1, 10);
            var list = this.ProductCategoryService.Query(paging, out pageCount, out totalCount);
            if (list == null || list.Count == 0) return null;

            var query = from p in list
                        select new
                        {
                            id = p.ID,
                            name = p.CategoryName
                        };
            return this.Json(query);
        }