private void btnRegistrar_Click(object sender, RoutedEventArgs e)
 {
     if (solicitud == "EditarAsociado")
     {
         AsociadoMantenimiento Asociado = new AsociadoMantenimiento();
         if (Asociado.AutenticaAsociado(txbInformacion.Text) != null)
         {
             wnwRegistrarPersona ventana = new wnwRegistrarPersona(pTipoPersona: "Asociado", pAsociado: Asociado.AutenticaAsociado(txbInformacion.Text), pEmpleado: null, pCliente: null);
             ventana.ShowDialog();
             this.Close();
         }
         else
         {
             MessageBox.Show("Los datos ingresados no coinciden con ningún registro.", "SIGEEA", MessageBoxButton.OK);
         }
     }
     else if (solicitud == "Direccion")
     {
         AsociadoMantenimiento Asociado = new AsociadoMantenimiento();
         if (Asociado.AutenticaAsociado(txbInformacion.Text) != null)
         {
             wnwDirecciones ventana = new wnwDirecciones(txbInformacion.Text, "Asociado", pkFinca: 0);
             ventana.ShowDialog();
             this.Close();
         }
         else
         {
             MessageBox.Show("Los datos ingresados no coinciden con ningún registro.", "SIGEEA", MessageBoxButton.OK);
         }
     }
     else if (solicitud == "Entrega")
     {
         AsociadoMantenimiento Asociado = new AsociadoMantenimiento();
         Asociado = new AsociadoMantenimiento();
         DataClasses1DataContext dc = new DataClasses1DataContext();
         if (Asociado.AutenticaAsociado(txbInformacion.Text) != null)
         {
             wnwEntregaProducto ventana = new wnwEntregaProducto(dc.SIGEEA_spObtenerAsociado(txbInformacion.Text).First());
             ventana.ShowDialog();
             this.Close();
         }
     }
 }
