Exemplo n.º 1
0
        private bool booking(Reservacion res)
        {
            // funcion que voy a procesar
            string sp = "FNRVA_OBEES";
            bool   ok;

            UConnection     DB     = new UConnection(Properties.Settings.Default.ipBD, Properties.Settings.Default.serverBD, Properties.Settings.Default.usuarioBD, Properties.Settings.Default.passBD);
            OracleCommand   cmd    = new OracleCommand();
            OracleParameter retval = new OracleParameter("V_RESERVA", OracleDbType.Varchar2, 50);

            retval.Direction = ParameterDirection.ReturnValue;
            cmd.Parameters.Add(retval);
            //res.Rva_oasis_rva = Convert.ToString(retval.Value);
            OracleParameter inval = new OracleParameter("inval", OracleDbType.Varchar2);

            inval.Direction = ParameterDirection.Input;
            inval.Value     = res.Rva_action;
            cmd.Parameters.Add(inval);
            OracleParameter inval2 = new OracleParameter("inval2", OracleDbType.Varchar2);

            inval2.Direction = ParameterDirection.Input;
            inval2.Value     = res.Rva_uniqueID;
            cmd.Parameters.Add(inval2);
            OracleParameter inval3 = new OracleParameter("inval3", OracleDbType.Varchar2);

            inval3.Direction = ParameterDirection.Input;
            inval3.Value     = fecha_actual;
            cmd.Parameters.Add(inval3);
            OracleParameter inval4 = new OracleParameter("inval4", OracleDbType.Varchar2);

            inval4.Direction = ParameterDirection.Input;
            inval4.Value     = hora_actual;
            cmd.Parameters.Add(inval4);
            OracleParameter outval = new OracleParameter("outval", OracleDbType.Varchar2, 50);

            outval.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(outval);
            //res.Rva_oasis_errcode = Convert.ToString(outval.Value);
            OracleParameter outval2 = new OracleParameter("outval2", OracleDbType.Varchar2, 50);

            outval2.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(outval2);
            //res.Rva_oasis_errdesc = Convert.ToString(outval2.Value);

            ok = DB.EjecutaSP(ref cmd, sp);
            if (ok)
            {
                Reserva   = cmd.Parameters["V_RESERVA"].Value.ToString();
                ErrorCode = cmd.Parameters["ERRCODE"].Value.ToString();
                ErrDesc   = cmd.Parameters["ERRDESC"].Value.ToString();
            }
            return(ok);
        }