//列表绑定 protected void rptInsure_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { byte tradeType = ( byte )DataBinder.Eval(e.Item.DataItem, "TradeType"); string userID = DataBinder.Eval(e.Item.DataItem, "SourceUserID").ToString(); switch (tradeType) { case 1: (( Label )e.Item.FindControl("lblTradeType")).Text = "存款"; break; case 2: (( Label )e.Item.FindControl("lblTradeType")).Text = "取款"; break; case 3: if (userID == IntParam.ToString( )) { (( Label )e.Item.FindControl("lblTradeType")).Text = "转出"; } else { (( Label )e.Item.FindControl("lblTradeType")).Text = "转入"; } break; default: break; } } }
protected void Page_Load(object sender, EventArgs e) { base.moduleID = 140; if (!IsPostBack) { list1.SelectedValue = IntParam.ToString(); AccountsDataBind(); } }
/// <summary> /// 设置查询条件 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> private void SetCondition(string startDate, string endDate) { StringBuilder condition = new StringBuilder( ); condition.AppendFormat(" WHERE DrawID IN (SELECT DrawID FROM RecordDrawScore WHERE UserID={0})", IntParam.ToString( )); if (!string.IsNullOrEmpty(startDate)) { condition.AppendFormat(" AND ConcludeTime >= '{0}' ", startDate); } if (!string.IsNullOrEmpty(endDate)) { condition.AppendFormat(" AND ConcludeTime < '{0}'", Convert.ToDateTime(endDate).AddDays(1).ToString("yyyy-MM-dd")); } ViewState["SearchItems"] = condition.ToString( ); }