public static object insertar(string categoriaC, string unidad_de_medidaC, string nombre_ProductoC, string cantidadC, string costoC, string precio_ventaC, string entrada_del_productoC, string descripcionC, string reposicionC) { Almacen_BL bc = new Almacen_BL(); Almacen_E alm = new Almacen_E(); int categoriaV = Convert.ToInt32(categoriaC); int unidadDeMedidaV = Convert.ToInt32(unidad_de_medidaC); int cantidadV = Convert.ToInt32(cantidadC); decimal costoV = Convert.ToDecimal(costoC); decimal precio_ventaV = Convert.ToDecimal(precio_ventaC); DateTime entrada_productoV = Convert.ToDateTime(entrada_del_productoC); decimal reposicionV = Convert.ToDecimal(reposicionC); alm.cantidad = categoriaV; alm.unidad_de_medida = unidadDeMedidaV; alm.nombre_producto = nombre_ProductoC; alm.cantidad = cantidadV; alm.costo = costoV; alm.precio_venta = precio_ventaV; alm.entrada_del_producto = entrada_productoV; alm.reposicion = reposicionV; alm.descripcion = descripcionC; return(bc.Insertar(alm)); }
public object insertar(Almacen_E alm) { using (SqlConnection cn = new SqlConnection(cnSTR)) { cn.Open(); SqlCommand cmd = cn.CreateCommand(); cmd.CommandText = "Insertar_Almacen"; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@categoria", alm.categoria); cmd.Parameters.AddWithValue("@unidad_de_medida", alm.unidad_de_medida); cmd.Parameters.AddWithValue("@nombre_producto", alm.nombre_producto); cmd.Parameters.AddWithValue("@cantidad", alm.cantidad); cmd.Parameters.AddWithValue("@costo", alm.costo); cmd.Parameters.AddWithValue("@precio_venta", alm.precio_venta); cmd.Parameters.AddWithValue("@entrada_producto", alm.entrada_del_producto); cmd.Parameters.AddWithValue("@descripcion", alm.descripcion); cmd.Parameters.AddWithValue("@reposicion", alm.reposicion); return(cmd.ExecuteScalar()); } }
public object Insertar(Almacen_E alm) { return(db.insertar(alm)); }