Example #1
0
        public int BuscarPaginasxPliegoFormato(string Formato, int CantidadPaginas)
        {
            int        Resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "TarImpInt";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Paginas", CantidadPaginas);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        Resultado = Convert.ToInt32(reader["Costo"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(Resultado);
        }
Example #2
0
        public double TarifaCostoBarnizAcuoso(int Gramaje, string Formato, string Maquina, string Empresa)
        {
            double     Resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_BarnizAcuoso_Variable";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Gramaje", Gramaje);
                    cmd.Parameters.AddWithValue("@Maquina", Maquina);
                    cmd.Parameters.AddWithValue("@Formato", Formato);
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        Resultado = Convert.ToDouble(reader["Costo"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(Resultado);
        }
Example #3
0
        public double TarifapapelMermaVariable(string Formato, string Maquina, string TipoComponente, int Gramaje, double Entradas, int Tiraje)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Merma_Variable";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Formato", Formato);
                    cmd.Parameters.AddWithValue("@Maquina", Maquina);
                    cmd.Parameters.AddWithValue("@TipoComponente", TipoComponente);
                    cmd.Parameters.AddWithValue("@Gramaje", Gramaje);
                    cmd.Parameters.AddWithValue("@Entradas", Entradas);
                    cmd.Parameters.AddWithValue("@Tiraje", Tiraje);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["CostoMermaVariable"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
Example #4
0
        public double TarifaDespacho(string Proceso, string TipoCosto, int CantVersiones)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Despacho_Costos";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Proceso", Proceso);
                    cmd.Parameters.AddWithValue("@TipoCosto", TipoCosto);
                    cmd.Parameters.AddWithValue("@CantVersion", CantVersiones);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["Costo"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
Example #5
0
        public Vehiculo TarifaDespacho_Vehiculo(string TipoVehiculo, string Empresa)
        {
            Vehiculo   resultado = new Vehiculo();
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Vehiculo_Flete_Cap";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@TipoVehiculo", TipoVehiculo);
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado.NombreVehiculo = reader["TipoVehiculo"].ToString();
                        resultado.Costo_Flete    = Convert.ToInt32(reader["Costo_Flete"].ToString());
                        resultado.Capacidad      = Convert.ToInt32(reader["Capacidad"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
Example #6
0
        public ValorDolar_Trimestral BuscarDolar_ID(int id)
        {
            ValorDolar_Trimestral dolar = new ValorDolar_Trimestral();
            Conexion   con = new Conexion();
            SqlCommand cmd = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "PPTO_BuscarDolarTri_ID";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ID", id);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        dolar.NombreTrimestre = reader["NombreTrimestre"].ToString();
                        dolar.ValorTrimestre  = Convert.ToDouble(reader["ValorTrimestre"].ToString());
                        dolar.FechaInicio     = Convert.ToDateTime(reader["FechaInicio"].ToString());
                        dolar.FechaTermino    = Convert.ToDateTime(reader["FechaTermino"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(dolar);
        }
Example #7
0
        public double TarifaEncuadernacion(string NombreEncuadernacion, int CantidadEntradas, string TipoCosto, string Empresa)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Encuadernacion_Costos";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@NombreEncuadernacion", NombreEncuadernacion);
                    cmd.Parameters.AddWithValue("@CantidadEntradas", CantidadEntradas);
                    cmd.Parameters.AddWithValue("@TipoCosto", TipoCosto);
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["CostoEncuadernacion"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
        public List <Cotizador> Listar_Formato()
        {
            List <Cotizador> lista = new List <Cotizador>();
            Conexion         con   = new Conexion();
            SqlCommand       cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "PPTO_ListarFormatos";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Cotizador p = new Cotizador();
                        p.Formato    = reader["nombre_Formato"].ToString();
                        p.PaginasInt = Convert.ToInt32(reader["no_paginas_x_pliego"].ToString());
                        lista.Add(p);
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
        public List <Cotizador> List_Papel(string Empresa, string Tipo)
        {
            List <Cotizador> lista = new List <Cotizador>();
            Conexion         con   = new Conexion();
            SqlCommand       cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "PPTO_ListarPapeles";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    cmd.Parameters.AddWithValue("@Tipo", Tipo);
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        Cotizador p = new Cotizador();
                        p.PapelInterior   = reader["TipoPapel"].ToString();
                        p.GramajeInterior = reader["gramaje"].ToString();
                        lista.Add(p);
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
        public ValorDolar_Trimestral ValorDolarTrimestreActivo()
        {
            ValorDolar_Trimestral valorq = new ValorDolar_Trimestral();
            Conexion   con = new Conexion();
            SqlCommand cmd = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "List_ValTri";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        valorq.NombreTrimestre = reader["NombreTrimestre"].ToString();
                        valorq.ValorTrimestre  = Convert.ToDouble(reader["ValorTrimestre"].ToString());
                        valorq.FechaInicio     = Convert.ToDateTime(reader["FechaInicio"].ToString());
                        valorq.FechaTermino    = Convert.ToDateTime(reader["FechaTermino"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(valorq);
        }
        public List <Cotizador> Listar_Paginas_Interior(string Doblez)
        {
            List <Cotizador> lista = new List <Cotizador>();
            Conexion         con   = new Conexion();
            SqlCommand       cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Pre_ListarPaginasInterior";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Cotizador p = new Cotizador();
                        p.Formato = reader["Cant_Paginas"].ToString();

                        lista.Add(p);
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
Example #12
0
        public List <Terminaciones> Listar_Terminaciones()
        {
            List <Terminaciones> lista = new List <Terminaciones>();
            Conexion             con   = new Conexion();
            SqlCommand           cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "PPTO_ListarTerminacion";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        Terminaciones t = new Terminaciones();
                        t.NombreTerminacion  = reader["Nombre_Terminacion"].ToString();
                        t.NombreSumplifacado = reader["simpli"].ToString();
                        lista.Add(t);
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
Example #13
0
        public Tarifa_Papel TarifaCostoPapel(int Gramaje, string Componente, string Maquina, string TipoPapel, string Empresa, string Formato)
        {
            Tarifa_Papel papel = new Tarifa_Papel();
            Conexion     con   = new Conexion();
            SqlCommand   cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Carga_CostoPapel";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Gramaje", Gramaje);
                    cmd.Parameters.AddWithValue("@Componente", Componente);
                    cmd.Parameters.AddWithValue("@Maquina", Maquina);
                    cmd.Parameters.AddWithValue("@NombreTipoPapel", TipoPapel);
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    cmd.Parameters.AddWithValue("@Formato", Formato);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        papel.PrecioPapel         = Convert.ToDouble(reader["PrecioPapel"].ToString());
                        papel.TarifaMermaFija     = Convert.ToInt32(reader["CostoFijoPapel"].ToString());
                        papel.TarifaMermaVariable = Convert.ToDouble(reader["CostoVariablePapel"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(papel);
        }
Example #14
0
        public double TarifaCostoImpresionTapaBarniz(int Gramaje, string Formato)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "TarifaImpresionTapasBarniz";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Gramaje", Gramaje);
                    cmd.Parameters.AddWithValue("@Formato", Formato);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["CostoBarniz"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
Example #15
0
        public Usuario IniciarSession(string Correo, string Contraseña)
        {
            Usuario    user = new Usuario();
            Conexion   con  = new Conexion();
            SqlCommand cmd  = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "AccesoLogin";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Correo", Correo);
                    cmd.Parameters.AddWithValue("@Password", Contraseña);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        user.IDUsuario      = Convert.ToInt32(reader["ID_Usuario"].ToString());
                        user.NombreCompleto = reader["Nombre_Completo"].ToString();
                        user.Perfil         = reader["Perfil"].ToString();
                        user.Empresa        = reader["Empresa"].ToString();
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(user);
        }
        public List <Terminaciones> Listar_Terminaciones()
        {
            List <Terminaciones> lista = new List <Terminaciones>();
            Conexion             con   = new Conexion();
            SqlCommand           cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "PPTO_ListarTerminacion";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        Terminaciones t = new Terminaciones();
                        t.NombreTerminacion = reader["Nombre_Terminacion"].ToString();
                        t.CostoFijo         = Convert.ToDouble(reader["CostoFijoTerm"]);
                        t.CostoVari         = Convert.ToDouble(reader["CostoVariTerm"]);
                        t.Doblez            = reader["Doblez"].ToString();
                        t.TipoTerm          = reader["TipoTerminacion"].ToString();
                        lista.Add(t);
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
Example #17
0
        public Usuario BuscarPersonalComercial_Empresa(string Empresa)
        {
            Usuario    user = new Usuario();
            Conexion   con  = new Conexion();
            SqlCommand cmd  = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "BuscarPersonalComercial_Empresa";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        user.NombreCompleto = reader["Nombre_Completo"].ToString();
                        user.Telefono       = reader["Telefono"].ToString();
                        user.Celular        = reader["Celular"].ToString();
                        user.Correo         = reader["Correo"].ToString();
                        user.Empresa        = Empresa;
                        user.Fax            = reader["Fax"].ToString();
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(user);
        }
        public double ValorUF()
        {
            double     Resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_ValorUF";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        Resultado = Convert.ToDouble(reader["Valor"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(Resultado);
        }
Example #19
0
        public double TarifaCostoImpresion(string Paginas, string Doblez, string Maquina, string TipoCosto, string Empresa)
        {
            double     Resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Impresion_BuscarCosto";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Paginas", Paginas);
                    cmd.Parameters.AddWithValue("@Doblez", Doblez);
                    cmd.Parameters.AddWithValue("@Maquina", Maquina);
                    cmd.Parameters.AddWithValue("@TipoCosto", TipoCosto);
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        Resultado = Convert.ToDouble(reader["Costo"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(Resultado);
        }
        public bool IngresoValorUfDelDia(double valor)
        {
            Boolean    resultado = false;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "ValorUF_Insert";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Valor", valor);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToBoolean(reader["Resultado"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
Example #21
0
        public double TarifaTerminacionTapasMtCuadrados(string NombreTerminacion, string Formato, int Entradas, string Empresa)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Terminaciones_TapasMtCuadrado";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Terminacion", NombreTerminacion);
                    cmd.Parameters.AddWithValue("@Formato", Formato);
                    cmd.Parameters.AddWithValue("@Entrada", Entradas);
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["CostoTerminacion"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
        public List <Impresion> ListarImpresion(string Maquina)
        {
            List <Impresion> lista = new List <Impresion>();
            Conexion         con   = new Conexion();
            SqlCommand       cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "PPTO_ListarImpresiones";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Maquina", Maquina);
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        Impresion imp = new Impresion();
                        imp.TipoCosto = reader["TipoCosto"].ToString();
                        imp.Paginas   = reader["Paginas"].ToString();
                        imp.Maquina   = reader["Maquina"].ToString();
                        imp.Costo     = Convert.ToDouble(reader["Costo"].ToString());
                        lista.Add(imp);
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
Example #23
0
        public double TarifaDespacho_Espesor(string TipoPapel, int Gramaje)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Despacho_Espesor";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@TipoPapel", TipoPapel);
                    cmd.Parameters.AddWithValue("@Gramaje", Gramaje);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["Cant_Espesor_mm"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
        public Encuadernacion ListarEncuadernacion(string NombreEnc)
        {
            Encuadernacion lista = new Encuadernacion();
            Conexion       con   = new Conexion();
            SqlCommand     cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Tarifa_Encuadernacion_Costos";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@NombreEncuadernacion", NombreEnc);
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        lista.ValorFijoEnc = Convert.ToDouble(reader["ValorFijoEnc"].ToString());
                        lista.ValorVariEnc = Convert.ToDouble(reader["ValorVariableEnc"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
Example #25
0
        public Medios TarifaDespacho_Medios(string Empresa)
        {
            Medios     resultado = new Medios();
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "TarifaDespacho_Medios";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado.ProcentajeMedios = Convert.ToDouble(reader["Porcentaje_Medios"].ToString());
                        resultado.Cant_Santiago    = Convert.ToInt32(reader["Cant_LocalesSantiago"].ToString());
                        resultado.Cant_Stg_abc1    = Convert.ToInt32(reader["Cant_LocalesStg_ABC1"].ToString());
                        resultado.Cant_Stg_c2c3    = Convert.ToInt32(reader["Cant_LocalesStg_C2C3"].ToString());
                        resultado.Cant_Regiones    = Convert.ToInt32(reader["Cant_LocalesRegiones"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
        public List <PPTO_Tirajes> ListarTirajes_ID(int id)
        {
            List <PPTO_Tirajes> lista = new List <PPTO_Tirajes>();
            Conexion            con   = new Conexion();
            SqlCommand          cmd   = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "ListarTirajes_IDPPTO";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@IDPPTO", id);
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        PPTO_Tirajes tirajes = new PPTO_Tirajes();
                        tirajes.IDTiraje              = Convert.ToInt32(reader["id_pptoTiraje"].ToString());
                        tirajes.NombreTiraje          = reader["NombreTiraje"].ToString();
                        tirajes.Cantidad              = Convert.ToInt32(reader["Cantidad"].ToString());
                        tirajes.TirajeNombreExtendido = tirajes.NombreTiraje + " - Cantidad: " + tirajes.Cantidad.ToString("N0").Replace(",", ".");
                        tirajes.CostoTotal            = Convert.ToDouble(reader["CostoTotal"].ToString());
                        tirajes.Costounitario         = Convert.ToInt32(reader["CostoUnitario"].ToString());
                        tirajes.Millaradicional       = Convert.ToInt32(reader["MillarAdicional"].ToString());
                        lista.Add(tirajes);
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(lista);
        }
Example #27
0
        public double TarifaDespacho_CostoProduccion(string Empresa)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "TarifaDespacho_CostoProduccion";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["CostoProduccion"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
        public bool AprobarPPTO_ID(int id)
        {
            Boolean    respuesta = false;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "PPTO_AprobarPPTO_ID";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@IDTiraje", id);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        respuesta = Convert.ToBoolean(reader["respuesta"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(respuesta);
        }
Example #29
0
        public double TarifapapelPrecioPapel_idPPTO(int Gramaje, string Maquina, string TipoComponente, string NombreTipoPapel, string Empresa, int IDPPTO)
        {
            double     resultado = 0;
            Conexion   con       = new Conexion();
            SqlCommand cmd       = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "Carga_CostoPapel_idPPTO";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Gramaje", Gramaje);
                    cmd.Parameters.AddWithValue("@Maquina", Maquina);
                    cmd.Parameters.AddWithValue("@Componente", TipoComponente);
                    cmd.Parameters.AddWithValue("@NombreTipoPapel", NombreTipoPapel);
                    cmd.Parameters.AddWithValue("@Empresa", Empresa);
                    cmd.Parameters.AddWithValue("@IDPPTO", IDPPTO);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        resultado = Convert.ToDouble(reader["CostoPapel"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(resultado);
        }
Example #30
0
        public int TarifaEncuadernacion(string TipoEnc, string proceso)
        {
            int        result = 0;
            Conexion   con    = new Conexion();
            SqlCommand cmd    = con.AbrirConexionPPTO();

            if (cmd != null)
            {
                try
                {
                    cmd.CommandText = "TarEncuader";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Tipo", TipoEnc);
                    cmd.Parameters.AddWithValue("@Proc", proceso);
                    SqlDataReader reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        result = Convert.ToInt32(reader["Costo"].ToString());
                    }
                }
                catch
                {
                }
            }
            con.CerrarConexion();
            return(result);
        }