Exemplo n.º 2
0
        private void btnRegistrar_Click(object sender, RoutedEventArgs e)
        {
            EmpleadoMantenimiento empleado = new EmpleadoMantenimiento();

            if (empleado.AutenticaEmpleado(txbCedula.Text) != null)
            {
                if (solicitud == "Editar")
                {
                    wnwRegistrarPersona ventana = new wnwRegistrarPersona("Empleado", pAsociado: null, pEmpleado: empleado.AutenticaEmpleado(txbCedula.Text), pCliente: null);
                    ventana.ShowDialog();
                    this.Close();
                }
                else if (solicitud == "Direccion")
                {
                    wnwDirecciones ventana = new wnwDirecciones(txbCedula.Text, "Empleado", pkFinca: 0);
                    ventana.ShowDialog();
                    this.Close();
                }
                else if (solicitud == "Pagos")
                {
                    if (empleado.ListarPagosEmpleados(txbCedula.Text).Count != 0)
                    {
                        wnwPagoEmpleados ventana = new wnwPagoEmpleados(txbCedula.Text);
                        ventana.ShowDialog();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Este empleado no posee ningún registro pendiente de pago.", "SIGEEA", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
            }

            else
            {
                MessageBox.Show("Los datos ingresados no coinciden con los registros", "SIGEEA", MessageBoxButton.OK);
            }
        }
Exemplo n.º 3
0
        private void btnValidar_Click(object sender, RoutedEventArgs e)
        {
            if (tipoSolicitud == "Contacto")
            {
                PersonaMantenimiento persona = new PersonaMantenimiento();
                int pk_persona = persona.AutenticaPersona(txbCedula.Text);
                if (pk_persona != 0)
                {
                    wnwContactos ventana = new wnwContactos(pk_persona);
                    ventana.ShowDialog();
                    this.Close();
                }
            }
            else if (tipoSolicitud == "Direccion")
            {
                EmpleadoMantenimiento empleado = new EmpleadoMantenimiento();
                AsociadoMantenimiento asociado = new AsociadoMantenimiento();

                if (empleado.AutenticaEmpleado(txbCedula.Text) != null) //Es un empleado
                {
                    wnwDirecciones ventana = new wnwDirecciones(txbCedula.Text, "Empleado", pkFinca: 0);
                    ventana.ShowDialog();
                    this.Close();
                }
                else if (asociado.AutenticaAsociado(txbCedula.Text) != null) //Es un asociado
                {
                    wnwDirecciones ventana = new wnwDirecciones(txbCedula.Text, "Asociado", pkFinca: 0);
                    ventana.ShowDialog();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Error: el número de cédula digitado no se encuentra registrado.", "SIGEEA", MessageBoxButton.OK);
                }
            }
        }
Exemplo n.º 4
0
        private void btnRegistrar_Click(object sender, RoutedEventArgs e)
        {
            SIGEEA_Finca nueva = new SIGEEA_Finca();

            if (tipo == "Registrar")
            {
                int idFinca;
                if (tipoFinca == "Alquilada")
                {
                    nueva.Alquilada_Finca = true;
                }
                else
                {
                    nueva.Alquilada_Finca = false;
                }
                nueva.PriNomDuenno_Finca = txtPriNombre.Text;
                nueva.SegNomDuenno_Finca = txtSegNombre.Text;
                nueva.PriApeDuenno_Finca = txtPriApellido.Text;
                nueva.SegApeDuenno_Finca = txtSegApellido.Text;
                nueva.NumRegistro_Finca  = txtNumeroRegistro.Text;
                nueva.Tamanno_Finca      = Convert.ToDouble(txtTamFinca.Text);
                nueva.FK_Id_Empleado     = UsuarioGlobal.InfoUsuario.PK_Id_Empleado;
                nueva.Estado_Finca       = "1";
                nueva.PK_Id_Finca        = manFinca.ObtenerIdUltimaFinca() + 1;
                nueva.FK_Id_Direccion    = 0;
                nueva.Codigo_Finca       = lbCodGenerado.Content.ToString();
                idFinca = manFinca.RegistrarFinca(nueva, asociado);
                foreach (uc_Lote lote in FindVisualChildren <uc_Lote>(stpLotes))
                {
                    SIGEEA_Lote nuevolote = new SIGEEA_Lote();
                    nuevolote.Tamanno_Lote = lote.txbTamaño.Text;
                    nuevolote.Codigo_Lote  = lote.txbCodigo.Text;
                    nuevolote.FK_Id_Finca  = idFinca;
                    nuevolote.Estado_Lote  = true;
                    manFinca.RegistrarLote(nuevolote);
                }
                wnwDirecciones nuevaDireccion = new wnwDirecciones(pCedula_pCodigo: null, tipoPersona: "Finca", pkFinca: idFinca);
                nuevaDireccion.ShowDialog();
                this.Close();
            }


            else
            {
                if (tipoFinca == "Alquilada")
                {
                    nueva.Alquilada_Finca = true;
                }
                else
                {
                    nueva.Alquilada_Finca = false;
                }
                nueva.PriNomDuenno_Finca = txtPriNombre.Text;
                nueva.SegNomDuenno_Finca = txtSegNombre.Text;
                nueva.PriApeDuenno_Finca = txtPriApellido.Text;
                nueva.SegApeDuenno_Finca = txtSegApellido.Text;
                nueva.NumRegistro_Finca  = txtNumeroRegistro.Text;
                nueva.Tamanno_Finca      = Convert.ToDouble(txtTamFinca.Text);
                nueva.FK_Id_Empleado     = UsuarioGlobal.InfoUsuario.PK_Id_Empleado;
                nueva.Estado_Finca       = "1";
                nueva.PK_Id_Finca        = manFinca.ObtenerIdUltimaFinca() + 1;
                nueva.FK_Id_Direccion    = 0;
                nueva.Codigo_Finca       = lbCodGenerado.Content.ToString();
                nueva.PK_Id_Finca        = finca.PK_Id_Finca;
                foreach (uc_Lote lote in FindVisualChildren <uc_Lote>(stpLotes))
                {
                    if (manFinca.ExisteLote(Convert.ToInt32(lote.btnOpcion.Tag)) == true)
                    {
                        SIGEEA_Lote editolote = new SIGEEA_Lote();
                        editolote.Tamanno_Lote = lote.txbTamaño.Text;
                        editolote.Codigo_Lote  = lote.txbCodigo.Text;
                        editolote.FK_Id_Finca  = finca.PK_Id_Finca;
                        editolote.PK_Id_Lote   = Convert.ToInt32(lote.btnOpcion.Tag);
                        if (lote.txbEstado.Text == "true")
                        {
                            editolote.Estado_Lote = true;
                        }
                        else
                        {
                            editolote.Estado_Lote = false;
                        }
                        manFinca.EditarLote(editolote);
                    }
                    else
                    {
                        SIGEEA_Lote nuevolote = new SIGEEA_Lote();
                        nuevolote.Tamanno_Lote = lote.txbTamaño.Text;
                        nuevolote.Codigo_Lote  = lote.txbCodigo.Text;
                        nuevolote.FK_Id_Finca  = finca.PK_Id_Finca;
                        manFinca.RegistrarLote(nuevolote);
                    }
                }
                MessageBox.Show("Finca editada con exito");
                this.Close();
            }
        }
        private void btnDireccion_Click(object sender, RoutedEventArgs e)
        {
            wnwDirecciones ventana = new wnwDirecciones(CedulaAsociado, "Asociado", pkFinca: 0);

            ventana.ShowDialog();
        }