public static List <guardarantiguedadcxc> MostrarDatoscxc() { List <guardarantiguedadcxc> lista = new List <guardarantiguedadcxc>(); MySqlCommand comandocxc = new MySqlCommand(String.Format("select * from guardarantiguedadcxc;"), conexion.obtenerconexion()); MySqlDataReader readercxc = comandocxc.ExecuteReader(); while (readercxc.Read()) { guardarantiguedadcxc acxc = new guardarantiguedadcxc { Idcompania = readercxc.GetInt16(0), Nombrecliente = readercxc.GetString(1), Moneda = readercxc.GetInt16(2), Cuentacxc = readercxc.GetString(3), Diascredito = readercxc.GetInt16(4), Fechadocumento = readercxc.GetDateTime(5), Fechavencimiento = readercxc.GetDateTime(6), Montooriginal = readercxc.GetDecimal(7), Sinvencer = readercxc.GetDecimal(8), De1a30 = readercxc.GetDecimal(9), De31a60 = readercxc.GetDecimal(10), De61a90 = readercxc.GetDecimal(11), Mas90 = readercxc.GetDecimal(12), Tipo = readercxc.GetString(13) }; lista.Add(acxc); } return(lista); }
// funciones formulario Guardar Antiguedad CXC public static int Agregarcxc(guardarantiguedadcxc add) { int retornocxc = 0; MySqlCommand comandocxc = new MySqlCommand(String.Format("insert into guardarantiguedadcxc(Idcompania, NombreCliente, Moneda, CuentaCXC, DiasCredito, FechaDocumento, FechaVencimiento, MontoOriginal, Sinvencer, De1a30, De31a60, De61a90, Mas90, Tipo) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}');", add.Idcompania, add.Nombrecliente, add.Moneda, add.Cuentacxc, add.Diascredito, add.Fechadocumento, add.Fechavencimiento, add.Montooriginal, add.Sinvencer, add.De1a30, add.De31a60, add.De61a90, add.Mas90, add.Tipo), conexion.obtenerconexion()); retornocxc = comandocxc.ExecuteNonQuery(); return(retornocxc); }