private void Grid_SelectionChanged(object sender, EventArgs e) { if (Grid.SelectedRows.Count > 0) { this.Ahorro = (DTO.Ahorro)Grid.SelectedRows[0].DataBoundItem; RefreshAhorroData(); } }
private void ResetForm() { ahorroBindingSource.DataSource = DAL.Session.Ahorros.Find().OrderByDescending(p => p.CreaFecha).ToArray(); foreach (var row in Grid.Rows.OfType <DataGridViewRow>()) { var data = (DTO.Ahorro)row.DataBoundItem; if ((data.FechaHasta ?? DateTime.MaxValue) < DateTime.Now) { row.DefaultCellStyle.ForeColor = Color.Red; } } cmbTipo.Items.Clear(); cmbTipo.Items.AddRange(Enum.GetNames(typeof(DTO.Ahorro.TipoAhorros))); this.Ahorro = new DTO.Ahorro(DTO.Ahorro.TipoAhorros.PlazoFijo); RefreshAhorroData(); }
private void BNew_Click(object sender, EventArgs e) { this.Ahorro = new DTO.Ahorro(DTO.Ahorro.TipoAhorros.PlazoFijo); RefreshAhorroData(); }