private void dlstVote_DeleteCommand(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e) { long voteId = System.Convert.ToInt64(this.dlstVote.DataKeys[e.Item.ItemIndex]); if (StoreHelper.DeleteVote(voteId) > 0) { this.BindVote(); this.ShowMsg("成功删除了选择的投票", true); return; } this.ShowMsg("删除投票失败", false); }
private void dlstVote_DeleteCommand(object sender, DataListCommandEventArgs e) { if (StoreHelper.DeleteVote(Convert.ToInt64(this.dlstVote.DataKeys[e.Item.ItemIndex])) > 0) { this.BindVote(); this.ShowMsg("成功删除了选择的投票", true); } else { this.ShowMsg("删除投票失败", false); } }
private void Delete(HttpContext context) { int value = base.GetIntParam(context, "id", false).Value; if (value <= 0) { throw new HidistroAshxException("错误的参数"); } if (StoreHelper.DeleteVote(value)) { base.ReturnSuccessResult(context, "成功删除了选择的投票!", 0, true); return; } throw new HidistroAshxException("删除投票失败"); }