本文整理汇总了C#中BLL.orders.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.orders.Delete方法的具体用法?C# BLL.orders.Delete怎么用?C# BLL.orders.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.orders
的用法示例。
在下文中一共展示了BLL.orders.Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnDelete_Click
//批量删除
protected void btnDelete_Click(object sender, EventArgs e)
{
ChkAdminLevel("order_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
int sucCount = 0;
int errorCount = 0;
BLL.orders bll = new BLL.orders();
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 += 1;
}
else
{
errorCount += 1;
}
}
}
AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除订单成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("order_list.aspx", "status={0}&payment_status={1}&express_status={2}&keywords={3}",
this.status.ToString(), this.payment_status.ToString(), this.express_status.ToString(), this.keywords));
}
示例2: btnDelete_Click
//批量删除
protected void btnDelete_Click(object sender, EventArgs e)
{
ChkAdminLevel("orders", DTEnums.ActionEnum.Delete.ToString()); //检查权限
BLL.orders bll = new BLL.orders();
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)
{
Model.orders model = bll.GetModel(id);
if (model != null && model.status == 4)
{
bll.Delete(id);
}
}
}
JscriptMsg("符合的订单已删除!", Utils.CombUrlTxt("order_list.aspx", "status={0}&payment_status={1}&distribution_status={2}&keywords={3}",
this.status.ToString(), this.payment_status.ToString(), this.distribution_status.ToString(), this.keywords), "Success");
}