/// <summary> /// Inserta los datos de la cuota en la tabla /// </summary> /// <returns>true si fue exitoso y false si hubo algun error</returns> public bool InsertarCuota() { bool res = false; int numero = 0; //string fecha = DateTime.Now.ToShortDateString().Replace('/', '-'); //fecha = fecha.Substring(6, 4) + "-" + fecha.Substring(3, 2) + "-" + fecha.Substring(0, 2); if (this.MaximaCuota() == 0) { numero = 1; } else if (this.MaximaCuota() > 0) { numero = this.MaximaCuota() + 1; } if (this.ValidardatosCuota()) { string sql = "INSERT INTO tcuotas(abono, codigo_prestamo, fecha, numero, cobrador, cod_dia)"; sql += " VALUES (" + Abono.ToString().Replace(",", ".") + ","; sql += "'" + CodigoPrestamo + "',"; sql += "'" + this.Fecha + "', " + numero + ",'" + CedulaCobrador + "', " + Cod_Dia + ");"; res = conex.Ejecutar(sql); } else { res = false; } return(res); }
private void txtAbono_Enter(object sender, EventArgs e) { txtAbono.Text = Abono.ToString(); txtAbono.SelectAll(); }