示例#1
0
        /// <summary>
        /// metodo para exportar funciona todo
        /// </summary>
        public static int Exportar(ModelSecadorHorizontal pSH, int pOperacion)
        {
            var          retorno  = 0;
            var          conexion = ConexionMySql.ObtenerConexion();
            MySqlCommand comando;

            switch (pOperacion)
            {
            case 1:     //exportar todos los datos
                comando = new MySqlCommand(
                    $"Select * from secadorhorizontal('{pOperacion}','{pSH.IdLinea}','{pSH.Circuito}','{pSH.Fecha}','{pSH.MInicial}','{pSH.MFinal}','{pSH.MEnjuague}','{pSH.TAInicial}','{pSH.TAFinal}','{pSH.TAEnjuague}','{pSH.TTA}','{pSH.TipoLavado}','{pSH.TLInicial}','{pSH.TLFinal}','{pSH.TLEnjuague}','{pSH.TTLavado}','{pSH.Color1}','{pSH.Color2}','{pSH.Titulacion}','{pSH.RT1}','{pSH.RT2}','{pSH.Operador}','{pSH.Analista}'),'a','a')",
                    conexion);
                retorno = comando.ExecuteNonQuery();
                break;

            case 2:     //exportar los datos de muestras
                comando = new MySqlCommand(
                    $"Select * from secadorhorizontal('{pOperacion}','{pSH.IdLinea}','{pSH.Fecha}','{pSH.MInicial}','{pSH.MFinal}','{pSH.MEnjuague}')",
                    conexion);
                retorno = comando.ExecuteNonQuery();
                break;

            case 3:     //exportar los datos de titulacion
                comando = new MySqlCommand(
                    $"Select * from secadorhorizontal('{pOperacion}','{pSH.IdLinea}','{pSH.Fecha}','{pSH.Titulacion}','{pSH.RT1}','{pSH.RT2}')",
                    conexion);
                retorno = comando.ExecuteNonQuery();
                break;
            }
            return(retorno);
        }
示例#2
0
        public static ModelSecadorHorizontal ObtenerSH(int IdLinea)
        {
            var pMsh    = new ModelSecadorHorizontal();
            var connec  = ConexionMySql.ObtenerConexion();
            var comando = new MySqlCommand($"SELECT * FROM secadorhorizontal WHERE IDLinea ='{IdLinea}'", connec);
            var reader  = comando.ExecuteReader();

            while (reader.Read())
            {
                SHorizontalSelect.IdLinea    = reader.GetInt32(0);
                SHorizontalSelect.Circuito   = reader.GetString(1);
                SHorizontalSelect.Fecha      = reader.GetString(2);
                SHorizontalSelect.MInicial   = reader.GetString(3);
                SHorizontalSelect.MFinal     = reader.GetString(4);
                SHorizontalSelect.MEnjuague  = reader.GetString(5);
                SHorizontalSelect.TAInicial  = reader.GetString(6);
                SHorizontalSelect.TAFinal    = reader.GetString(7);
                SHorizontalSelect.TAEnjuague = reader.GetString(8);
                SHorizontalSelect.TTA        = reader.GetString(9);
                SHorizontalSelect.TipoLavado = reader.GetString(10);
                SHorizontalSelect.TLInicial  = reader.GetString(11);
                SHorizontalSelect.TLFinal    = reader.GetString(12);
                SHorizontalSelect.TLEnjuague = reader.GetString(13);
                SHorizontalSelect.TTLavado   = reader.GetString(14);
                SHorizontalSelect.Color1     = reader.GetString(15);
                SHorizontalSelect.Color2     = reader.GetString(16);
                SHorizontalSelect.Titulacion = reader.GetString(17);
                SHorizontalSelect.RT1        = reader.GetString(18);
                SHorizontalSelect.RT2        = reader.GetString(19);
                SHorizontalSelect.Operador   = reader.GetString(20);
                SHorizontalSelect.Analista   = reader.GetString(21);
            }
            connec.Close();
            return(pMsh);
        }
