Exemple #1
0
        public object ReviewQuery(NameValueCollection nvc)
        {
            OrderMainListModel model  = new OrderMainListModel();
            MOrderMain         entity = new MOrderMain();

            model.PageSize = CommFun.ToInt(nvc["ps"],
                                           SettingHelper.Instance.GetInt("PageSize", 10)).Value;
            model.PageIndex = CommFun.ToInt(nvc["pi"],
                                            SettingHelper.Instance.GetInt("PageIndex", 0)).Value + 1;
            entity.SetData(nvc, false);
            entity.TrimEmptyProperty();
            entity.AddData(":PS", model.PageSize);
            entity.AddData(":PI", model.PageIndex);
            DateTime st = CommFun.ToDateTime(nvc["s"], DateTime.Now.AddDays(-1)).Value;
            DateTime et = CommFun.ToDateTime(nvc["t"], DateTime.Now).Value;

            entity.AddData("ST", st.ToString("yyyy-MM-dd"));
            entity.AddData("ET", et.ToString("yyyy-MM-dd"));
            //关键字
            string keyWords      = CommFun.GetString(nvc["KeyWords"]);
            string accountCondit = "1=1";

            if (!string.IsNullOrEmpty(keyWords))
            {
                int?type = CommFun.ToInt(nvc["keytype"], null);
                if (type == 1)
                {
                    entity.OrderNo = keyWords;
                }
                else if (type == 2)
                {
                    entity.PartnerOrderNo = keyWords;
                }
                else if (type == 3)
                {
                    accountCondit = "(t.account like '%" + keyWords + "%' or t.mobile like '%" + keyWords + "%')";
                }
                else if (type == 4)
                {
                    entity.Face = CommFun.ToDecimal(keyWords, null);
                }
            }

            entity.AddData(":Condition", accountCondit);
            model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getReviewCount", entity), 0).GetValueOrDefault();
            if (model.TotalCount > 0)
            {
                model.List = handler.GetDataListByTemplate("getReviewList", entity);
            }
            return(model);
        }
Exemple #2
0
        /// <summary>
        /// 查询列表数据
        /// </summary>
        /// <param name="nvc">参数集合</param>
        /// <returns></returns>
        public ZdCouponUsedListModel Query(NameValueCollection nvc)
        {
            ZdCouponUsedListModel model  = new ZdCouponUsedListModel();
            MZdCouponUsed         entity = new MZdCouponUsed();

            model.PageSize = CommFun.ToInt(nvc["ps"],
                                           SettingHelper.Instance.GetInt("PageSize", 10)).Value;
            model.PageIndex = CommFun.ToInt(nvc["pi"],
                                            SettingHelper.Instance.GetInt("PageIndex", 0)).Value + 1;
            entity.SetData(nvc, false);
            entity.AddData(":PS", model.PageSize);
            entity.AddData(":PI", model.PageIndex);
            //时间
            DateTime starttime = CommFun.ToDateTime(nvc["s"], DateTime.Now.AddDays(-1)).Value;
            DateTime endtime   = CommFun.ToDateTime(nvc["e"], DateTime.Now).Value.AddDays(1);

            entity.AddData(":ST", " t.use_time>=to_date('" + starttime + "','yyyy-mm-dd  hh24:mi:ss')");
            entity.AddData(":ET", "t.use_time<to_date('" + endtime + "','yyyy-mm-dd  hh24:mi:ss')");

            //关键字
            string keyWords = CommFun.GetString(nvc["KeyWords"]);

            if (!string.IsNullOrEmpty(keyWords))
            {
                int?type = CommFun.ToInt(nvc["keytype"], null);
                if (type == 1)
                {
                    entity.OrderNo = keyWords;
                }
                else if (type == 2)
                {
                    entity.DownOrderNo = keyWords;
                }
                else if (type == 3)
                {
                    entity.CouponPrice = CommFun.ToDecimal(keyWords, null);
                }
            }
            model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getCount", entity), 0).GetValueOrDefault();
            if (model.TotalCount > 0)
            {
                model.List = handler.GetDataListByTemplate("getList", entity);
            }
            return(model);
        }
