//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("goods_", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.goodss bll = new BLL.goodss(); 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("goods_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)); }
private void RptBind(string _strWhere, string _goodsby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.status > 0) { this.ddlStatus.SelectedValue = this.status.ToString(); } if (this.payment_status > 0) { this.ddlPaymentStatus.SelectedValue = this.payment_status.ToString(); } if (this.express_status > 0) { this.ddlExpressStatus.SelectedValue = this.express_status.ToString(); } txtKeywords.Text = this.keywords; BLL.goodss bll = new BLL.goodss(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _goodsby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("goods_list.aspx", "status={0}&payment_status={1}&express_status={2}&keywords={3}&page={4}", this.status.ToString(), this.payment_status.ToString(), this.express_status.ToString(), this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
protected string GetgoodsStatus(int _id) { string _title = string.Empty; Model.goodss model = new BLL.goodss().GetModel(_id); switch (model.status) { case 1: //如果是线下支付,支付状态为0,如果是线上支付,支付成功后会自动改变货物状态为已确认 if (model.payment_status > 0) { _title = "待付款"; } else { _title = "待确认"; } break; case 2: //如果货物为已确认状态,则进入发货状态 if (model.express_status > 1) { _title = "已发货"; } else { _title = "待发货"; } break; case 3: _title = "交易完成"; break; case 4: _title = "已取消"; break; case 5: _title = "已作废"; break; } return(_title); }