示例#3
0
        /// <summary>
        ///     metodo para actualizar
        /// </summary>
        public static int Actualizar(ModelSecadorHorizontal pSH)
        {
            var retorno  = 0;
            var conexion = ConexionMySql.ObtenerConexion();
            var comando  = new MySqlCommand($"UPDATE secadorhorizontal SET Circuito='{pSH.Circuito}', Fecha='{pSH.Fecha}', MInicial='{pSH.MInicial}', MFinal='{pSH.MFinal}', MEnjuague='{pSH.MEnjuague}', TAInicial='{pSH.TAInicial}', TAFinal='{pSH.TAFinal}', TAEnjuague='{pSH.TAEnjuague}', TTAnalisis='{pSH.TTA}', TipoLavado='{pSH.TipoLavado}', TLInicial='{pSH.TLInicial}', TLFinal='{pSH.TLFinal}', TLEnjuague='{pSH.TLEnjuague}', TTLavado='{pSH.TTLavado}', Color1='{pSH.Color1}', Color2='{pSH.Color2}', Titulacion='{pSH.Titulacion}', RT1='{pSH.RT1}', RT2='{pSH.RT2}', Operador='{pSH.Operador}', Analista='{pSH.Analista}' WHERE IDLinea='{pSH.IdLinea}'", conexion);

            retorno = comando.ExecuteNonQuery();
            return(retorno);
        }
示例#4
0
        /// <summary>
        ///     metodo para agregar
        /// </summary>
        public static int Agregar(ModelSecadorHorizontal pMsh)
        {
            var connec  = ConexionMySql.ObtenerConexion();
            var comando =
                new MySqlCommand(
                    $"CALL sp_SecadorHorizontal('{pMsh.IdLinea}','{pMsh.Circuito}','{pMsh.Fecha}','{pMsh.MInicial}','{pMsh.MFinal}','{pMsh.MEnjuague}','{pMsh.TAInicial}','{pMsh.TAFinal}','{pMsh.TAEnjuague}','{pMsh.TTA}','{pMsh.TipoLavado}','{pMsh.TLInicial}','{pMsh.TLFinal}','{pMsh.TLEnjuague}','{pMsh.TTLavado}','{pMsh.Color1}','{pMsh.Color2}','{pMsh.Titulacion}','{pMsh.RT1}','{pMsh.RT2}','{pMsh.Operador}','{pMsh.Analista}')",
                    connec);
            var retorno = comando.ExecuteNonQuery();

            return(retorno);
        }
示例#5
0
        /// <summary>
        ///     metodo para mostrar los tipolavado y titulacion los combobox
        /// </summary>
        public static List <ModelSecadorHorizontal> Llenarcombo()
        {
            var lista   = new List <ModelSecadorHorizontal>();
            var connec  = ConexionMySql.ObtenerConexion();
            var comando = new MySqlCommand("SELECT * FROM secadorhorizontal", connec);
            var reader  = comando.ExecuteReader();

            while (reader.Read())
            {
                var pSH = new ModelSecadorHorizontal
                {
                    IdLinea    = reader.GetInt32(0),
                    TipoLavado = reader.GetString(1),
                    Titulacion = reader.GetString(2)
                };
                lista.Add(pSH);
            }
            return(lista);
        }
示例#6
0
        /// <summary>
        ///     metodo para buscar
        /// </summary>
        public static List <ModelSecadorHorizontal> Buscar(string pCircuito)
        {
            var lista   = new List <ModelSecadorHorizontal>();
            var connec  = ConexionMySql.ObtenerConexion();
            var comando = new MySqlCommand($"SELECT * FROM secadorhorizontal WHERE Circuito='{pCircuito}'", connec);
            var reader  = comando.ExecuteReader();

            while (reader.Read())
            {
                var pSH = new ModelSecadorHorizontal
                {
                    IdLinea    = reader.GetInt32(0),
                    Circuito   = reader.GetString(1),
                    Fecha      = reader.GetString(2),
                    MInicial   = reader.GetString(3),
                    MFinal     = reader.GetString(4),
                    MEnjuague  = reader.GetString(5),
                    TAInicial  = reader.GetString(6),
                    TAFinal    = reader.GetString(7),
                    TAEnjuague = reader.GetString(8),
                    TTA        = reader.GetString(9),
                    TipoLavado = reader.GetString(10),
                    TLInicial  = reader.GetString(11),
                    TLFinal    = reader.GetString(12),
                    TLEnjuague = reader.GetString(13),
                    TTLavado   = reader.GetString(14),
                    Color1     = reader.GetString(15),
                    Color2     = reader.GetString(16),
                    Titulacion = reader.GetString(17),
                    RT1        = reader.GetString(18),
                    RT2        = reader.GetString(19),
                    Operador   = reader.GetString(20),
                    Analista   = reader.GetString(21)
                };
                lista.Add(pSH);
            }
            return(lista);
        }