예제 #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);
        }
예제 #2
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);
        }