Beispiel #1
0
        /*
         * public DataTable GetAllIng()
         * {
         *  using (OracleConnection con = new conexion().Conexion())
         *  {
         *      OracleCommand cm = new OracleCommand("Get_alling", con);
         *      cm.BindByName = true;
         *      cm.CommandType = System.Data.CommandType.StoredProcedure;
         *      OracleParameter output = cm.Parameters.Add("my_cursor", OracleDbType.RefCursor);
         *      output.Direction = System.Data.ParameterDirection.ReturnValue;
         *      con.Open();
         *      cm.ExecuteNonQuery();
         *
         *      OracleDataReader reader = ((OracleRefCursor)output.Value).GetDataReader();
         *      con.Close();
         *      using (DataTable dt = new DataTable())
         *      {
         *          OracleDataAdapter adapter = new OracleDataAdapter(cm);
         *          adapter.Fill(dt);
         *          return dt;
         *
         *      }
         *  }
         * }
         */

        public bool SolicitarBebestible(bebestibleDAL objingDAL)
        {
            try
            {
                using (OracleConnection con = new conexion().Conexion())
                {
                    OracleDataAdapter da     = new OracleDataAdapter();
                    OracleCommand     objCmd = new OracleCommand("SolicitarInsumoBebestible", con);
                    objCmd.CommandType = CommandType.StoredProcedure;
                    objCmd.BindByName  = true;
                    objCmd.Parameters.Add("p_nomb", OracleDbType.Varchar2).Value = nombre_ins;
                    objCmd.Parameters.Add("p_stock", OracleDbType.Double).Value  = stock;


                    con.Open();
                    objCmd.ExecuteNonQuery();
                    con.Close();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Exception: {0}", ex.ToString());

                return(false);
            }
        }
Beispiel #2
0
 public static bebestibleDAL Getinstancia()
 {
     if (instance == null)
     {
         instance = new bebestibleDAL();
     }
     return(instance);
 }