コード例 #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);
        }
コード例 #2
0
        public GanttAssignmentsSettings()
        {
            DataSource = new DataSource();
            DataSource.Type = DataSourceType.Ajax;
            //>> Initialization

            //<< Initialization
        }
コード例 #3
0
        public DropDownListBase(ViewContext viewContext, IJavaScriptInitializer initializer, ViewDataDictionary viewData, IUrlGenerator urlGenerator)
            : base(viewContext, initializer, viewData)
        {
            Animation = new PopupAnimation();

            DataSource = new DataSource();

            UrlGenerator = urlGenerator;
        }
コード例 #4
0
ファイル: MapLayer.cs プロジェクト: akhuang/Zing
        public MapLayer(Map map)
        {
            DataSource = new DataSource();
            ViewContext = map.ViewContext;
            UrlGenerator = map.UrlGenerator;
            //>> Initialization

            Style = new MapLayerStyleSettings();

            //<< Initialization

            Tooltip = new MapMarkerTooltip(map.ViewContext, map.Initializer, map.ViewData);
        }
コード例 #5
0
ファイル: ListBase.cs プロジェクト: jstevenson81/wodgeaux
        public ListBase(ViewContext viewContext, IJavaScriptInitializer initializer, ViewDataDictionary viewData, IUrlGenerator urlGenerator)
            : base(viewContext, initializer, viewData)
        {
            Animation = new PopupAnimation();

            DataSource = new DataSource();

            PopupSettings = new UI.PopupSettings();

            VirtualSettings = new UI.VirtualSettings();

            UrlGenerator = urlGenerator;
        }
コード例 #6
0
        public GridBoundColumnFilterableSettings()
        {
            Enabled = true;
            FilterUIHandler = new ClientHandlerDescriptor();
            ItemTemplate = new ClientHandlerDescriptor();
            CellSettings = new GridColumnFilterableCellSettings();

            DataSource = new DataSource();
            DataSource.Transport.SerializeEmptyPrefix = false;
            DataSource.Schema.Data = "";
            DataSource.Schema.Total = "";
            DataSource.Schema.Errors = "";

            CheckAll = true;
        }
コード例 #7
0
        public GridColumnFilterableCellSettings()
        {
            Enabled = true;
            ShowOperators = true;
            Delay = 200;
            MinLength = 1;
            SuggestionOperator = FilterType.StartsWith;
            Operator = "eq";
            Template = new ClientHandlerDescriptor();
            DataSource = new DataSource();

            DataSource.Transport.SerializeEmptyPrefix = false;
            DataSource.Schema.Data = "";
            DataSource.Schema.Total = "";
            DataSource.Schema.Errors = "";
        }
コード例 #8
0
        public ActionResult QueryByProductCommentID([DataSourceRequest] DataSourceRequest request, int pcId)
        {
            var service = new ProductCommentReplyService();
            var list = service.QueryByCommentID(pcId);

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

                foreach (var comment in list)
                {
                    var cmt = DataTransfer.Transfer<ProductCommentReplyModel>(comment, typeof(Product_Comment_Reply));
                    modelList.Add(cmt);
                }

                var dataSource = new DataSource() { Data = modelList };

                return Json(dataSource, JsonRequestBehavior.AllowGet);
            }

            return Json(null);
        }
コード例 #9
0
        /// <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);
            }
        }
コード例 #10
0
        public ActionResult QueryProduct([DataSourceRequest] DataSourceRequest request, string productBarCode, string productName)
        {
            if (request.Page <= 0)
            {
                request.Page = 1;
            }

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

            var condition = new StringBuilder();

            if (!string.IsNullOrEmpty(productBarCode))
            {
                CheckCondition(condition);
                condition.Append("[Barcode] like '%" + productBarCode + "%'");
            }

            if (!string.IsNullOrEmpty(productName))
            {
                CheckCondition(condition);
                condition.Append("[Name] like '%" + productName + "%'");
            }
            try
            {
                int pageCount;
                int totalCount;
                var paging = new Paging("[Product]", null, "ID", condition.ToString(), request.Page, request.PageSize);
                this.channelGroupBuyService = new ChannelGroupBuyService();
                var list = this.channelGroupBuyService.QueryProduct(paging, out pageCount, out totalCount);
                var modelList = new List<ProductModel>();
                if (list != null)
                {
                    foreach (var product in list)
                    {
                        modelList.Add(DataTransfer.Transfer<ProductModel>(product, typeof(Product)));
                    }

                    var data = new DataSource
                    {
                        Data = modelList,
                        Total = totalCount
                    };
                    return this.Json(data);
                }
            }
            catch (Exception exception)
            {
                TextLogger.Instance.Log("查询出错", Category.Error, exception);
            }
            return this.Json(string.Empty, JsonRequestBehavior.AllowGet);
        }
