private void btnEditar_Click(object sender, RoutedEventArgs e) { AsociadoMantenimiento asociado = new AsociadoMantenimiento(); wnwRegistrarPersona ventana = new wnwRegistrarPersona("Asociado", asociado.AutenticaAsociado(CedulaAsociado), null, null); ventana.ShowDialog(); }
//private void BtnOpcion2_Click(object sender, RoutedEventArgs e) //{ // var boton = (Button)sender; // if (opcion == "Pedido") // { // // nuevo.btnOpcion2.Content = "Ver Credito"; // } // else if (opcion == "Editar") // { // //nuevo.btnOpcion2.Content = "Credito"; // } // else if (opcion == "Eliminar o Activar") // { // if (MessageBox.Show("¿Realmente activar este Cliente?", "SIGEEA", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) // { // ClienteMantenimiento mant = new ClienteMantenimiento(); // mant.ActivarCliente(Convert.ToInt32(boton.Tag));//eliminar // } // actualiza(); // } //} private void BtnOpcion_Click(object sender, RoutedEventArgs e) { var boton = (Button)sender; if (opcion == "Pedido") { wnwRealizarPedidoCliente nuevoPedido = new wnwRealizarPedidoCliente(pPk_Id_Cliente: Convert.ToInt32(boton.Tag)); nuevoPedido.ShowDialog(); } else if (opcion == "Editar") { wnwRegistrarPersona ventana = new wnwRegistrarPersona("Cliente", pAsociado: null, pEmpleado: null, pCliente: MantCliente.ObtenerCliente(Convert.ToInt32(boton.Tag))); ventana.ShowDialog();//editar } else if (opcion == "Ver") { wnwFacturasCliente nueva = new wnwFacturasCliente(Tipo: "Por cliente", IdCliente: Convert.ToInt32(boton.Tag), IdFactura: 0); nueva.ShowDialog(); } else if (opcion == "Abono") { //nuevo.btnOpcion.Content = "Hacer Abono"; } else if (opcion == "Eliminar o Activar") { if (MessageBox.Show("¿Realmente eliminar este Cliente?", "SIGEEA", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { ClienteMantenimiento mant = new ClienteMantenimiento(); mant.EliminarCliente(Convert.ToInt32(boton.Tag));//eliminar } actualiza(); } }
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(); } } }
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); } }
private void Nuevo_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox cmb = (ComboBox)sender; switch (cmb.SelectedItem.ToString()) { case "Registrar nuevo asociado": wnwRegistrarPersona ventanaRegistro = new wnwRegistrarPersona(pTipoPersona: "Asociado", pAsociado: null, pEmpleado: null, pCliente: null); ventanaRegistro.Show(); break; case "Editar asociado existente": wnwVistaAsociados ventanaEdicion = new wnwVistaAsociados(); ventanaEdicion.ShowDialog(); break; case "Agregar/Editar dirección de asociados": wnwIdentificar ventanaDireccion = new wnwIdentificar("Direccion"); ventanaDireccion.ShowDialog(); break; case "Registrar cuota": wnwRegistrarCuota venRegistraCuota = new wnwRegistrarCuota(0); venRegistraCuota.ShowDialog(); break; case "Administrar pagos de cuotas": SIGEEA_DiagramaDataContext dc = new SIGEEA_DiagramaDataContext(); if (dc.SIGEEA_spObtenerCuotas().ToList().Count > 0) { wnwCuotas ventana2 = new wnwCuotas(); ventana2.ShowDialog(); } else { MessageBox.Show("No hay cuotas registradas actualmente.", "SIGEEA", MessageBoxButton.OK, MessageBoxImage.Error); } break; case "Reuniones": wnwAsambleas ventana = new wnwAsambleas(); ventana.ShowDialog(); break; case "Registrar nuevo cliente": wnwRegistrarPersona venRegistroCliente = new wnwRegistrarPersona(pTipoPersona: "Cliente", pAsociado: null, pEmpleado: null, pCliente: null); venRegistroCliente.Show(); break; case "Editar cliente": wnwBuscadorCliente venEditarCliente = new wnwBuscadorCliente("Editar"); venEditarCliente.Show(); break; case "Generar factura": wnwBuscadorCliente venPedidoCliente = new wnwBuscadorCliente("Pedido"); venPedidoCliente.Show(); break; case "Realizar abono a factura": wnwMetodoBusquedaFactura venAbonoCredito = new wnwMetodoBusquedaFactura(); venAbonoCredito.Show(); break; case "Reporte de ventas cliente": wnwBuscadorCliente repVentasCliente = new wnwBuscadorCliente("ReporteVentas"); repVentasCliente.Show(); break; case "Entrega de producto": wnwIdentificar ventanaEntrega = new wnwIdentificar("Entrega"); ventanaEntrega.ShowDialog(); break; case "Gestionar facturas incompletas": wnwOpcionesFacturaProducto ventanaIncompletas = new wnwOpcionesFacturaProducto(false); ventanaIncompletas.ShowDialog(); break; case "Gestionar facturas pendientes": wnwOpcionesFacturaProducto ventanaPendientes = new wnwOpcionesFacturaProducto(true); ventanaPendientes.ShowDialog(); break; case "Gestiona facturas incompletas": wnwBuscadorCliente nuevo = new wnwBuscadorCliente("Facturas Incompletas"); nuevo.Show(); break; case "Registrar nuevo empleado": wnwRegistrarPersona ventanaRegistroEmp = new wnwRegistrarPersona(pTipoPersona: "Empleado", pAsociado: null, pEmpleado: null, pCliente: null); ventanaRegistroEmp.Show(); break; case "Editar empleado existente": wnwIdentificarEmpleado ventanaIdentifica = new wnwIdentificarEmpleado("Editar"); ventanaIdentifica.ShowDialog(); break; case "Agregar/Editar dirección de empleados": wnwIdentificarEmpleado ventanaDir = new wnwIdentificarEmpleado("Direccion"); ventanaDir.ShowDialog(); break; case "Gestionar puestos": wnwPuestos ventanaPuestos = new wnwPuestos(); ventanaPuestos.ShowDialog(); break; case "Registro de horas ": wnwRegistrarHorasLaboradas ventanaHor = new wnwRegistrarHorasLaboradas(); ventanaHor.ShowDialog(); break; case "Realizar pagos": wnwIdentificarEmpleado ventanaPagos = new wnwIdentificarEmpleado("Pagos"); ventanaPagos.ShowDialog(); break; case "Agregar finca": wnwBuscadorAsociados venAgregarFinca = new wnwBuscadorAsociados("Registrar"); venAgregarFinca.Show(); break; case "Editar finca": wnwOpcionesBusquedaFinca venEditarFinca = new wnwOpcionesBusquedaFinca("Editar"); venEditarFinca.Show(); break; case "Registrar nuevo producto": wnwRegistrarProducto ventanaProd = new wnwRegistrarProducto(); ventanaProd.Show(); break; case "Compra/Venta del producto": wnwPreciosProducto ventanaPrecios = new wnwPreciosProducto(); ventanaPrecios.Show(); break; case "Agregar insumo": wnwRegistrarInsumo venAgregarInsumo = new wnwRegistrarInsumo(ptipo: "Registrar", ppkInsumo: 0); venAgregarInsumo.Show(); break; case "Editar insumo": wnwBuscadorInsumo editarInsumo = new wnwBuscadorInsumo("Editar"); editarInsumo.ShowDialog(); break; case "Compra de insumo": wmwCompraInsumo compraInsumo = new wmwCompraInsumo(); compraInsumo.ShowDialog(); break; case "Pedir insumo": wnwBuscadorInsumo pedirInsumo = new wnwBuscadorInsumo("Pedido"); pedirInsumo.ShowDialog(); break; case "Permisos y roles": wnwRoles permisosyroles = new wnwRoles(); permisosyroles.Closed += Permisosyroles_Closed; permisosyroles.ShowDialog(); break; case "Registrar usuario": wnwAgregarUsuario nuevoUsuario = new wnwAgregarUsuario(tipo: "Agregar", pUsuario: null); nuevoUsuario.ShowDialog(); break; case "Consolidado de asociados": wnwOpcionesReporteEntrega nuevoReporte = new wnwOpcionesReporteEntrega(); nuevoReporte.ShowDialog(); break; default: break; } cmb.SelectedIndex = 0; }
private void btnRegistrar_Click(object sender, RoutedEventArgs e) { wnwRegistrarPersona ventana = new wnwRegistrarPersona(pTipoPersona: "Cliente", pAsociado: null, pEmpleado: null, pCliente: null); ventana.Show(); }