private void buttonAceptar_Click(object sender, EventArgs e) { string[] x = util.textoDeArchivoConSplit("USU_ELYON.elyon", '\n'); bool ok = false; for (int i = 0; i < x.Length; i++) { string[] y = x[i].Split('|'); if(y.Length >= 2) if (y[2] == listBox1.SelectedItem.ToString()) ok = true; } if (ok) { if (opcion == "Nuevo") { PanelRegistroDatosLaboral panel = new PanelRegistroDatosLaboral("Nuevo", listBox1.SelectedItem.ToString(), nivel); panel.Show(); this.Close(); } if (opcion == "Editar") { if (nivel == "Alto") { PanelRegistroDatosLaboral panel = new PanelRegistroDatosLaboral("Editar", listBox1.SelectedItem.ToString(), "Alto"); panel.Show(); } if (nivel == "Medio") { MessageBox.Show(listBox1.SelectedItem.ToString()); PanelDatosPersonal panel = new PanelDatosPersonal("Editar", "Medio", usuario, listBox1.SelectedItem.ToString()); panel.Show(); } } if (opcion == "Informacion") { if (nivel == "Alto") { } } } if (!ok) MessageBox.Show("Usuario No Encontrado."); }
private void buttonAceptar_Click(object sender, EventArgs e) { System.IO.StreamReader fileReader = new System.IO.StreamReader("USU_ELYON.elyon"); string espacios = fileReader.ReadToEnd(); fileReader.Close(); string[] x = espacios.Split('\n'); bool ok = false; for (int i = 0; i < x.Length; i++) { string[] y = x[i].Split('|'); if (y[0] == textBoxUsuario.Text) { ok = true; } } if (ok == true) { PanelRegistroDatosLaboral panel = new PanelRegistroDatosLaboral(1, textBoxUsuario.Text); panel.Show(); this.Close(); } if (ok == false) MessageBox.Show("Usuario No Encontrado."); }
private void buttonCrear_Click(object sender, EventArgs e) { PanelRegistroDatosLaboral panel = new PanelRegistroDatosLaboral(0,"Nada"); panel.Show(); }
private void buttonAtras_Click(object sender, EventArgs e) { PanelRegistroDatosLaboral panel = new PanelRegistroDatosLaboral("Editar",usuario,nivel); panel.Show(); this.Close(); }
private void buttonCrear_Click(object sender, EventArgs e) { PanelRegistroDatosLaboral panel = new PanelRegistroDatosLaboral("Crear", usuario, "Medio"); panel.Show(); }
private void button1_Click(object sender, EventArgs e) { PanelRegistroDatosLaboral panel = new PanelRegistroDatosLaboral("Editar", usuario, "Alto"); panel.Show(); }