public bool AgregarBebestible(BebestibleDAL objUserdal) { try { using (OracleConnection con = new Conexion().conexion()) { OracleCommand objCmd = new OracleCommand(); objCmd.Connection = con; objCmd.CommandText = "InsertarBebestible"; objCmd.BindByName = true; objCmd.CommandType = CommandType.StoredProcedure; objCmd.Parameters.Add("p_nom", OracleDbType.Varchar2).Value = nombre_beb; objCmd.Parameters.Add("p_marc", OracleDbType.Varchar2).Value = marca; objCmd.Parameters.Add("p_preci", OracleDbType.Int32).Value = precio; objCmd.Parameters.Add("p_stock", OracleDbType.Int32).Value = stock; objCmd.Parameters.Add("p_stock_bar", OracleDbType.Int32).Value = stock_bar; objCmd.Parameters.Add("p_imag", OracleDbType.Blob).Value = imagen; objCmd.Parameters.Add("p_habilit", OracleDbType.Varchar2).Value = habilitado; objCmd.Parameters.Add("con_prep", OracleDbType.Varchar2).Value = con_prep; con.Open(); objCmd.ExecuteNonQuery(); con.Close(); return(true); } } catch (Exception ex) { System.Console.WriteLine("Exception: {0}", ex.ToString()); return(false); } }
public void AlterBebestible(BebestibleDAL objaux) { try { using (OracleConnection con = new Conexion().conexion()) { OracleDataAdapter da = new OracleDataAdapter(); OracleCommand cm = new OracleCommand("alter_bebestible", con); cm.BindByName = true; cm.CommandType = System.Data.CommandType.StoredProcedure; cm.Parameters.Add("p_nom", OracleDbType.Varchar2).Value = nombre_beb; cm.Parameters.Add("p_marca", OracleDbType.Varchar2).Value = marca; cm.Parameters.Add("p_precio", OracleDbType.Int32).Value = precio; cm.Parameters.Add("p_stock", OracleDbType.Int32).Value = stock; cm.Parameters.Add("p_stockbar", OracleDbType.Int32).Value = stock_bar; cm.Parameters.Add("p_habilitado", OracleDbType.Varchar2).Value = habilitado; cm.Parameters.Add("p_con_prep", OracleDbType.Varchar2).Value = con_prep; cm.Parameters.Add("ide", OracleDbType.Int32).Value = id_bebestible; con.Open(); cm.ExecuteNonQuery(); con.Close(); } } catch (Exception ex) { Console.WriteLine("" + ex); } }
public void Altereestado_espera(BebestibleDAL objaux) { try { using (OracleConnection con = new Conexion().conexion()) { OracleDataAdapter da = new OracleDataAdapter(); OracleCommand cm = new OracleCommand("alter_beb_preparado", con); cm.BindByName = true; cm.CommandType = System.Data.CommandType.StoredProcedure; cm.Parameters.Add("ide", OracleDbType.Varchar2).Value = numero_pedido; con.Open(); cm.ExecuteNonQuery(); con.Close(); } } catch (Exception ex) { Console.WriteLine("" + ex); } }