Esempio n. 1
0
    void bd()
    {
        if (BackDay > 0)
        {
            string sql = string.Format(" and FilesId=0 and DateStamp<={0} and IsBack=0", DateTime.Now.AddDays(-BackDay).ToString("yyyyMMdd"));

            string   stime = this.tbSt1.Text;
            string   etime = this.tbSt2.Text;
            DateTime d     = Convert.ToDateTime("2000-01-01");
            if (stime != "")
            {
                string t1 = Common.TypeHelper.ObjectToDateTime(stime, d).ToShortDateString();
                sql += " and a.CreateTime >= '" + t1 + " 00:00:00'";
            }
            if (etime != "")
            {
                string t2 = Common.TypeHelper.ObjectToDateTime(etime, d).ToShortDateString();
                sql += " and a.CreateTime <= '" + t2 + " 23:59:59'";
            }

            AspNetPager1.PageSize = 10;
            int count = OrderInfoDal.GetCount(sql, "");
            AspNetPager1.RecordCount = count;
            int page = AspNetPager1.CurrentPageIndex;
            this.menuList.DataSource = OrderInfoDal.GetList(sql, page, AspNetPager1.PageSize);
            this.menuList.DataBind();
        }
    }
Esempio n. 2
0
    public Model.ReturnValue InitData(Model.ReturnValue returnValue)
    {
        int PageIndex = Common.TypeHelper.ObjectToInt(Request["PageIndex"], 0);
        int PageSize  = Common.TypeHelper.ObjectToInt(Request["PageSize"], 10);

        string CheckInputText   = Request["CheckInputText"];
        string SearchOptionText = Request["SearchOptionText"];
        //string StatusOptionText = Request["StatusOptionText"];
        string PrizeOptionText = Request["PrizeOptionText"];
        string OcrOptionText   = Request["OcrOptionText"];
        string StarTimeText    = Request["StarTimeText"];
        string EndTimeText     = Request["EndTimeText"];
        string OrderStatusType = Request["OrderStatusType"];

        string sqlwhere = "";

        if (string.IsNullOrEmpty(CheckInputText) == false && string.IsNullOrEmpty(SearchOptionText) == false)
        {
            sqlwhere += " and " + SearchOptionText + " like '%" + Common.ReplaceErorrSql.StripSQLInjection(CheckInputText) + "%'";
        }
        if (string.IsNullOrEmpty(OrderStatusType) == false && OrderStatusType != "1")
        {
            sqlwhere += " and a.States =" + (OrderStatusType == "2" ? "0" : OrderStatusType == "3" ? "1" : "-1") + "";
        }
        if (string.IsNullOrEmpty(PrizeOptionText) == false)
        {
            sqlwhere += " and a.Jx='" + PrizeOptionText + "'";
        }
        if (string.IsNullOrEmpty(OcrOptionText) == false && Request["GetType"] != "Export")
        {
            if (OcrOptionText == "是")
            {
                sqlwhere += " and ap.note is not null ";
            }
            else
            {
                sqlwhere += " and ap.note is null ";
            }
        }
        if (string.IsNullOrEmpty(StarTimeText) == false)
        {
            sqlwhere += " and a.CreateTime >= '" + StarTimeText + " 00:00:00'";
        }
        if (string.IsNullOrEmpty(EndTimeText) == false)
        {
            sqlwhere += " and a.CreateTime <= '" + EndTimeText + " 23:59:59'";
        }

        if (Request["GetType"] == "Export")
        {
            string ExportData = string.IsNullOrEmpty(Request["ExportData"]) ? "" : Request["ExportData"].TrimEnd(',');

            Common.NPOIHelper.ExportByWeb(OrderDal.GetVueExcelList(sqlwhere, ExportData, "", "OrderInfo", true), "", DateTime.Now.ToString("yyyyMMdd") + ".xlsx");
            return(null);
        }
        else
        {
            DataTable OrderDt = OrderDal.GetList(sqlwhere, PageIndex, PageSize, true);

            #region 查询订单红包是否过期
            if (string.IsNullOrEmpty(Request["IsRefund"]) == false && Request["IsRefund"] == "是")
            {
                OrderDt.Columns.Add("isRefund", typeof(int));//消费者是否退款
                for (int row = 0; row < OrderDt.Rows.Count; row++)
                {
                    string Jx           = OrderDt.Rows[row]["Jx"].ToString();
                    string HbOrderCode  = OrderDt.Rows[row]["HbOrderCode"].ToString();
                    string SearchStatus = Common.SearchRedPack.SearchOrder(HbOrderCode);
                    OrderDt.Rows[row]["isRefund"] = (HbOrderCode.Length > 0 && (SearchStatus == "已退款" || SearchStatus == "发放失败")) ? 1 : 0;
                }
            }
            #endregion

            returnValue.EffectRows  = OrderDal.GetCount(sqlwhere, "", true);//true 左连接小票表   非小票项目可不传
            returnValue.ObjectValue = Common.JsonHelper.DataTableToJson(OrderDt);
        }

        return(returnValue);
    }
Esempio n. 3
0
    void bd()
    {
        string sql = "";

        int status = Common.Fun.ConvertTo <int>(Request["status"], 100);


        if (this.DropDownListName.SelectedValue != "选择搜索项" && string.IsNullOrEmpty(this.tbCheckName.Text) == false)
        {
            sql += " and " + this.DropDownListName.SelectedItem.Value + " like '%" + this.tbCheckName.Text + "%'";
        }
        if (status == 100)
        {
            if (this.ddlState.SelectedValue != "不限")
            {
                sql += " and a.States = " + Common.TypeHelper.ObjectToInt(this.ddlState.SelectedValue, 0);
            }
        }
        else
        {
            sql += " and a.States = " + status;
        }

        if (this.ddlJx.SelectedValue != "不限")
        {
            sql += " and a.Jx = '" + this.ddlJx.SelectedItem.Value + "'";
        }

        if (this.ddlIsOCR.SelectedValue != "不限")
        {
            if (this.ddlIsOCR.SelectedValue == "是")
            {
                sql += " and ap.note is not null ";
            }
            else
            {
                sql += " and ap.note is null ";
            }
        }

        string   stime = this.tbSt1.Text;
        string   etime = this.tbSt2.Text;
        DateTime d     = Convert.ToDateTime("2000-01-01");

        if (stime != "")
        {
            string t1 = Common.TypeHelper.ObjectToDateTime(stime, d).ToShortDateString();
            sql += " and a.CreateTime >= '" + t1 + " 00:00:00'";
        }
        if (etime != "")
        {
            string t2 = Common.TypeHelper.ObjectToDateTime(etime, d).ToShortDateString();
            sql += " and a.CreateTime <= '" + t2 + " 23:59:59'";
        }

        AspNetPager1.PageSize = 10;
        int count = dal.GetCount(sql, "", true);//true 左连接小票表   非小票项目可不传

        AspNetPager1.RecordCount = count;
        int page = AspNetPager1.CurrentPageIndex;

        this.menuList.DataSource = dal.GetList(sql, page, AspNetPager1.PageSize, true);
        this.menuList.DataBind();
    }