コード例 #11
0
        public ActionResult QueryGroupProduct([DataSourceRequest] DataSourceRequest request, string setting)
        {
            var queryWhere = string.Empty;
            if (!string.IsNullOrEmpty(setting))
            {
                var strsetting = setting.Split(',');

                foreach (var s in strsetting)
                {
                    queryWhere += " [ID]=" + s + " OR";
                }

                queryWhere = queryWhere.TrimEnd(new[] { 'O', 'R' });

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

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

                try
                {
                    int totalCount;
                    this.channelGroupBuyService = new ChannelGroupBuyService();
                    List<Product> list;
                    var paging = new Paging("[Product]", null, "ID", queryWhere, request.Page, request.PageSize);
                    int pageCount;
                    list = channelGroupBuyService.QueryProduct(paging, out pageCount, out totalCount);
                    if (list != null)
                    {
                        var modelList = new List<ProductModel>();

                        foreach (var groupBuyProduct in list)
                        {
                            modelList.Add(DataTransfer.Transfer<ProductModel>(groupBuyProduct, typeof(Product)));
                        }

                        var data = new DataSource
                        {
                            Data = modelList,
                            Total = totalCount
                        };
                        return this.Json(data);
                    }
                }
                catch (Exception exception)
                {
                    throw new Exception(exception.Message);
                }
            }
            return this.Json(string.Empty);
        }
コード例 #12
0
        public ActionResult QueryConsultReplies([DataSourceRequest] DataSourceRequest request, ProductConsultSearchModel searchModel, string fromDateTime, string toDateTime)
        {
            var service = new ProductConsultService();
            string searchStr = this.BuildConsultSearchString(searchModel, fromDateTime, toDateTime);
            int rowCount = 0, pageCount  = 0;
            var paging = new Paging(searchStr, request.Page, request.PageSize);
            var list = service.QueryConsultReplies(paging, out pageCount, out rowCount);

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

                foreach (var consult in list)
                {
                    modelList.Add(DataTransfer.Transfer<ProductConsultModel>(consult, typeof(Product_Consult)));
                }

                var dataSource = new DataSource() { Data = modelList, Total = rowCount, TotalPages = pageCount };

                return Json(dataSource, JsonRequestBehavior.AllowGet);
            }

            return Json(null);
        }
コード例 #13
0
        /// <summary>
        /// 多瓶装促销规则.
        /// </summary>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="muchBottledID">
        /// 多瓶装促销活动编号.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult QueryMuchBottledRule([DataSourceRequest] DataSourceRequest request, int muchBottledID)
        {
            this.promoteMuchBottledRuleService = new PromoteMuchBottledRuleService();
            if (request.Page <= 0)
            {
                request.Page = 1;
            }

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

            int totalCount;
            List<Promote_MuchBottled_Rule> list;
            try
            {
                string condition = "[MuchBottledID]=" + muchBottledID;
                int pageCount;
                var paging = new Paging("[Promote_MuchBottled_Rule]", null, "[ID]", condition, request.Page, request.PageSize);
                list = this.promoteMuchBottledRuleService.Query(paging, out pageCount, out totalCount);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }

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

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

            return this.View();
        }
コード例 #14
0
        /// <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>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public JsonResult QueryMuchBottled(
            [DataSourceRequest] DataSourceRequest request,
            string promoteName,
            string startStartTime,
            string startEndTime,
            string endStartTime,
            string endEndTime)
        {
            this.promoteMuchBottledService = new PromoteMuchBottledService();
            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(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 + "'");
            }

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

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

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

            return this.Json(string.Empty);
        }
