private void BatchCreatDist_click(object sender, EventArgs e) { string str = ""; foreach (GridViewRow row in this.grdMemberList.Rows) { CheckBox box = (CheckBox)row.FindControl("checkboxCol"); if (box.Checked) { str = str + this.grdMemberList.DataKeys[row.RowIndex].Value.ToString() + ","; } } str = str.TrimEnd(new char[] { ',' }); if (string.IsNullOrEmpty(str)) { this.ShowMsg("请先选择要设置成分销商的会员账号!", false); } else { string msg = ""; if (MemberHelper.CreateDistributorByUserIds(str, ref msg)) { this.ShowMsg(msg, true); this.BindData(); } else { this.ShowMsg(msg, false); } } }
private void BatchCreatDist_click(object sender, System.EventArgs e) { string text = ""; foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdMemberList.Rows) { System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol"); if (checkBox.Checked) { text = text + this.grdMemberList.DataKeys[gridViewRow.RowIndex].Value.ToString() + ","; } } text = text.TrimEnd(new char[] { ',' }); if (string.IsNullOrEmpty(text)) { this.ShowMsg("请先选择要设置成分销商的会员账号!", false); return; } string msg = ""; if (MemberHelper.CreateDistributorByUserIds(text, ref msg)) { this.ShowMsg(msg, true); this.BindData(); return; } this.ShowMsg(msg, false); }