private void repreplykey_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("repreply"); int replyKeyId = (int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "id"); repeater.DataSource = WeiboHelper.GetReplyInfo(replyKeyId); repeater.DataBind(); } }
private void repreplykey_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { Repeater repeater = (Repeater)e.Item.FindControl("repreply"); int replyKeyId = (int)DataBinder.Eval(e.Item.DataItem, "id"); repeater.DataSource = WeiboHelper.GetReplyInfo(replyKeyId); repeater.DataBind(); } }
private void repreplykey_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "del") { System.Collections.Generic.IList <ReplyInfo> replyInfo = WeiboHelper.GetReplyInfo(int.Parse(e.CommandArgument.ToString())); if (replyInfo.Count > 0) { this.ShowMsg("关键词中有回复信息,请先删除回复信息!", false); return; } if (WeiboHelper.DeleteReplyKeyInfo(int.Parse(e.CommandArgument.ToString()))) { this.ShowMsg("关键词删除成功!", true); this.bind(); return; } this.ShowMsg("关键词删除失败!", false); } }
private void repreplykey_ItemCommand(object sender, RepeaterCommandEventArgs e) { if (e.CommandName == "del") { if (WeiboHelper.GetReplyInfo(int.Parse(e.CommandArgument.ToString())).Count > 0) { this.ShowMsg("关键词中有回复信息,请先删除回复信息!", false); } else if (WeiboHelper.DeleteReplyKeyInfo(int.Parse(e.CommandArgument.ToString()))) { this.ShowMsg("关键词删除成功!", true); this.bind(); } else { this.ShowMsg("关键词删除失败!", false); } } }