private void frmMaestro_Load(object sender, EventArgs e) { UsuariosComponent usuariosComponent = new UsuariosComponent(); usuarios = usuariosComponent.ReadByEmail(SessionManager.instance.GetUSuario().Email); MaestroComponent maestroComponent = new MaestroComponent(); maestro = maestroComponent.ReadByUsuario(usuarios.Id); Obsever.AgregarForm(this); List <Idioma> idiomas = new List <Idioma>(); IdiomaComponent idiomaComponent = new IdiomaComponent(); idiomas = idiomaComponent.Read(); cbIdioma.DataSource = idiomas; cbIdioma.DisplayMember = "idioma"; cbIdioma.ValueMember = "Id"; }
private void metroButton1_Click(object sender, EventArgs e) { if (txtNuevaComunicacion.Text == "") { MetroMessageBox.Show(this, "Campo Comunicado esta vacio", "error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Alumno alumno = new Alumno(); alumno.Id = int.Parse(mgAlumno.CurrentRow.Cells[0].Value.ToString()); Maestro maestro = new Maestro(); MaestroComponent maestroComponent = new MaestroComponent(); maestro = maestroComponent.ReadByUsuario(SessionManager.instance.GetUSuario().Id); Comunicado comunicado = new Comunicado(maestro, alumno); comunicado.comunicado = txtNuevaComunicacion.Text; ComunicadoComponent comunicadoComponent = new ComunicadoComponent(); comunicadoComponent.Create(comunicado); ValidadoresComponent.Alta("Comunicacion", this); llenarGrillaListado(); RecorridoForm.LimpiarTXT(this); } }