Example #1
0
        // funciones formulario Guardar Tipo Cambio
        public static int Agregargtc(guardartipocambio add)
        {
            int          retornogtc = 0;
            MySqlCommand comandogtc = new MySqlCommand(String.Format("insert into guardartipocambio(Tipocambiocompra, Tipocambioventa, Moneda) values ('{0}','{1}','{2}');", add.Tipocambiocompra, add.Tipocambioventa, add.Moneda), conexion.obtenerconexion());

            retornogtc = comandogtc.ExecuteNonQuery();
            return(retornogtc);
        }
Example #2
0
        public static List <guardartipocambio> MostrarDatosgtc()
        {
            List <guardartipocambio> lista      = new List <guardartipocambio>();
            MySqlCommand             comandogtc = new MySqlCommand(String.Format("select * from guardartipocambio;"), conexion.obtenerconexion());
            MySqlDataReader          readergtc  = comandogtc.ExecuteReader();

            while (readergtc.Read())
            {
                guardartipocambio agtc = new guardartipocambio
                {
                    Tipocambiocompra = readergtc.GetDecimal(0),
                    Tipocambioventa  = readergtc.GetDecimal(1),
                    Moneda           = readergtc.GetInt16(2)
                };
                lista.Add(agtc);
            }
            return(lista);
        }