示例#1
0
    public ProductType GetProductType(int id)
    {
        ProductType     productType = new ProductType();
        ProductTypesDAO dao         = new ProductTypesDAO();

        productType = dao.GetProductType(id);
        return(productType);
    }
示例#2
0
    public void DeleteProductType(int id)
    {
        ProductTypesDAO dao = new ProductTypesDAO();
        ProductType     deleteProductType = dao.GetProductType(id);

        if (deleteProductType != null)
        {
            int result = dao.DeleteProductType(deleteProductType);
            if (result < 1)
            {
                throw new Exception("No es posible eliminar el Tipo de Producto, por favor verificar que no existan Productos asociados al Tipo de Producto");
            }
        }
        else
        {
            throw new Exception("El id del Tipo de Producto a eliminar no es válido");
        }
    }