コード例 #15
0
        /// <summary>
        /// 分页查询所有订单数据
        /// </summary>
        /// <param name="request">请求对象</param>
        /// <param name="OrderCode">订单编号</param>
        /// <param name="Status">订单状态</param>
        /// <param name="PaymentMethodID">支付方式</param>
        /// <param name="UserName">会员名称</param>
        /// <param name="Consignee">收货人</param>
        /// <param name="CpsID">订单来源</param>
        /// <param name="StartDateTime">起始时间</param>
        /// <param name="EndDateTime">结束时间</param>
        /// <param name="MinTotalMoney">最小金额</param>
        /// <param name="MaxTotalMoney">最大金额</param>
        /// <returns></returns>
        public ActionResult QueryOrders(
            [DataSourceRequest] DataSourceRequest request,
            string OrderCode,
            string Status,
            string PaymentMethodID,
            string UserName,
            string Consignee,
            string CpsID,
            string StartDateTime,
            string EndDateTime,
            string MinTotalMoney,
			string MaxTotalMoney, string ReceiveMoblie)
        {
            int pageCount, rowCount;

            string condition = this.BuildOrderSearchCondition(
                OrderCode,
                Status,
                PaymentMethodID,
                UserName,
                Consignee,
                CpsID,
                StartDateTime,
                EndDateTime,
                MinTotalMoney,
                MaxTotalMoney,ReceiveMoblie);

            var paging = new Paging(null, null, "ID", condition, request.Page, request.PageSize, "CreateTime", 1);
            var service = new OrderService(this.SystemUserSession.EmployeeID);

            var list = service.Query(paging, out pageCount, out rowCount);
            if (list == null || list.Count <= 0)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }

            var modelList = new List<OrderModel>();
            foreach (var item in list)
            {
                var order = DataTransfer.Transfer<OrderModel>(item, typeof(Order));
                modelList.Add(order);
            }

            var dataSource = new DataSource { Data = modelList, Total = rowCount, Page = pageCount };

            return Json(dataSource, JsonRequestBehavior.AllowGet);
        }
コード例 #16
0
        /// <summary>
        /// 根据PID获限节点
        /// </summary>
        /// <param name="request"></param>
        /// <param name="pid"></param>
        /// <returns></returns>
        public ActionResult GetNodeByPId([DataSourceRequest] DataSourceRequest request, int pid)
        {
            var condition = " PID=" + pid + "";
            if (request.Page <= 0)
            {
                request.Page = 1;
            }

            if (request.PageSize == 0)
            {
                request.PageSize = 5;
            }
            try
            {
                int pageCount;
                var paging = new Paging("[Advertise_Config]", null, "ID", condition, request.Page, request.PageSize, "IsOrder", 0, true);
                this.advertiseConfigService = new AdvertiseConfigService();
                int totalCount;
                var treeNodes = this.advertiseConfigService.Paging(paging, out pageCount, out totalCount);
                var modelList = new List<AdvertiseConfigModel>();
                if (treeNodes != null && treeNodes.Any())
                {
                    foreach (var advertise in treeNodes)
                    {
                        modelList.Add(DataTransfer.Transfer<AdvertiseConfigModel>(advertise, typeof(Advertise_Config)));
                    }
                    var data = new DataSource()
                    {
                        Data = modelList,
                        Total = totalCount,
                    };
                    return this.Json(data);
                }
            }
            catch (Exception exception)
            {
                TextLogger.Instance.Log("查询出错", Category.Error, exception);
            }
            return this.Json(string.Empty, JsonRequestBehavior.AllowGet);
        }
コード例 #17
0
        /// <summary>
        /// 满额优惠.
        /// </summary>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="moneyName">
        /// 活动名称.
        /// </param>
        /// <param name="moneyStatus">
        /// 活动状态.
        /// </param>
        /// <param name="startStartTime">
        /// 活动开始时间范围起点时间.
        /// </param>
        /// <param name="startEndTime">
        /// 活动开始时间范围结点时间.
        /// </param>
        /// <param name="endStartTime">
        /// 活动结束时间范围起点时间.
        /// </param>
        /// <param name="endEndTime">
        /// 活动结束时间范围结点时间.
        /// </param>
        /// <returns>
        /// The <see cref="JsonResult"/>.
        /// </returns>
        public JsonResult QueryMeetMoney(
            [DataSourceRequest] DataSourceRequest request,
            string moneyName,
            string moneyStatus,
            string startStartTime,
            string startEndTime,
            string endStartTime,
            string endEndTime)
        {
            this.promoteMeetMoneyService = new PromoteMeetMoneyService();
            if (request.Page <= 0)
            {
                request.Page = 1;
            }

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

            int totalCount;
            var stringBuilder = new StringBuilder();
            if (!string.IsNullOrEmpty(moneyName))
            {
                CheckCondition(stringBuilder);
                stringBuilder.Append("[Name] like '%" + moneyName + "%'");
            }

            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 (moneyStatus)
            {
                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;
            }

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

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

                foreach (var model in modelList)
                {
                    switch (model.Status)
                    {
                        case 1:
                            model.StatusName = "正常";
                            break;
                        case 2:
                            model.StatusName = "暂停";
                            break;
                        case 3:
                            model.StatusName = "停止";
                            break;
                    }

                    model.StatusText = this.GetMoneyOperationHtml(
                        model.ID,
                        model.Status,
                        model.StartTime,
                        model.EndTime);
                }

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

            return this.Json(string.Empty);
        }
