Example #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            fichero fic = new fichero();

            Tabla_Registros.ItemsSource = null;
            Tabla_Registros.ItemsSource = fic.Mostrar_todo();
        }
Example #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            String bus = txbBus.Text;

            if (lblCambio.Content.Equals("Nombre :"))
            {
                if (txbBus.Text == null || txbBus.Text.Equals(""))
                {
                    MessageBox.Show("Campo de Busqueda Vacio :( ...");
                }
                else
                {
                    fichero fi = new fichero();
                    //fi.buscar_empleado(bus,lblCambio.Content.ToString());
                    Lista_.ItemsSource = null;
                    Lista_.ItemsSource = fi.buscar_empleado(bus, lblCambio.Content.ToString());
                    txbBus.Text        = "";
                }
            }
            else if (lblCambio.Content.Equals("Codigo :"))
            {
                if (txbBus.Text == null || txbBus.Text.Equals(""))
                {
                    MessageBox.Show("Campo de Busqueda Vacio :( ...");
                }
                else
                {
                    fichero fi = new fichero();
                    //fi.buscar_empleado(bus,lblCambio.Content.ToString());
                    Lista_.ItemsSource = null;
                    Lista_.ItemsSource = fi.buscar_empleado(bus, lblCambio.Content.ToString());
                    txbBus.Text        = "";
                }
            }
        }
Example #3
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            String resultado = null;
            String nom       = lblNombre.Text;
            String pas       = lblPass.Password;

            if (nom == null || nom.Equals(""))
            {
                MessageBox.Show("Ingreasar el nombre de usuario porfavor...");
            }
            else
            {
                if (pas == null || pas.Equals(""))
                {
                    MessageBox.Show("Ingresar la clave porfavor...");
                }
                else
                {
                    fichero fi = new fichero();
                    resultado = fi.corroborando_cuenta(nom, pas);
                    if (resultado.Equals("Correcto"))
                    {
                        this.Close();
                    }
                }
            }
        }
Example #4
0
        public Registros_Eliminar()
        {
            InitializeComponent();
            fichero fi = new fichero();

            Tabla_Registros.ItemsSource = null;
            Tabla_Registros.ItemsSource = fi.Mostrar_todo();
        }
Example #5
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            String  pass = null;
            fichero fi   = new fichero();

            if (lblNombre.Text == null || lblNombre.Text.Equals(""))
            {
                MessageBox.Show("Obligatorio ingresar el Nombre...");
            }
            else
            {
                if (lblApellido.Text == null || lblApellido.Text.Equals(""))
                {
                    MessageBox.Show("Obligatorio ingresar el Apellido...");
                }
                else
                {
                    if ((lblNumero.Text.Length == 8) && ((lblNumero.Text.Substring(0, 1).Equals("8")) || (lblNumero.Text.Substring(0, 1).Equals("7")) || (lblNumero.Text.Substring(0, 1).Equals("5")) || (lblNumero.Text.Substring(0, 1).Equals("2"))))
                    {
                        if (lblN_usuario.Text == null || lblN_usuario.Text.Equals(""))
                        {
                            MessageBox.Show("Obligatorio ingresar el Nombre de usuario...");
                        }
                        else
                        {
                            pass = lblClave.Password;
                            if (pass.Length >= 8)
                            {
                                fi.agregar(lblNombre.Text, lblApellido.Text, lblNumero.Text, lblN_usuario.Text, pass);
                                lblNombre.Text    = "";
                                lblApellido.Text  = "";
                                lblClave.Password = "";
                                lblNumero.Text    = "";
                                lblN_usuario.Text = "";
                                this.Close();
                                MainWindow ma = new MainWindow();
                                ma.Show();
                            }
                            else
                            {
                                MessageBox.Show("El campo esta vacio o no tiene caracteres suficientes minimo de caracter son 8");
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Numero de telefono no valido...");
                    }
                }
            }
        }
Example #6
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (nom.Text == null || nom.Text.Equals(""))
     {
         MessageBox.Show("Porfavor ingrese el nombre...");
     }
     else
     {
         if (ape.Text == null || ape.Text.Equals(""))
         {
             MessageBox.Show("Porfavor ingrese el apellido...");
         }
         else
         {
             if (ced.Text.Length == 14 && char.IsLetter(ced.Text, 13))
             {
                 if (cod.Text == null || cod.Text.Equals(""))
                 {
                     MessageBox.Show("Porfavor ingresea el codigo");
                 }
                 else
                 {
                     String aux_1 = ced.Text.Insert(2, "-");
                     String aux_2 = aux_1.Insert(10, "-");
                     // Agregando elementos a la lista para luego mandarlo al fichero
                     lis.Add(new agregando_trabajador {
                         Nombre = nom.Text, Apellido = ape.Text, Cedula1 = aux_2, Codigo = cod.Text
                     });
                     this.Lista.ItemsSource = null;
                     this.Lista.ItemsSource = lis;
                     String a = nom.Text;
                     String b = ape.Text;
                     String c = cod.Text;
                     // limpiando las casillas de llenar datos
                     nom.Text = "";
                     ape.Text = "";
                     ced.Text = "";
                     cod.Text = "";
                     // Mandando datos al fichero
                     fichero fi = new fichero();
                     fi.agregar_Empleado(a, b, aux_2, c);
                 }
             }
             else
             {
                 MessageBox.Show("Porfavor ingrese el Cedula");
             }
         }
     }
 }
Example #7
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            String registro = null;

            registro = Tabla_Registros.SelectedIndex.ToString();
            int indice = Convert.ToInt32(registro);

            if (registro == null)
            {
                MessageBox.Show("Ningun Registro Seleccionado En La Tabla...");
            }
            else
            {
                MessageBox.Show(indice.ToString());
                fichero fi = new fichero();
                fi.Registros_Eliminar(indice);
            }
        }