本文整理汇总了C#中BLL.article.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.article.Delete方法的具体用法?C# BLL.article.Delete怎么用?C# BLL.article.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.article
的用法示例。
在下文中一共展示了BLL.article.Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnDelete_Click
//批量删除
protected void btnDelete_Click(object sender, EventArgs e)
{
ChkAdminLevel(channel_id, DTEnums.ActionEnum.Delete.ToString()); //检查权限
BLL.article bll = new BLL.article();
Repeater rptList = new Repeater();
switch (this.prolistview)
{
case "Txt":
rptList = this.rptList1;
break;
default:
rptList = this.rptList2;
break;
}
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
bll.Delete(id);
}
}
JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
}
示例2: btnDelete_Click
//批量删除
protected void btnDelete_Click(object sender, EventArgs e)
{
ChkAdminLevel("channel_" + this.channel_name + "_list", MXEnums.ActionEnum.Delete.ToString()); //检查权限
int sucCount = 0; //成功数量
int errorCount = 0; //失败数量
BLL.article bll = new BLL.article();
Repeater rptList = new Repeater();
rptList = this.rptList1;
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
if (bll.Delete(id))
{
sucCount++;
}
else
{
errorCount++;
}
}
}
AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "删除" + this.channel_name + "单页内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("article_page_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
}