Exemple #1
0
    protected void egvBrands_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int brandID             = (int)egvBrands.DataKeys[e.RowIndex].Value;
        DataActionStatus status = ProductBrands.DeleteBrand(brandID);

        switch (status)
        {
        case DataActionStatus.RelationshipExist:
            throw new HHException(ExceptionType.Failed, "此品牌下存在关联商品,无法直接删除(请先删除此品牌下关联商品)!");

        case DataActionStatus.UnknownFailure:
            throw new HHException(ExceptionType.Failed, "删除商品品牌时失败,请确认此商品品牌存在,并状态正常!");

        case DataActionStatus.Success:
            BindData();
            break;
        }
    }