private void btnGuardar3_Click(object sender, EventArgs e) { if (Estado3 == 2 || Estado3 == 3) { if (CamposValidosAmbiente() == string.Empty) { if (MessageBox.Show("¿Desea Guardar el Registro?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { LlenarAmbiente(); if (Estado3 == 2) { AmbienteBR.InsAmbiente(oAmbiente); } else if (Estado3 == 3) { AmbienteBR.UpdAmbiente(oAmbiente); } MessageBox.Show("Se guardó Satisfactoriamente.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); setAmbiente(1); bsrAmbiente.DataSource = AmbienteBR.GetAmbiente(); } } else { MessageBox.Show(CamposValidosAmbiente(), "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
private void InicializarData() { CargarDgv(); LlenarCombo(cboCategoría1, DocenteBR.GetCategoria()); LlenarCombo(cboCurricula2, AsignaturaBR.GetCurricula()); LlenarCombo(cboTipoAmbiente3, AmbienteBR.GetTipoAmbiente()); setDocente(1); setAmbiente(1); setAsignatura(1); }
private void btnModificar3_Click(object sender, EventArgs e) { if (Estado3 == 1) { if (dgvAmbiente != null && dgvAmbiente.DataSource != null && dgvAmbiente.CurrentRow != null && bsrAmbiente.Count > 0) { int id = (int)(dgvAmbiente.CurrentRow.Cells[gcIdAmbiente.Index].Value); oAmbiente = AmbienteBR.GetAmbientebyId(id); setAmbiente(3); } } }
private void CargarDatos() { LlenarCombo(cboDocente, DocenteBR.ListDocente()); LlenarCombo(cboAsignatura, AsignaturaBR.ListAsignatura()); LlenarCombo(cboAmbiente, AmbienteBR.ListAmbiente()); LlenarCombo(cboTipoClase, HorarioBR.ListTipoClase()); if (oCelda.IdDia != 0 && oCelda.IdHora != 0) { CargarClase(oCelda); } }
public void CargarDgv() { bsrDocentes.DataSource = DocenteBR.GetDocente(); bsrAsignaturas.DataSource = AsignaturaBR.GetAsignatura(); bsrAmbiente.DataSource = AmbienteBR.GetAmbiente(); }