Exemple #3
0
        /// <summary>
        /// 查询列表数据
        /// </summary>
        /// <param name="nvc">参数集合</param>
        /// <returns></returns>
        public OrderRefundListModel Query(NameValueCollection nvc)
        {
            OrderRefundListModel model  = new OrderRefundListModel();
            MOrderRefund         entity = new MOrderRefund();

            model.PageSize = CommFun.ToInt(nvc["ps"],
                                           SettingHelper.Instance.GetInt("PageSize", 10)).Value;
            model.PageIndex = CommFun.ToInt(nvc["pi"],
                                            SettingHelper.Instance.GetInt("PageIndex", 0)).Value + 1;
            entity.SetData(nvc, false);
            entity.TrimEmptyProperty();
            entity.AddData(":PS", model.PageSize);
            entity.AddData(":PI", model.PageIndex);
            DateTime st = CommFun.ToDateTime(nvc["s"], DateTime.Now.AddDays(-1)).Value;
            DateTime et = CommFun.ToDateTime(nvc["e"], DateTime.Now).Value;

            entity.AddData("ST", st.ToString("yyyy-MM-dd"));
            entity.AddData("ET", et.ToString("yyyy-MM-dd"));
            if (!string.IsNullOrEmpty(nvc["ReStatus"]))
            {
                entity.Status = CommFun.ToInt(nvc["ReStatus"], null);
            }
            if (!string.IsNullOrEmpty(nvc["KeyWords"]))
            {
                switch (nvc["keytype"])
                {
                case "1": entity.OrderNo = CommFun.GetString(nvc["KeyWords"], null);
                    break;

                case "2": entity.RecordId = CommFun.ToLong(nvc["KeyWords"], null);
                    break;

                case "3": entity.RefundFee = CommFun.ToDecimal(nvc["KeyWords"], null);
                    break;
                }
            }
            model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getCount", entity), 0).GetValueOrDefault();
            if (model.TotalCount > 0)
            {
                model.List = handler.GetDataListByTemplate("getList", entity);
            }
            return(model);
        }
Exemple #4
0
        /// <summary>
        /// 查询列表数据
        /// </summary>
        /// <param name="nvc">参数集合</param>
        /// <returns></returns>
        public OrderMainListModel Query(NameValueCollection nvc)
        {
            OrderMainListModel model  = new OrderMainListModel();
            MOrderMain         entity = new MOrderMain();

            model.PageSize = CommFun.ToInt(nvc["ps"],
                                           SettingHelper.Instance.GetInt("PageSize", 10)).Value;
            model.PageIndex = CommFun.ToInt(nvc["pi"],
                                            SettingHelper.Instance.GetInt("PageIndex", 0)).Value + 1;
            entity.SetData(nvc, false);
            entity.TrimEmptyProperty();
            entity.AddData(":PS", model.PageSize);
            entity.AddData(":PI", model.PageIndex);
            //时间
            DateTime starttime = CommFun.ToDateTime(nvc["e"], DateTime.Now).Value;
            DateTime endtime   = starttime.AddDays(1);

            if (!string.IsNullOrEmpty(nvc["h"]))
            {
                //近半个小时
                entity.AddData(":ST", " t.create_time >= sysdate-30/24/60");
                entity.AddData(":ET", " t.create_time < sysdate+30/24/60");
            }
            else
            {
                entity.AddData(":ST", " t.create_time>=to_date('" + starttime + "','yyyy-mm-dd  hh24:mi:ss')");
                entity.AddData(":ET", "t.create_time<to_date('" + endtime + "','yyyy-mm-dd  hh24:mi:ss')");
            }
            //关键字
            string keyWords      = CommFun.GetString(nvc["KeyWords"]);
            string accountCondit = "1=1";

            if (!string.IsNullOrEmpty(keyWords))
            {
                int?type = CommFun.ToInt(nvc["keytype"], null);
                if (type == 1)
                {
                    entity.OrderNo = keyWords;
                }
                else if (type == 2)
                {
                    entity.PartnerOrderNo = keyWords;
                }
                else if (type == 3)
                {
                    accountCondit = "(t.account like '%" + keyWords + "%' or t.mobile like '%" + keyWords + "%')";
                }
                else if (type == 4)
                {
                    entity.Face = CommFun.ToDecimal(keyWords, null);
                }
            }

            entity.AddData(":Condition", accountCondit);
            model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getCount", entity), 0).GetValueOrDefault();
            if (model.TotalCount > 0)
            {
                model.List = handler.GetDataListByTemplate("getList", entity);
            }
            return(model);
        }