Exemplo n.º 1
0
 public static Producto InsertWithReturn(string descripcion, string nombre,
                                         string precio, string medida, string idcategoria, string costo)
 {
     ProductoDSTableAdapters.tbl_productoTableAdapter adapter = new ProductoDSTableAdapters.tbl_productoTableAdapter();
     ProductoDS.tbl_productoDataTable table = adapter.InsertWithReturn(descripcion,
                                                                       nombre, Convert.ToDouble(precio), medida, Convert.ToInt32(idcategoria), 0,
                                                                       Convert.ToDouble(costo), 0);
     if (table.Rows.Count == 0)
     {
         return(null);
     }
     return(RowToDto(table[0]));
 }