Beispiel #1
0
        private void mostrarNivel()
        {
            this.dtDetalle = NNivel.Mostrar(Convert.ToInt32(this.lblBandera.Text));

            this.dataListadoDetalle.DataSource = dtDetalle;
            this.ocultarColumnasNivel();
            this.lblNroFilas.Text = dataListadoDetalle.Rows.Count.ToString();
        }
        private void ValidarAcceso()
        {
            this.Deshabilitado();
            DataTable dtIdTipoTrabajador = NTipoTrabajador.MostrarIdTipoUsuario(Convert.ToInt32(this.lblIdUsuario.Text));
            DataTable dtNivel            = NNivel.Mostrar(Convert.ToInt32(dtIdTipoTrabajador.Rows[0][0].ToString()));

            for (int i = 0; i < dtNivel.Rows.Count; i++)
            {
                if (dtNivel.Rows[i][2].ToString() == "Venta-Dcto General")
                {
                    this.btnDescuentoTotal.Visible = true;
                }
            }
        }
Beispiel #3
0
        public void ValidarAcceso()
        {
            this.Deshabilitado();
            DataTable dtIdTipoTrabajador = NTipoTrabajador.MostrarIdTipoUsuario(Convert.ToInt32(this.lblIdUsuario.Text));
            DataTable dtNivel            = NNivel.Mostrar(Convert.ToInt32(dtIdTipoTrabajador.Rows[0][0].ToString()));

            for (int i = 0; i < dtNivel.Rows.Count; i++)
            {
                if (dtNivel.Rows[i][2].ToString() == "Nota Ingreso")
                {
                    this.mnuNotaIngreso.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Nota Salida")
                {
                    this.mnuNotaSalida.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Consulta_Stock")
                {
                    this.mnuStock.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Ver Movimientos_Almacen")
                {
                    this.mnuVerMovAlmacen.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Comprobante_Anulados")
                {
                    this.mnuComprobantesAnulados.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Aperturar Caja" && lblEstadoCaja.Text == "Abierta")
                {
                    this.mnuAperturaCaja.Enabled = false;
                }

                if (dtNivel.Rows[i][2].ToString() == "Aperturar Caja" && (lblEstadoCaja.Text == "Cerrada" || lblEstadoCaja.Text == "0"))
                {
                    this.mnuAperturaCaja.Enabled = true;
                }

                if (dtNivel.Rows[i][2].ToString() == "Cerrar Caja" && lblEstadoCaja.Text == "Abierta")
                {
                    this.mnuCerrarCaja.Enabled = true;
                }

                if (dtNivel.Rows[i][2].ToString() == "Cerrar Caja" && (lblEstadoCaja.Text == "Cerrada" || lblEstadoCaja.Text == "0"))
                {
                    this.mnuCerrarCaja.Enabled = false;
                }

                if (dtNivel.Rows[i][2].ToString() == "Ingreso Dinero" && lblEstadoCaja.Text == "Abierta")
                {
                    this.mnuIngresoDinero.Enabled = true;
                }

                if (dtNivel.Rows[i][2].ToString() == "Ingreso Dinero" && (lblEstadoCaja.Text == "Cerrada" || lblEstadoCaja.Text == "0"))
                {
                    this.mnuIngresoDinero.Enabled = false;
                }

                if (dtNivel.Rows[i][2].ToString() == "Salida Dinero" && lblEstadoCaja.Text == "Abierta")
                {
                    this.mnuSalidaDinero.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Salida Dinero" && (lblEstadoCaja.Text == "Cerrada" || lblEstadoCaja.Text == "0"))
                {
                    this.mnuSalidaDinero.Enabled = false;
                }


                if (dtNivel.Rows[i][2].ToString() == "Compras_Ingresos")
                {
                    this.mnuIngresos.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Ver Compras")
                {
                    this.mnuVerCompras.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Punto de Venta" && lblEstadoCaja.Text == "Abierta")
                {
                    this.mnuPuntoVenta.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Punto de Venta" && (lblEstadoCaja.Text == "Cerrada" || lblEstadoCaja.Text == "0"))
                {
                    this.mnuPuntoVenta.Enabled = false;
                }

                if (dtNivel.Rows[i][2].ToString() == "Ver Ventas")
                {
                    this.mnuVerVentas.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_AlmacenGestion")
                {
                    this.mnuGestionAlmacen.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Categoria")
                {
                    this.mnuCategoria.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Clientes")
                {
                    this.mnuCliente.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Insumos")
                {
                    this.mnuInsumos.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Mesas")
                {
                    this.mnuMesas.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Productos")
                {
                    this.mnuProductos.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Proveedor")
                {
                    this.mnuProveedor.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Platos")
                {
                    this.mnuPlatos.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Salones")
                {
                    this.mnuSalones.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Termino")
                {
                    this.mnuTermino.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_TipoTrabajador")
                {
                    this.mnuTipoTrabajador.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Trabajador")
                {
                    this.mnuTrabajador.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Reportes")
                {
                    this.mnuReportes.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_Niveles")
                {
                    this.mnuNiveles.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "M_UnidadMedida")
                {
                    this.mnuUnidadMedida.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Backup")
                {
                    this.mnuBackup.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Cambio_Contrasena")
                {
                    this.mnuCambio.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "TipoIngresoAlmacen")
                {
                    this.mnuTipoMovIngreso.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "TipoSalidaAlmacen")
                {
                    this.mnuTipoMovSalida.Enabled = true;
                }

                if (dtNivel.Rows[i][2].ToString() == "Descuento")
                {
                    this.mnuDescuento.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Descuento")
                {
                    this.mnuDescuento.Enabled = true;
                }

                if (dtNivel.Rows[i][2].ToString() == "Por Cobrar")
                {
                    this.mnuPorCobrar.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Control Caja" && lblEstadoCaja.Text == "Abierta")
                {
                    this.mnuConsultaCaja.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Control Caja" && (lblEstadoCaja.Text == "Cerrada" || lblEstadoCaja.Text == "0"))
                {
                    this.mnuConsultaCaja.Enabled = false;
                }
                if (dtNivel.Rows[i][2].ToString() == "Corte Parcial" && lblEstadoCaja.Text == "Abierta")
                {
                    this.mnuCorteParcial.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Corte Parcial" && (lblEstadoCaja.Text == "Cerrada" || lblEstadoCaja.Text == "0"))
                {
                    this.mnuCorteParcial.Enabled = false;
                }
                if (dtNivel.Rows[i][2].ToString() == "Consulta_Cortes")
                {
                    this.mnuCortes.Enabled = true;
                }
                if (dtNivel.Rows[i][2].ToString() == "Consulta_Cierre")
                {
                    this.mnuConsultaCierre.Enabled = true;
                }
            }
        }