/// <summary>
        /// 添加或修改数据,id为空时为添加,否则为修改
        /// </summary>
        /// <param name="vo">实体数据</param>
        /// <returns></returns>
        public IResult Save(MUpChannelConfig vo)
        {
            IResult result = new Result(false);
            bool    status = dbAccess.Save(vo) > 0;

            if (status)
            {
                result       = new Result(true);
                result["id"] = CommFun.GetString(dbAccess.Builder.ODMapConfig.PrimaryKeyField.GetValue(vo));
            }
            return(result);
        }
Exemple #2
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);
        }
        /// <summary>
        /// 查询列表数据
        /// </summary>
        /// <param name="nvc">参数集合</param>
        /// <returns></returns>
        public ReceiptFundRecordListModel Query(NameValueCollection nvc)
        {
            ReceiptFundRecordListModel model  = new ReceiptFundRecordListModel();
            MReceiptFundRecord         entity = new MReceiptFundRecord();
            StringBuilder WhereString         = new StringBuilder();

            //下游渠道查询
            if (!string.IsNullOrEmpty(nvc["PayType"]))
            {
                WhereString.AppendFormat(" and t1.account_type={0}", nvc["PayType"]);
            }
            if (!string.IsNullOrEmpty(nvc["ChannelNo"]))
            {
                WhereString.AppendFormat(" and t1.down_channel_no={0}", nvc["ChannelNo"]);
            }

            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);
            entity.AddData(":WhereString", string.IsNullOrEmpty(WhereString.ToString()) ? " and 1=1" : WhereString.ToString());

            //时间
            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"));

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

            if (!string.IsNullOrEmpty(keyWords))
            {
                entity.OrderNO = keyWords;
            }
            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 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 #5
0
        public OrderDeliveryListModel ReviewQuery(NameValueCollection nvc)
        {
            OrderDeliveryListModel model  = new OrderDeliveryListModel();
            MOrderDelivery         entity = new MOrderDelivery();

            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 keyWord = CommFun.GetString(nvc["KeyWords"]);

            if (!string.IsNullOrEmpty(keyWord))
            {
                int?type = CommFun.ToInt(nvc["keytype"], null);
                switch (type)
                {
                case 1:
                    entity.OrderNo = nvc["KeyWords"];
                    break;

                case 2: entity.DeliveryId = CommFun.ToLong(nvc["KeyWords"], -1);
                    break;

                case 3: entity.UpOrderNo = nvc["KeyWords"];
                    break;
                }
            }
            model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getReviewCount", entity), 0).GetValueOrDefault();
            if (model.TotalCount > 0)
            {
                model.List = handler.GetDataListByTemplate("getReviewList", entity);
            }
            return(model);
        }
Exemple #6
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);
        }
        /// <summary>
        /// 添加或修改数据,id为空时为添加,否则为修改
        /// </summary>
        /// <param name="id">主键值</param>
        /// <param name="vo">实体数据</param>
        /// <returns></returns>
        public IResult Save(string id, MUpChannelConfig vo)
        {
            bool    status = false;
            IResult result = new Result(status);

            if (string.IsNullOrEmpty(id))
            {
                status = dbAccess.CreateNew(vo);
            }
            else
            {
                status = dbAccess.Update(id, vo);
            }
            if (status)
            {
                result       = new Result(true);
                result["id"] = CommFun.GetString(dbAccess.Builder.ODMapConfig.PrimaryKeyField.GetValue(vo));
            }
            return(result);
        }
Exemple #8
0
 public IResult Item()
 {
     try
     {
         MUpChannelConfig entity = new MUpChannelConfig();
         entity.SetData(Request.Form);
         entity.DownChannelNo = CommFun.ToInt(Request["DChannelNo"], null);
         string  id     = CommFun.GetString(Request["__id"]);
         IResult result = UpChannelConfigService.Instance.Save(id, entity);
         if (result.Status)
         {
             result.SetSuccessMessage("保存成功");
         }
         else
         {
             result.SetErrorMessage("保存失败");
         }
         return(result);
     }
     catch (Exception ex)
     {
         return(new Result(false, ex.Message));
     }
 }
Exemple #9
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);
        }