Beispiel #1
0
        public frmOpcionesGrupo(Colaborador usuario, Grupo grupo, frmOpcionesRegistro padre)
        {
            InitializeComponent();

            _grupo   = grupo;
            _padre   = padre;
            _usuario = usuario;

            nudNumeroCajas.Enabled = !grupo.Caja_unica;
        }
Beispiel #2
0
        /// <summary>
        /// Interpretar una instruccion basado en una tecla presionada.
        /// </summary>
        private void interpretarComando(KeyEventArgs tecla)
        {
            if (tecla.KeyCode >= Keys.NumPad0 && tecla.KeyCode <= Keys.NumPad9)
            {
                if (_cambio_grupo)
                {
                    this.seleccionarGrupo(tecla.KeyValue - 96);
                }
                else
                {
                    this.construirCodigo((tecla.KeyValue - 96).ToString());
                }
            }
            else if (tecla.KeyCode == Keys.Divide)
            {
                this.recordarManifiesto();
            }
            else if (tecla.KeyCode == Keys.Decimal)
            {
                _cambio_grupo = !_cambio_grupo;

                txtFuncion.Text = _cambio_grupo ? "Cambio de grupo" : "Ingreso manual de códigos";

                txtFuncion.BackColor = _cambio_grupo ? Color.Cyan : Color.BlueViolet;
            }
            else if (tecla.KeyCode == Keys.Subtract)
            {
                this.cancelar();
            }
            else if (tecla.KeyCode == Keys.Add)
            {
                this.reproducirSonido(SONIDO_REINICIANDO_LECTURA);
                this.reiniciar();
            }
            else if (tecla.KeyCode == Keys.Multiply)
            {
                frmOpcionesRegistro formulario = new frmOpcionesRegistro(_receptor);
                this.Close();
            }
            else if (tecla.KeyCode == Keys.Enter)
            {
                if (!_verificar_etapa)
                {
                    this.siguienteEtapa();
                }
            }
            else if (tecla.KeyCode >= Keys.D0 && tecla.KeyCode <= Keys.D9)
            {
                this.construirCodigo((tecla.KeyValue - 48).ToString());
            }
            else if (tecla.KeyCode >= Keys.A && tecla.KeyCode <= Keys.Z)
            {
                this.construirCodigo(Convert.ToChar(tecla.KeyValue).ToString());
            }
        }
