public CourseHAddStudent(BindingList <string> idAlumnos) { InitializeComponent(); servidor = new Server.ServerClient(); table = new DataTable(); Alumnos = new BindingList <string>(); table.Columns.Add("ID", typeof(string)); table.Columns.Add("Nombre", typeof(string)); BindingList <Server.student> students = new BindingList <Server.student>(servidor.queryAllStudent()); //En caso el tamaño de la lista de cursos en los que está interesado sea la misma //que la de los cursos disponibles en INFOPUC if (idAlumnos == null) { idAlumnos = new BindingList <string>(); } foreach (Server.student s in students) { bool seencuentra = false; foreach (string id in idAlumnos) { if (s.idNumber.Equals(id)) { seencuentra = true; break; } } if (!seencuentra) { fullname = s.firstName + " " + s.primaryLastName + " " + s.secondLastName; table.Rows.Add(s.idNumber, fullname); } } dgvStudents.DataSource = table; }
public CourseModify() { InitializeComponent(); establecerEstado(Estado.Inicial); server = new Server.ServerClient(); Server.courseType[] coursetypes = server.queryAllCourseType(); BindingList <Server.courseType> list_coursetypes = new BindingList <Server.courseType>(coursetypes); cmbCourseType.DataSource = list_coursetypes; cmbCourseType.DisplayMember = "name"; }
public CourseHSelectCourse() { InitializeComponent(); server = new Server.ServerClient(); table = new DataTable(); table.Columns.Add("ID", typeof(string)); table.Columns.Add("Nombre", typeof(string)); BindingList <Server.course> courses = new BindingList <Server.course>(server.queryAllCourse()); foreach (Server.course c in courses) { table.Rows.Add(c.id, c.name); } dgvCursos.DataSource = table; }
public CourseHSelectProfessor() { InitializeComponent(); server = new Server.ServerClient(); table = new DataTable(); table.Columns.Add("ID", typeof(string)); table.Columns.Add("Nombre", typeof(string)); BindingList <Server.professor> assistants = new BindingList <Server.professor>(server.queryAllProfessorsActive()); String fullname; foreach (Server.professor a in assistants) { fullname = a.firstName + " " + a.primaryLastName + " " + a.secondLastName; table.Rows.Add(a.idPUCP, fullname); } dgvCursos.DataSource = table; }
public CourseHSelectCourseH(String idCourse) { InitializeComponent(); idCourseH = 0; server = new Server.ServerClient(); table = new DataTable(); table.Columns.Add("StartDate", typeof(string)); table.Columns.Add("EndDate", typeof(string)); table.Columns.Add("Professor", typeof(string)); table.Columns.Add("Assistant", typeof(string)); courses = new BindingList <Server.courseHistory>(server.queryCourseHistoryByCourse(idCourse)); dgvCursos.AutoGenerateColumns = false; foreach (Server.courseHistory c in courses) { String fullnameP = c.professor.firstName + " " + c.professor.primaryLastName + " " + c.professor.secondLastName; String fullnameA = c.assistant.firstName + " " + c.assistant.primaryLastName + " " + c.assistant.secondLastName; table.Rows.Add(c.startDate.ToString("dd/MM/yyyy"), c.endDate.ToString("dd/MM/yyyy"), fullnameP, fullnameA); } dgvCursos.DataSource = table; }
private void iniciar_login() { if (txtUser.Text == "") { String mensaje = "ERROR: Debe ingresar un usuario"; String titulo = "Usuario inválido"; MessageBoxIcon icono = MessageBoxIcon.Error; DialogResult mensajeError = MessageBox.Show(mensaje, titulo, MessageBoxButtons.OK, icono); } else if (txtPassword.Text == "") { String mensaje = "ERROR: Debe ingresar una contraseña"; String titulo = "Contraseña inválida"; MessageBoxIcon icono = MessageBoxIcon.Error; DialogResult mensajeError = MessageBox.Show(mensaje, titulo, MessageBoxButtons.OK, icono); } else { servidor = new Server.ServerClient(); Server.user u = new Server.user(); u.username = txtUser.Text; u.password = txtPassword.Text; u.acces = servidor.VerifyUser(u); if (u.acces.id != -1) { //String role = u.acces.name; //DialogResult mensajeError = MessageBox.Show(role, "EXITO", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); MdiInfosis mdiInfosis = new MdiInfosis(u); mdiInfosis.ShowDialog(); this.Close(); } else { DialogResult mensajeError = MessageBox.Show("Usuario y/o Contraseña incorrecto(s)", "Vuelva a ingresar sus datos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
public InterestedAdvancedSearch() { servidor = new Server.ServerClient(); InitializeComponent(); dgvInteresados.AutoGenerateColumns = false; }