コード例 #18
0
        /// <summary>
        /// 查询用户反馈信息
        /// </summary>
        /// <param name="request">分页对象</param>
        /// <param name="gender">性别</param>
        /// <param name="type">类型</param>
        /// <param name="keyword">关键字</param>
        /// <returns></returns>
        public ActionResult GetFeedBack([DataSourceRequest] DataSourceRequest request, int gender, int type, string keyword)
        {
            if (request.Page <= 0)
            {
                request.Page = 1;
            }
            if (request.PageSize == 0)
            {
                request.Page = 10;
            }
            var criteria = "ID>0";
            if (!string.IsNullOrEmpty(keyword))
            {

                criteria += " and ";

                criteria += "[Name] like '%" + keyword + "%' or [Content] like '%" + keyword + "%'";
            }
            if (gender != -1)
            {
                criteria += " and ";

                criteria += "[Gender]=" + gender + "";

            }
            if (type != 0)
            {

                criteria += " and ";

                criteria += "[Type]=" + type + "";
            }

            try
            {
                int pageCount;
                int totalCount;
                var paging = new Paging("[FeedBack]", null, "ID", criteria, request.Page, request.PageSize);
                this.feedBackService = new FeedBackService();
                var pagingFeedBack = this.feedBackService.Paging(paging, out pageCount, out totalCount);
                var modelList = new List<FeedBackModel>();
                if (pagingFeedBack != null && pagingFeedBack.Any())
                {
                    foreach (var feedBack in pagingFeedBack)
                    {
                        modelList.Add(DataTransfer.Transfer<FeedBackModel>(feedBack, typeof(FeedBack)));
                    }
                    var data = new DataSource()
                    {
                        Data = modelList,
                        Total = totalCount
                    };
                    return this.Json(data);
                }
            }
            catch (Exception exception)
            {
                TextLogger.Instance.Log("查询出错", Category.Error, exception);
            }
            return Json(string.Empty, JsonRequestBehavior.AllowGet);
        }
コード例 #19
0
        /// <summary>
        /// 会员列表数据源.
        /// </summary>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="userLevelID">
        /// 会员等级编号.
        /// </param>
        /// <param name="userName">
        /// 会员名称.
        /// </param>
        /// <param name="email">
        /// 电子邮箱.
        /// </param>
        /// <param name="status">
        /// 会员状态.
        /// </param>
        /// <param name="mobile">
        /// 手机号码.
        /// </param>
        /// <param name="startTime">
        /// 搜索会员注册时间开始时间.
        /// </param>
        /// <param name="endTime">
        /// 搜索会员注册时间结束时间.
        /// </param>
        /// <param name="orderStartTime">
        /// 上次交易时间开始时间.
        /// </param>
        /// <param name="orderEndTime">
        /// 上次交易时间结束时间.
        /// </param>
        /// <param name="isHasOrder">
        /// 会员是否有成功订单.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public JsonResult Query(
            [DataSourceRequest] DataSourceRequest request,
            string userLevelID,
            string userName,
            string email,
            string status,
            string mobile,
            string startTime,
            string endTime,
            string orderStartTime,
            string orderEndTime,
            string isHasOrder)
        {
            this.userService = new UserService();

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

            var stringBuilder = new StringBuilder();
            var condition = string.Empty;
            var objectName = string.Empty;

            if (!string.IsNullOrEmpty(userLevelID))
            {
                stringBuilder.Append(" [UserLevelID] = " + int.Parse(userLevelID));
            }

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

            switch (status)
            {
                case "1":
                    CheckCondition(stringBuilder);
                    stringBuilder.Append("[Status] = " + status);
                    break;
                case "2":
                    CheckCondition(stringBuilder);
                    stringBuilder.Append("[Status] = 0");
                    break;
            }

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

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

            isHasOrder = string.IsNullOrEmpty(isHasOrder) ? "0" : isHasOrder;
            switch (isHasOrder)
            {
                case "0":
                    if (!string.IsNullOrEmpty(startTime))
                    {
                        CheckCondition(stringBuilder);
                        stringBuilder.Append("[view_User_SelectAllInfo].[CreateTime] >= '" + startTime + "'");
                    }

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

                    condition = stringBuilder.ToString();
                    objectName = "[view_User_SelectAllInfo]";
                    break;
                case "1":
                    if (!string.IsNullOrEmpty(startTime))
                    {
                        CheckCondition(stringBuilder);
                        stringBuilder.Append("[view_UserHasOrder].[CreateTime] >= '" + startTime + "'");
                    }

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

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

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

                    condition = stringBuilder.ToString();
                    objectName = "[view_UserHasOrder]";
                    break;
                case "2":
                    if (!string.IsNullOrEmpty(startTime))
                    {
                        CheckCondition(stringBuilder);
                        stringBuilder.Append("[view_UserNoHasOrder].[CreateTime] >= '" + startTime + "'");
                    }

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

                    condition = stringBuilder.ToString();
                    objectName = "[view_UserNoHasOrder]";
                    break;
            }

            try
            {
                var paging = new Paging(objectName, null, null, condition, request.Page, request.PageSize);
                int pageCount;
                int totalCount;
                var list = this.userService.Query(paging, out pageCount, out totalCount);
                if (list == null)
                {
                    return this.Json(null);
                }

                this.TempData["paging"] = paging;
                this.TempData["totalCount"] = totalCount;

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

                foreach (var model in modelList)
                {
                    model.StateName = model.Status == 0 ? "锁定帐号" : "解除锁定";
                }

                var data = new DataSource { Data = modelList, Total = totalCount };
                return this.Json(data);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message, exception);
            }
        }
