Exemple #1
0
    public static void InsertProducto(Producto theData)
    {
        try
        {
            int?productoId = 0;

            ProductoDSTableAdapters.ProductoTableAdapter localAdapter = new ProductoDSTableAdapters.ProductoTableAdapter();
            localAdapter.InsertProducto(theData.Descripcion, theData.PrecioCompra, theData.PrecioVenta, ref productoId);

            if (productoId.Value <= 0)
            {
                throw new ArgumentException("Error al registrar Producto.");
            }
        }
        catch (Exception q)
        {
            throw new ArgumentException(q.Message, q);
        }
    }