Ejemplo n.º 1
0
        internal bool cuadra_yardtag(string YATA_COD, int YAHI_ID, int YAPE_ID, int LUGA_ID, int TRAI_ID, int usua_id, out string mensaje) //Solicitud Carga
        {
            bool exito = false;

            mensaje = "";
            SqlAccesoDatos accesoDatos = new SqlAccesoDatos("CsString");

            accesoDatos.CargarSqlComando("[dbo].[prcYARDTAG_EVENTOS_CUADRATURA_MANUAL_CUADRAR]");
            accesoDatos.AgregarSqlParametro("@YATA_COD", YATA_COD);
            accesoDatos.AgregarSqlParametro("@YAHI_ID", YAHI_ID);
            accesoDatos.AgregarSqlParametro("@YAPE_ID", YAPE_ID);
            accesoDatos.AgregarSqlParametro("@LUGA_ID", LUGA_ID);
            accesoDatos.AgregarSqlParametro("@TRAI_ID", TRAI_ID);
            accesoDatos.AgregarSqlParametro("@usua_id", usua_id);
            //accesoDatos.AgregarSqlParametro("@RUTA", d.SOLICITUD_CARGA.RUTA);
            //accesoDatos.AgregarSqlParametro("@OBSERVACION", d.SOLICITUD_CARGA.OBSERVACION);
            //accesoDatos.AgregarSqlParametro("@ANDENES", ds.Tables["ANDENES"]);
            //accesoDatos.AgregarSqlParametro("@LOCALES", ds.Tables["LOCALES"]);
            //accesoDatos.AgregarSqlParametro("@USUA_ID", d.USUA_ID_CARGA);
            //if (d.SOLICITUD_CARGA.ID_SHORTECK != "0" && d.SOLICITUD_CARGA.ID_SHORTECK != "")
            //    accesoDatos.AgregarSqlParametro("@SHOR_ID", d.SOLICITUD_CARGA.ID_SHORTECK);
            accesoDatos.AgregarSqlParametroOUT("@ERROR", exito);
            SqlParameter param = accesoDatos.AgregarSqlParametro("@ERROR_MSG", mensaje);

            param.Direction = ParameterDirection.Output;
            param.Size      = 1000;
            try
            {
                accesoDatos.EjecutarSqlEscritura();
                mensaje = param.Value.ToString();
                exito   = true;
            }
            catch (Exception ex)
            {
                exito   = false;
                mensaje = ex.Message;
                //  throw (ex);
            }
            finally
            {
                accesoDatos.LimpiarSqlParametros();
                accesoDatos.CerrarSqlConeccion();
            }
            return(exito);
        }