コード例 #20
0
        public ActionResult QueryProductCommentWithPaging([DataSourceRequest] DataSourceRequest request, string statusForSearch, string userName, string productName, string fromDateTime, string toDateTime)
        {
            var service = new ProductCommentService();
            int rowCount, pageCount;
            string searchStr = this.BuildSearchString(statusForSearch, userName, productName, fromDateTime, toDateTime);

            var paging = new Paging(searchStr, request.Page, request.PageSize);
            var list = service.QueryWithPaging(paging, out pageCount, out rowCount);

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

            var modelList = new List<ProductCommentModel>();

            foreach (var comment in list)
            {
                var cmt = DataTransfer.Transfer<ProductCommentModel>(comment, typeof(Product_Comment));
                modelList.Add(cmt);
            }

            var dataSource = new DataSource() { Data = modelList, Total = rowCount };

            return this.Json(dataSource, JsonRequestBehavior.AllowGet);
        }
コード例 #21
0
        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);
        }
コード例 #22
0
        /// <summary>
        /// 根据订单编码查询成交产品信息
        /// </summary>
        /// <param name="request">
        /// 请求对象
        /// </param>
        /// <param name="orderId">
        /// 订单编码
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult QueryOrderProductByOrderId([DataSourceRequest] DataSourceRequest request, int orderId)
        {
            var orderProductService = new OrderProductService();
            var list = orderProductService.QueryByOrderId(orderId);

            if (list == null || list.Count < 1)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }

            var modelList = new List<OrderProductModel>();
            foreach (var item in list)
            {
                var order = DataTransfer.Transfer<OrderProductModel>(item, typeof(Order_Product));
                modelList.Add(order);
            }

            var dataSource = new DataSource { Data = modelList };

            return Json(dataSource, JsonRequestBehavior.AllowGet);
        }
コード例 #23
0
        /// <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);
        }
コード例 #24
0
        /// <summary>
        /// 根据快递公司查询分页快递费用列表.
        /// </summary>
        /// <param name="corporationId">
        /// 快递公司ID
        /// </param>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult QueryByCorporationIDWithPaging(int corporationId, [DataSourceRequest] DataSourceRequest request)
        {
            var service = new ConfigDeliveryCostService();
            int rowCount = 0, pageCount = 0;
            var page = new Paging(" [DeliveryCorporationID]=" + corporationId, request.Page, request.PageSize);
            var list = service.Query(page, out pageCount, out rowCount);

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

                foreach (var config in list)
                {
                    modelList.Add(
                        DataTransfer.Transfer<ConfigDeliveryCostModel>(
                            config,
                            typeof(Config_Delivery_Cost)));
                }

                var dataSource = new DataSource() { Data = modelList, Total = rowCount, TotalPages = pageCount };

                return Json(dataSource, JsonRequestBehavior.AllowGet);
            }

            return Json(null);
        }