protected void Report_DataBind(object sender, StoreRefreshDataEventArgs e) { try { if (TxtVIPNo.Text.Trim().Length <= 0) { X.MessageBox.Alert("提醒", "请输入VIP卡号!").Show(); return; } CJ_DevelopHelper.SqlConn_Str = ConfigurationManager.AppSettings["DBRetail"]; string sql = "select vipid,vipname,centum,pcentum from vip_user where vipcode='{0}'"; CJ_DevelopHelper.SqlStr = String.Format(sql, TxtVIPNo.Text.Trim().Replace("'", "").Replace("--", "")); DataTable dt = CJ_DevelopHelper.SQL_ReturnDateTable; string cardno = ""; if (dt.Rows.Count == 1) { lbInfo.Html = " 姓名:<font color=red>" + dt.Rows[0]["vipname"].ToString() + "</font> 总积分:<font color=red>" + dt.Rows[0]["centum"].ToString() + "</font> 上季积分:<font color=red>" + dt.Rows[0]["pcentum"].ToString() + "</font>"; cardno = dt.Rows[0]["vipid"].ToString(); } else { X.MessageBox.Alert("提醒", "VIP卡号不正确,请检查,找到" + dt.Rows.Count.ToString() + "条记录!").Show(); return; } RetailStore.DataSource = GetRecordByProc(cardno); RetailStore.DataBind(); } catch (Exception error) { X.MessageBox.Alert("异常", error.Message).Show(); } }
protected void Report_DataBind(object sender, StoreRefreshDataEventArgs e) { try { if (Request["shopid"] == null) { return; } //订单销售连接串 CJ_DevelopHelper.SqlConn_Str = ConfigurationManager.AppSettings["DBRetail"]; string sql = "select retailid,setdate,znums,zxsums,zssums,FCalcSums,zxsums-zssums as yhsum,s_sums,vipcode,s_name,x_name,crdate,cr_name,comment,sure,chk_sure,depotid from d_Retail "; string condition = "where depotid='" + Request["shopid"].ToString().Replace("'", "").Replace("--", "") + "' "; //单号 if (TxtRetailNo.Text.Trim().Length > 0) { condition += " and retailid='" + TxtRetailNo.Text.Trim().Replace("'", "").Replace("--", "") + "' "; X.Js.AddScript("retailno='" + TxtRetailNo.Text.Trim().Replace("'", "").Replace("--", "") + "';#{RetailSubStore}.reload();"); } //开始结束如期 if (DTStart.SelectedValue != null) { condition += " and setdate>='" + DTStart.SelectedValue.ToString() + "' "; } if (DTEnd.SelectedValue != null) { condition += " and setdate<='" + DTEnd.SelectedValue.ToString() + "' "; } //状态 condition += CboState.Value.ToString(); CJ_DevelopHelper.SqlStr = sql + condition; DataTable dt = CJ_DevelopHelper.SQL_ReturnDateTable; RetailStore.DataSource = dt; RetailStore.DataBind(); } catch (Exception error) { X.MessageBox.Alert("异常", error.Message).Show(); } }