Beispiel #3
0
        public frmRegistroTulas(List <Grupo> grupos, EmpresaTransporte empresa, Colaborador receptor, BindingList <Colaborador> cajas_cajeros)
        {
            InitializeComponent();
            dgvTulasNiquel.AutoGenerateColumns   = false;
            this.cboDenominaciones.ListaMostrada = _mantenimiento.listarDenominacionesMonedas();
            this.dgvTulasNiquel.DataSource       = new BindingList <TulaNiquel>();


            try
            {
                _grupos   = grupos;
                _empresa  = empresa;
                _receptor = receptor;


                frmOpcionesRegistro formulario = new frmOpcionesRegistro(_receptor);
                formulario._cajas_cajeros = cajas_cajeros;

                _colaboradores        = _mantenimiento.listarCajerosAsignados();
                _nuevos_colaboradores = _colaboradores;

                txtReceptor.Text = _receptor.ToString();
                txtEmpresa.Text  = _empresa.Nombre;

                // Agregar las filas

                dgvDistribucion.Rows.Add("Descripción");
                dgvDistribucion.Rows.Add("Caja Actual");
                dgvDistribucion.Rows.Add("Cajero Asignado");
                dgvDistribucion.Rows.Add("Total del Cajas");
                dgvDistribucion.Rows.Add("Manifiestos por Caja");
                dgvDistribucion.Rows.Add("Total de Manifiestos");
                dgvDistribucion.Rows.Add("Posición Lector");

                dgvDistribucion.Rows[CAJA_ACTUAL].Height = 120;
                dgvDistribucion.Rows[CAJA_ACTUAL].DefaultCellStyle.Font = fuente_grande;
                dgvDistribucion[0, CAJA_ACTUAL].Style.Font = fuente_normal;

                dgvDistribucion.Rows[CAJERO_ASIGNADO].Height = 70;
                dgvDistribucion.Rows[CAJERO_ASIGNADO].DefaultCellStyle.Font = fuente_mediana;
                dgvDistribucion[0, CAJERO_ASIGNADO].Style.Font = fuente_normal;

                dgvDistribucion.Rows[TOTAL_CAJAS].Height = 70;
                dgvDistribucion.Rows[TOTAL_CAJAS].DefaultCellStyle.Font = fuente_mediana;
                dgvDistribucion[0, TOTAL_CAJAS].Style.Font = fuente_normal;

                dgvDistribucion.Rows[MANIFIESTOS_CAJA].Height = 70;
                dgvDistribucion.Rows[MANIFIESTOS_CAJA].DefaultCellStyle.Font = fuente_mediana;
                dgvDistribucion[0, MANIFIESTOS_CAJA].Style.Font = fuente_normal;

                dgvDistribucion.Rows[TOTAL_MANIFIESTOS].Height = 70;

                dgvDistribucion.Rows[TOTAL_MANIFIESTOS].DefaultCellStyle.Font = fuente_mediana;
                dgvDistribucion[0, TOTAL_MANIFIESTOS].Style.Font = fuente_normal;

                dgvDistribucion.Rows[POSICION_LECTOR].Height = 70;

                //Agregar las columnas

                foreach (Grupo grupo in _grupos)
                {
                    // Agregar la columna

                    DataGridViewColumn columna = new DataGridViewColumn();

                    columna.HeaderText   = grupo.Nombre;
                    columna.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                    columna.CellTemplate = new DataGridViewTextBoxCell();
                    columna.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                    dgvDistribucion.Columns.Add(columna);

                    //Lista los registros de cajeros asignados

                    try
                    {
                        _relaciones_nuevas = _mantenimiento.listarRegistrosCajerosAsignados(grupo);

                        _relaciones           = _relaciones_nuevas;
                        _nuevos_colaboradores = new BindingList <Colaborador>();
                        _relaciones_nuevas    = new BindingList <ManifiestoColaborador>();
                        Colaborador cajrecep = new Colaborador();

                        foreach (ManifiestoColaborador relacion in _relaciones)
                        {
                            if (relacion.Grupo.Id == grupo.Id)
                            {
                                if (grupo.Caja_unica == true)
                                {
                                    grupo.Colaborador = Convert.ToString(relacion.Cajero_Receptor);
                                    _nuevos_colaboradores.Add(relacion.Cajero_Receptor);
                                }
                                else
                                {
                                    foreach (Colaborador c in _colaboradores)
                                    {
                                        if (c.ID == relacion.Cajero_Receptor.ID)
                                        {
                                            relacion.Cajero_Receptor.Caja = relacion.Posicion;
                                            _nuevos_colaboradores.Add(relacion.Cajero_Receptor);
                                        }
                                    }
                                }

                                if (relacion.Posicion == grupo.Caja_actual)
                                {
                                    cajrecep = relacion.Cajero_Receptor;
                                }

                                grupo.Grupo_Colaboradores = _nuevos_colaboradores;
                                _relaciones_nuevas.Add(relacion);

                                _total_cajas = relacion.Posicion;
                            }
                        }

                        if (grupo.Total_manifiestos > 0)
                        {
                            grupo.Colaborador = cajrecep.ToString();
                        }

                        else
                        {
                            grupo.Colaborador = string.Empty;
                        }

                        grupo.Relaciones = _relaciones_nuevas;
                    }
                    catch (Exception)
                    {
                        throw new Excepcion("ErrorDatosConexion");
                    }

                    // Actualizar las filas

                    dgvDistribucion.Rows[DESCRIPCION].Cells[columna.Index].Value       = grupo.Descripcion;
                    dgvDistribucion.Rows[CAJA_ACTUAL].Cells[columna.Index].Value       = grupo.Caja_actual;
                    dgvDistribucion.Rows[CAJERO_ASIGNADO].Cells[columna.Index].Value   = grupo.Colaborador;
                    dgvDistribucion.Rows[TOTAL_CAJAS].Cells[columna.Index].Value       = grupo.Numero_cajas;
                    dgvDistribucion.Rows[TOTAL_MANIFIESTOS].Cells[columna.Index].Value = grupo.Total_manifiestos;
                    dgvDistribucion.Rows[MANIFIESTOS_CAJA].Cells[columna.Index].Value  = grupo.Total_manifiestos / grupo.Numero_cajas;

                    _tulas.Add(new Stack <Tula>());

                    _total_manifiestos = grupo.Total_manifiestos + _total_manifiestos;
                }

                // Seleccionar el primer grupo

                this.seleccionarGrupo(_posicion);

                // Mostrar la ventana en toda la pantalla

                Screen pantalla = Screen.PrimaryScreen;

                this.Location = pantalla.Bounds.Location;
                txtManifiesto.Focus();
                //Cursor.Hide();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }