private void btnEditar_Click(object sender, EventArgs e) { try { if (this.dgvHorarios.CurrentRow != null) { var frmHorarioEdit = FrmHorarioSemanalMant.Instance(); frmHorarioEdit.MdiParent = this.MdiParent; frmHorarioEdit.Show(); frmHorarioEdit.frmList = this; var uiHorarioSemanal = (BE.UI.HorarioSemanal) this.dgvHorarios.CurrentRow.DataBoundItem; frmHorarioEdit.cboAnho.SelectedValue = uiHorarioSemanal.Anho.ToString(); frmHorarioEdit.cboSemana.SelectedValue = uiHorarioSemanal.Semana.ToString(); frmHorarioEdit.cboSala.SelectedValue = uiHorarioSemanal.SalaId; frmHorarioEdit.CargarRangoFechas(uiHorarioSemanal.Anho, uiHorarioSemanal.Semana); frmHorarioEdit.Cargar(uiHorarioSemanal); } } catch (Exception ex) { Util.ErrorMessage(ex.Message); } }
private void dgvHorarios_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0) { return; } var uiHorarioSemanal = (BE.UI.HorarioSemanal) this.dgvHorarios.Rows[e.RowIndex].DataBoundItem; var frmHorarioEdit = FrmHorarioSemanalMant.Instance(); frmHorarioEdit.MdiParent = this.MdiParent; frmHorarioEdit.Show(); frmHorarioEdit.frmList = this; frmHorarioEdit.cboAnho.SelectedValue = uiHorarioSemanal.Anho.ToString(); frmHorarioEdit.cboSemana.SelectedValue = uiHorarioSemanal.Semana.ToString(); frmHorarioEdit.cboSala.SelectedValue = uiHorarioSemanal.SalaId; frmHorarioEdit.CargarRangoFechas(uiHorarioSemanal.Anho, uiHorarioSemanal.Semana); frmHorarioEdit.Cargar(uiHorarioSemanal); } catch (Exception ex) { Util.ErrorMessage(ex.Message); } }
public static FrmHorarioSemanalMant Instance() { if (frmInstance == null || frmInstance.IsDisposed == true) { frmInstance = new FrmHorarioSemanalMant(); } frmInstance.BringToFront(); return(frmInstance); }
private void btnNuevo_Click(object sender, EventArgs e) { try { var frmHorarioNew = FrmHorarioSemanalMant.Instance(); frmHorarioNew.MdiParent = this.MdiParent; frmHorarioNew.Show(); frmHorarioNew.frmList = this; } catch (Exception ex) { Util.ErrorMessage(ex.Message); } }