protected string CombSqlTxt(int _product_category_id, string _note_no) { StringBuilder strTemp = new StringBuilder(); ps_orders bll = new ps_orders(); DataTable dt = bll.GetList("status=2").Tables[0]; strTemp.Append(" and (1=2"); foreach (DataRow dr in dt.Rows) { strTemp.Append(" or order_id=" + dr["id"].ToString()); } strTemp.Append(")"); if (_product_category_id > 0) { strTemp.Append(" and product_category_id=" + _product_category_id); Literal6.Text = new ps_product_category().GetTitle(_product_category_id); } else { Literal6.Text = "(所有)"; } _note_no = _note_no.Replace("'", ""); if (!string.IsNullOrEmpty(_note_no)) { strTemp.Append(" and goods_title like '%" + _note_no + "%' "); } return(strTemp.ToString()); }
private void RptBind(string _strWhere, string _orderby) { this.page = AXRequest.GetQueryInt("page", 1); if (this.depot_category_id > 0) { this.ddldepot_category_id.SelectedValue = this.depot_category_id.ToString(); } if (this.depot_id > 0) { this.ddldepot_id.SelectedValue = this.depot_id.ToString(); } txtNote_no.Text = this.note_no; ps_orders bll = new ps_orders(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_list.aspx", "depot_category_id={0}&depot_id={1}&status={2}¬e_no={3}&page={4}", this.depot_category_id.ToString(), this.depot_id.ToString(), this.status.ToString(), txtNote_no.Text, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind(string _strWhere, string _orderby) { this.page = AXRequest.GetQueryInt("page", 1); if (this.status > 0) { this.ddlStatus.SelectedValue = this.status.ToString(); } txtNote_no.Text = this.note_no; txtstart_time.Value = this.start_time; txtstop_time.Value = this.stop_time; ps_orders bll = new ps_orders(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); this.Literal_pa.Text = MyConvert(bll.GetTitleSum(_strWhere + " and status<>4", "sum(payable_amount)")); this.Literal_ra.Text = MyConvert(bll.GetTitleSum(_strWhere + " and status<>4", "sum(real_amount)")); this.Literal_oa.Text = MyConvert(bll.GetTitleSum(_strWhere + " and status<>4", "sum(order_amount)")); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("my_order.aspx", "depot_category_id={0}&depot_id={1}&status={2}&start_time={3}&stop_time={4}¬e_no={5}&page={6}", this.depot_category_id.ToString(), this.depot_id.ToString(), this.status.ToString(), this.txtstart_time.Value, this.txtstop_time.Value, txtNote_no.Text, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//绑定记录 public void binddr() { ps_orders bll = new ps_orders(); string sqlstr = "id>0 "; sqlstr = sqlstr + CombSqlTxt(this.depot_category_id, this.depot_id, this.status, this.note_no, this.start_time, this.stop_time); sqlstr = sqlstr + " order by add_time desc,id desc"; DataView dv = bll.GetList(sqlstr).Tables[0].DefaultView; repCategory.DataSource = dv; repCategory.DataBind(); }
//绑定记录 public void binddr() { ps_orders bll = new ps_orders(); string sqlstr = "id>0 "; sqlstr = sqlstr + CombSqlTxt(this.depot_category_id, this.depot_id, this.status, this.note_no, this.start_time, this.stop_time); sqlstr = sqlstr + " order by add_time desc,id desc"; DataView dv = bll.GetList(sqlstr).Tables[0].DefaultView; repCategory.DataSource = dv; repCategory.DataBind(); this.Literal_pa.Text = MyConvert(bll.GetTitleSum(" status<>4" + CombSqlTxt(this.depot_category_id, this.depot_id, this.status, this.note_no, this.start_time, this.stop_time), "sum(payable_amount)")); this.Literal_ra.Text = MyConvert(bll.GetTitleSum(" status<>4" + CombSqlTxt(this.depot_category_id, this.depot_id, this.status, this.note_no, this.start_time, this.stop_time), "sum(real_amount)")); this.Literal_oa.Text = MyConvert(bll.GetTitleSum(" status<>4" + CombSqlTxt(this.depot_category_id, this.depot_id, this.status, this.note_no, this.start_time, this.stop_time), "sum(order_amount)")); }