protected void Actualizar_Click(object sender, EventArgs e) { if (sqlCon.State == ConnectionState.Closed) { sqlCon.Open(); } SqlDataAdapter sqlCmd = new SqlDataAdapter("SELECT * FROM dinamizate.reserva WHERE idReserva = " + (R.SelectedValue.Split('-'))[0].Trim(), sqlCon); sqlCmd.SelectCommand.ExecuteNonQuery(); DataTable dt = new DataTable(); sqlCmd.Fill(dt); FechaPrestamo.Text = ((DateTime)dt.Rows[0]["Fecha"]).Day.ToString() + "/" + ((DateTime)dt.Rows[0]["Fecha"]).Month.ToString() + "/" + ((DateTime)dt.Rows[0]["Fecha"]).Year.ToString(); HoraPrestamo.SelectedValue = ((DateTime)dt.Rows[0]["Fecha"]).Hour.ToString(); MinutoPrestamo.SelectedValue = ((DateTime)dt.Rows[0]["Fecha"]).Minute.ToString(); FechaPrestamo.DataBind(); HoraPrestamo.DataBind(); MinutoPrestamo.DataBind(); }
public string AlmacenarCuotas() { string response = ""; Cuotas = new List <Cuota>(); try { for (int i = 0; i < PlazoPago; i++) { Cuota cuota = new Cuota(i, CalcularValorCuota(), FechaPrestamo.AddMonths(i)); Cuotas.Add(cuota); } response = "Cuota mensual de " + CalcularValorCuota(); } catch (Exception) { response = "No se registraron las cuotas"; } return(response); }