Пример #1
0
        public bool AgregarIngrediente(IngredienteDAL objUserdal)
        {
            try
            {
                using (OracleConnection con = new Conexion().conexion())
                {
                    OracleCommand objCmd = new OracleCommand();
                    objCmd.Connection  = con;
                    objCmd.CommandText = "InsertarIngrediente";
                    objCmd.CommandType = CommandType.StoredProcedure;
                    objCmd.Parameters.Add("p_nom", OracleDbType.Varchar2).Value        = nombre_ingrediente;
                    objCmd.Parameters.Add("p_provee", OracleDbType.Varchar2).Value     = proveedor;
                    objCmd.Parameters.Add("p_habilitado", OracleDbType.Varchar2).Value = habilitado;
                    objCmd.Parameters.Add("p_stock", OracleDbType.Decimal).Value       = stock;
                    objCmd.Parameters.Add("p_stock_coci", OracleDbType.Decimal).Value  = stock_cocina;

                    con.Open();
                    objCmd.ExecuteNonQuery();
                    con.Close();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Exception: {0}", ex.ToString());
                return(false);
            }
        }
Пример #2
0
 public void AlterIngrediente(IngredienteDAL objaux)
 {
     try
     {
         using (OracleConnection con = new Conexion().conexion())
         {
             OracleDataAdapter da = new OracleDataAdapter();
             OracleCommand     cm = new OracleCommand("alter_Ingrediente", con);
             cm.BindByName  = true;
             cm.CommandType = System.Data.CommandType.StoredProcedure;
             cm.Parameters.Add("p_nom", OracleDbType.Varchar2).Value        = nombre_ingrediente;
             cm.Parameters.Add("p_proveedor", OracleDbType.Varchar2).Value  = proveedor;
             cm.Parameters.Add("p_habilitado", OracleDbType.Varchar2).Value = habilitado;
             cm.Parameters.Add("p_stock", OracleDbType.Int32).Value         = stock;
             cm.Parameters.Add("p_stock_cocina", OracleDbType.Int32).Value  = stock_cocina;
             cm.Parameters.Add("ide", OracleDbType.Int32).Value             = id_ingrediente;
             con.Open();
             cm.ExecuteNonQuery();
             con.Close();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("" + ex);
     }
 }
Пример #3
0
 public void Altereliminaring(IngredienteDAL objaux)
 {
     try
     {
         using (OracleConnection con = new Conexion().conexion())
         {
             OracleDataAdapter da = new OracleDataAdapter();
             OracleCommand     cm = new OracleCommand("alter_estadoingrediente", con);
             cm.BindByName  = true;
             cm.CommandType = System.Data.CommandType.StoredProcedure;
             cm.Parameters.Add("ide", OracleDbType.Varchar2).Value = id_ingrediente;
             con.Open();
             cm.ExecuteNonQuery();
             con.Close();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("" + ex);
     }
 }