コード例 #1
0
        private void CargarDatos()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = "SELECT * FROM area_servicio.ft_view_agencias_servicio_disponibles_para_dashboards(:p_id_cliente);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_cliente", PgSqlType.Int).Value = Pro_ID_ClienteServicio;

            try
            {
                dsCore1.dtAgenciasDisponibles.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsCore1.dtAgenciasDisponibles);

                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                sentencia = null;
                pgComando.Dispose();

                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "CargarDatos()");
                v_depurador = null;
                MessageBox.Show("Algo salió mal mientras se cargan Agencias Disponibles. ", "FLUCOL");
            }
        }
コード例 #2
0
        private void BorrarNoticia(int pID_Cliente_Noticia)
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string sentencia = @"SELECT * FROM area_servicio.ft_mant_inactivar_noticia (:p_id_cliente_noticia)";

            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_cliente_noticia", PgSqlType.Int).Value = pID_Cliente_Noticia;


            try
            {
                pgComando.ExecuteNonQuery();
                sentencia = null;
                pgComando.Dispose();

                memoNoticia.Text = "";

                CargarDatos();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de Eliminar esta noticia. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #3
0
        private void CargarDatosEmpleadosServicio()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_empleados_servicio_disponibles(:p_id_cliente_servicio,
                                                                                                    :p_id_agencia_servicio);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_ClienteServicio;
            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_AgenciaServicioSeleccionado;

            try
            {
                dsConfiguraciones1.dtEmpleadosServicio.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsConfiguraciones1.dtEmpleadosServicio);

                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en la carga de empleados de servicio. " + Exc.Message);
            }
        }
コード例 #4
0
        private void TrasladarEmpleado()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_mant_trasladar_empleado_a_sucursal(:p_id_cliente_servicio,
                                                                                                   :p_id_agencia_servicio_destino,                                                                             
                                                                                                   :p_codigoempleado,
                                                                                                   :p_usuario);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value         = Pro_ID_ClienteServicio;
            pgComando.Parameters.Add("p_id_agencia_servicio_destino", PgSqlType.Int).Value = Pro_ID_AgenciaServicio;
            pgComando.Parameters.Add("p_codigoempleado", PgSqlType.VarChar).Value          = Pro_CodigoEmpleadoSelecciondo;
            pgComando.Parameters.Add("p_usuario", PgSqlType.VarChar).Value = Pro_Usuario;

            try
            {
                pgComando.ExecuteNonQuery();


                sentencia = null;
                pgComando.Dispose();

                MessageBox.Show("El traslado se completó de manera correcta.");
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el traslado del empleado. " + Exc.Message);
            }
        }
コード例 #5
0
        private void GuardarCambiosTasaCambio()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_mant_registra_tasa_cambio(:p_venta,
                                                                                    :p_compra,
                                                                                    :p_usuario);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_venta", PgSqlType.Numeric).Value   = Convert.ToDecimal(txtVenta.Text);
            pgComando.Parameters.Add("p_compra", PgSqlType.Numeric).Value  = Convert.ToDecimal(txtCompra.Text);
            pgComando.Parameters.Add("p_usuario", PgSqlType.VarChar).Value = Pro_Usuario;

            try
            {
                pgComando.ExecuteNonQuery();
                sentencia = null;
                pgComando.Dispose();
                pgComando = null;



                MessageBox.Show("La tasa de cambio se actualizó exitosamente. ");

                LimpiarCajasTexto();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de Gurdar cambios en la tasa de cambio. ");
            }
        }
コード例 #6
0
ファイル: ctlTasasCambio.cs プロジェクト: jesdav18/Flucol
        private void CargarDatos()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = "SELECT * FROM area_servicio.ft_view_ultima_tasa_cambio();";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                if (pgDr.Read())
                {
                    lblVenta.Text  = pgDr.GetString("venta");
                    lblCompra.Text = pgDr.GetString("compra");
                }

                pgDr.Close();
                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de cargar la tasa de cambio. " + Exc.Message);
            }
        }
コード例 #7
0
        public static DateTime ObtenerHoraServidor(PgSqlConnection pConexion)
        {
            DateTime v_resultado = Convert.ToDateTime(null);

            if (pConexion.State != System.Data.ConnectionState.Open)
            {
                pConexion.Open();
            }

            string       sentencia = "SELECT * FROM arca_tesoros_conf.ft_view_variables_tiempo();";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, pConexion);

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                if (pgDr.Read())
                {
                    v_resultado = pgDr.GetDateTime("fecha_hora_servidor");
                }

                pgDr.Close();

                sentencia = null;
                pgComando.Dispose();
                pgComando = null;

                return(v_resultado);
            }
            catch (Exception Exc)
            {
                Log_Excepciones.CapturadorExcepciones(Exc, "Utilidades.cs", "ObtenerHoraServidor");
                return(Convert.ToDateTime(null));
            }
        }
コード例 #8
0
        private void CargarDatos()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_noticias_cliente (:p_id_cliente_servicio);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_Cliente;

            try
            {
                dsConfiguraciones1.dtNoticias.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsConfiguraciones1.dtNoticias);


                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de Cargar Noticias. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #9
0
ファイル: ctlNoticias.cs プロジェクト: jesdav18/Flucol
        public void CargarDatos()
        {
            v_lista_noticias.Clear();

            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_noticias_cliente (:p_id_cliente_servicio);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_Cliente_Servicio;

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                while (pgDr.Read())
                {
                    v_lista_noticias.Add(pgDr.GetString("texto_noticia"));
                }

                pgDr.Close();
                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de obtener lista de noticias. " + Exc.Message);
            }
        }
コード例 #10
0
        private void HabilitarDeshabilitarEmpleado(string pCodigoEmpleado, bool pHabilitar)
        {
            ValidarConexion();

            string       sentencia = @"SELECT * FROM area_servicio.ft_mant_habilitar_deshabilitar_empleado(:pCodigoEmpleado,
                                                                                                     :pHabilitar,
                                                                                                     :pUsuario);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("pCodigoEmpleado", PgSqlType.VarChar).Value = pCodigoEmpleado;
            pgComando.Parameters.Add("pHabilitar", PgSqlType.Boolean).Value      = pHabilitar;
            pgComando.Parameters.Add("pUsuario", PgSqlType.VarChar).Value        = Pro_Usuario;

            try
            {
                pgComando.ExecuteNonQuery();

                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("ALGO SALIO EN EL MOMENTO DE REGISTRAR EL EMPLEADO. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #11
0
        public void CargarDatos()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_posiciones_disponibles_para_asignacion(:p_id_agencia_servicio,
                                                                                                            :p_id_cliente_servicio);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_AgenciaServicio;
            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_ClienteServicio;

            try
            {
                dsCore1.dtPosicionesDisponibles.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsCore1.dtPosicionesDisponibles);

                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de cargar las posiciones disponibles. " + Exc.Message);
            }
        }
コード例 #12
0
        private void GuardarNotica()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_mant_registrar_noticias_cliente_servicio (
                                                                                                          :p_id_cliente_servicio,
                                                                                                          :p_usuario_posteo,
                                                                                                          :p_texto_noticia
                                                                                                        );";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_Cliente;
            pgComando.Parameters.Add("p_usuario_posteo", PgSqlType.VarChar).Value  = Pro_Usuario;
            pgComando.Parameters.Add("p_texto_noticia", PgSqlType.VarChar).Value   = memoNoticia.Text;

            try
            {
                pgComando.ExecuteNonQuery();
                sentencia = null;
                pgComando.Dispose();

                memoNoticia.Text = "";

                MessageBox.Show("La noticia se registro correctamente. ", "FLUCOL");
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de Ingresar esta noticia. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #13
0
        private bool CargarDatosTicketPosicion()
        {
            string v_datos_posicion = null;

            ValidarConexion();

            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_posicion_asignada (
                                                                                        :p_usuario, 
                                                                                        :p_agencia,
                                                                                        :p_cliente
                                                                                        );";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_usuario", PgSqlType.VarChar).Value = Pro_UsuarioEmpleado;
            pgComando.Parameters.Add("p_agencia", PgSqlType.Int).Value     = Pro_Sucursal;
            pgComando.Parameters.Add("p_cliente", PgSqlType.Int).Value     = Pro_Cliente;

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();

                if (pgDr.Read())
                {
                    v_datos_posicion = ConfigurationSettings.AppSettings["TEXTO_DESCRIPTIVO"] + " " +
                                       pgDr.GetString("posicion");
                }


                pgDr.Close();
                pgDr = null;
                pgComando.Dispose();
                sentencia = null;

                if (string.IsNullOrEmpty(v_datos_posicion))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception Exc)
            {
                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "CargarDatosTicketPosicion()");
                v_depurador = null;
                MessageBox.Show(Exc.Message, "FLUCOL");
                return(false);
            }
        }
コード例 #14
0
        private void CargarDatosTipoSolicitud()
        {
            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            if (!splashScreenManager1.IsSplashFormVisible)
            {
                splashScreenManager1.ShowWaitForm();
            }


            string       sentencia = @"SELECT * FROM arca_tesoros_conf.ft_view_tipo_solicitud();";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            try
            {
                dsConfiguracion1.dtTiposSolicitud.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsConfiguracion1.dtTiposSolicitud);


                sentencia = null;
                pgComando.Dispose();
                pgComando = null;


                if (splashScreenManager1.IsSplashFormVisible)
                {
                    splashScreenManager1.CloseWaitForm();
                }
            }
            catch (Exception Exc)
            {
                if (splashScreenManager1.IsSplashFormVisible)
                {
                    splashScreenManager1.CloseWaitForm();
                }

                pgComando.Dispose();
                Log_Excepciones.CapturadorExcepciones(Exc, this.Name, "CargarDatosTipoSolicitud");
            }
        }
コード例 #15
0
        private void CargarDatosEmpleadoParaEdicion(string pCodigoEmpleado)
        {
            ValidarConexion();

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_datos_empleado_para_edicion(:pCodigoEmpleado);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("pCodigoEmpleado", PgSqlType.VarChar).Value = pCodigoEmpleado;

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();

                int v_id_cargo   = 0;
                int v_id_agencia = 0;

                while (pgDr.Read())
                {
                    txtCodigoEmpleado.Text    = pgDr.GetString("codigo_empleado");
                    txtPrimerNombre.Text      = pgDr.GetString("primer_nombre");
                    txtSegundoNombre.Text     = pgDr.GetString("segundo_nombre");
                    txtPrimerApellido.Text    = pgDr.GetString("primer_apellido");
                    txtSegundoApellido.Text   = pgDr.GetString("segundo_apellido");
                    txtIdentidadEmpleado.Text = pgDr.GetString("identidad_empleado");
                    v_id_cargo   = pgDr.GetInt32("id_cargo");
                    v_id_agencia = pgDr.GetInt32("id_agencia");
                }

                foreach (dsConfiguraciones.dtCargosEmpleadosRow iterador in dsConfiguraciones1.dtCargosEmpleados)
                {
                    if (iterador.id_cargo == v_id_cargo)
                    {
                        gridCargos.EditValue = iterador.id_cargo;
                        break;
                    }
                }

                foreach (dsConfiguraciones.dtAgenciasServicioRow iterador in dsConfiguraciones1.dtAgenciasServicio)
                {
                    if (iterador.id_agencia_servicio == v_id_agencia)
                    {
                        gridAgencias.EditValue = iterador.id_agencia_servicio;
                        break;
                    }
                }

                pgDr.Close();
                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("ALGO SALIO EN EL MOMENTO DE REGISTRAR EL EMPLEADO. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #16
0
        private void LlamadoTickets()
        {
            ValidarConexion();

            PgSqlConnection vConexion = new PgSqlConnection(Pro_Conexion.ConnectionString);

            vConexion.Password = Pro_Conexion.Password;
            vConexion.Open();

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_consulta_llamados_tickets (
                                                                                                :p_agencia_servicio,
                                                                                                :p_cliente_servicio
                                                                                                )";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, vConexion);

            pgComando.Parameters.Add("p_agencia_servicio", PgSqlType.Int).Value = Pro_Sucursal;
            pgComando.Parameters.Add("p_cliente_servicio", PgSqlType.Int).Value = Pro_ID_Cliente;

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                if (pgDr.Read())
                {
                    v_ticket          = pgDr.GetString("ticket");
                    v_posicion        = pgDr.GetString("posicion");
                    v_tipo_ticket     = pgDr.GetInt32("tipo_ticket");
                    v_primera_letra   = pgDr.GetString("primera_letra");
                    v_segunda_letra   = pgDr.GetString("segunda_letra");
                    v_tercera_letra   = pgDr.GetString("tercera_letra");
                    v_cuarta_letra    = pgDr.GetString("cuarta_letra");
                    v_quinta_letra    = pgDr.GetString("quinta_letra");
                    v_sexta_letra     = pgDr.GetString("sexta_letra");
                    v_longitud_ticket = pgDr.GetInt32("longitud_ticket");

                    ReproducirAudioLlamadoTicket();
                }

                pgDr.Close();
                pgDr = null;
                pgComando.Dispose();
                vConexion.Close();
                vConexion.Dispose();
                sentencia = null;
            }
            catch (Exception Exc)
            {
                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "LlamadoTickets()");
                v_depurador = null;
            }
        }
コード例 #17
0
        private void RegistrarEmpleado()
        {
            ValidarConexion();

            string       sentencia = @"SELECT * FROM area_servicio.ft_mant_registrar_empleado(:pID_ClienteServicio,
                                                                                        :pID_AgenciaServicio,
                                                                                        :pUsuario,
                                                                                        :pCodigoEmpleado,                                           
                                                                                        :pPrimerNombre,
                                                                                        :pSegundoNombre,
                                                                                        :pPrimerApellido,
                                                                                        :pSegundoApellido,
                                                                                        :pIdentidad,
                                                                                        :pID_Cargo,
                                                                                        :pID_AgenciaAsignacion,
                                                                                        :pUsuarioEmpleado,
                                                                                        :pContraseniaTemporal
                                                                                        );";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("pID_ClienteServicio", PgSqlType.Int).Value      = Pro_ID_ClienteServicio;
            pgComando.Parameters.Add("pID_AgenciaServicio", PgSqlType.Int).Value      = Pro_ID_AgenciaServicio;
            pgComando.Parameters.Add("pUsuario", PgSqlType.VarChar).Value             = Pro_Usuario;
            pgComando.Parameters.Add("pCodigoEmpleado", PgSqlType.VarChar).Value      = txtCodigoEmpleado.Text;
            pgComando.Parameters.Add("pPrimerNombre", PgSqlType.VarChar).Value        = txtPrimerNombre.Text;
            pgComando.Parameters.Add("pSegundoNombre", PgSqlType.VarChar).Value       = txtSegundoNombre.Text;
            pgComando.Parameters.Add("pPrimerApellido", PgSqlType.VarChar).Value      = txtPrimerApellido.Text;
            pgComando.Parameters.Add("pSegundoApellido", PgSqlType.VarChar).Value     = txtSegundoApellido.Text;
            pgComando.Parameters.Add("pIdentidad", PgSqlType.VarChar).Value           = txtIdentidadEmpleado.Text;
            pgComando.Parameters.Add("pID_Cargo", PgSqlType.Int).Value                = gridCargos.EditValue;
            pgComando.Parameters.Add("pID_AgenciaAsignacion", PgSqlType.Int).Value    = gridAgencias.EditValue;
            pgComando.Parameters.Add("pUsuarioEmpleado", PgSqlType.VarChar).Value     = txtUsuario.Text;
            pgComando.Parameters.Add("pContraseniaTemporal", PgSqlType.VarChar).Value = txtContraseniaTemporal.Text;

            try
            {
                pgComando.ExecuteNonQuery();

                sentencia = null;
                pgComando.Dispose();

                MessageBox.Show("EMPLEADO REGISTRADO EXITOSAMENTE", "FLUCOL");

                LimpiarCajasTexto();
                NavigationEmpleados.SelectedPage = pagePrimeraPagina;
            }
            catch (Exception Exc)
            {
                MessageBox.Show("ALGO SALIO EN EL MOMENTO DE REGISTRAR EL EMPLEADO. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #18
0
        private void GenerarTicket()
        {
            ValidarConexion();

            splashScreenManager1.ShowWaitForm();
            PgSqlTransaction pgTrans = Pro_Conexion.BeginTransaction();

            string       sentencia = @"SELECT * FROM configuracion.sp_proc_genera_correlativos_ticket (
                                                                                                :p_id_agencia_servicio,
                                                                                                :p_id_cliente_servicio,
                                                                                                :p_id_tipo_ticket_servicio,
                                                                                                :p_id_operacion_servicio,
                                                                                                :p_direccion_ip
                                                                                            );";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value     = Pro_ID_AgenciaServicio;
            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value     = Pro_ID_Cliente_Servicio;
            pgComando.Parameters.Add("p_id_tipo_ticket_servicio", PgSqlType.Int).Value = Pro_ID_Tipo_Ticket_Servicio;
            pgComando.Parameters.Add("p_id_operacion_servicio", PgSqlType.Int).Value   = Pro_ID_Operacion_Servicio;
            pgComando.Parameters.Add("p_direccion_ip", PgSqlType.VarChar).Value        = Pro_IP_Host;

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();

                if (pgDr.Read())
                {
                    Pro_Ticket_Generado = pgDr.GetString("numero_ticket");
                }


                pgTrans.Commit();
                pgDr.Close();
                pgComando.Dispose();
                sentencia = null;

                splashScreenManager1.CloseWaitForm();
            }
            catch (Exception Exc)
            {
                splashScreenManager1.CloseWaitForm();
                pgTrans.Rollback();
                Pro_Ticket_Generado = null;
                MessageBox.Show(Exc.Message, "FLUCOL");
            }
        }
コード例 #19
0
        private void ObtenerNombreSucursal()
        {
            if (Pro_Conexion.State != System.Data.ConnectionState.Open)
            {
                try
                {
                    Pro_Conexion.Open();
                }
                catch (Exception Exc)
                {
                    DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                    v_depurador.CapturadorExcepciones(Exc,
                                                      this.Name,
                                                      "ObtenerNombreSucursal()");
                    v_depurador = null;
                }
            }

            try
            {
                string       sentencia = @"SELECT * FROM area_servicio.ft_view_nombre_agencia_servicio (
                                                                                                    :p_id_agencia_servicio,
                                                                                                    :p_id_cliente_servicio
                                                                                                 );";
                PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);
                pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_AgenciaServicio;
                pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_ClienteServicio;
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                if (pgDr.Read())
                {
                    Pro_NombreAgenciaServicio = pgDr.GetString("nombre_agencia");
                }

                pgDr.Close();
                pgComando.Dispose();
                sentencia = null;
            }
            catch (Exception Exc)
            {
                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "ObtenerNombreSucursal()");
                v_depurador = null;
            }
        }
コード例 #20
0
ファイル: CtlOperacional.cs プロジェクト: jesdav18/Flucol
        private int ObtenerEstadoTicket()
        {
            ValidarConexion();

            int          v_estado_ticket = 0;
            string       sentencia       = @"SELECT * FROM area_servicio.ft_view_estado_ticket (
                                                                                    :p_id_ticket_servicio,
                                                                                    :p_id_cliente_servicio,
                                                                                    :p_id_agencia_servicio
                                                                                    )";
            PgSqlCommand pgComando       = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_ticket_servicio", PgSqlType.VarChar).Value = Pro_Ticket_Servicio;
            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value    = Pro_ID_ClienteServicio;
            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value    = Pro_ID_AgenciaServicio;

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                if (pgDr.Read())
                {
                    v_estado_ticket = pgDr.GetInt32("estado");
                }

                pgDr.Close();
                sentencia = null;
                pgComando.Dispose();
                pgDr = null;

                return(v_estado_ticket);
            }
            catch (Exception Exc)
            {
                MessageBox.Show("ALGO SALIÓ MAL EN EL MOMENTO DE OBTENER ESTADO DEL TICKET. " + Exc.Message);

                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "ObtenerEstadoTicket()");
                v_depurador = null;

                return(v_estado_ticket);
            }
        }
コード例 #21
0
        private bool AsignarPosicion(int pPosicion,
                                     int pID_TipoTicketServicio,
                                     string pUsuario)
        {
            bool v_respuesta = false;

            splashScreenManager1.ShowWaitForm();

            if (Pro_Conexion.State != ConnectionState.Open)
            {
                Pro_Conexion.Open();
            }

            string       sentencia = @"SELECT * FROM area_servicio.ft_mant_asignar_posicion_a_empleado(:p_id_agencia_servicio,
                                                                                                 :p_id_cliente_servicio,
                                                                                                 :p_empleado_asignado,
                                                                                                 :p_usuario_posteo,
                                                                                                 :p_posicion_asignada,
                                                                                                 :p_id_tipo_ticket_servicio);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value     = Pro_ID_Agencia_Servicio;
            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value     = Pro_ID_Cliente_Servicio;
            pgComando.Parameters.Add("p_empleado_asignado", PgSqlType.VarChar).Value   = pUsuario;
            pgComando.Parameters.Add("p_usuario_posteo", PgSqlType.VarChar).Value      = Pro_Usuario;
            pgComando.Parameters.Add("p_posicion_asignada", PgSqlType.Int).Value       = pPosicion;
            pgComando.Parameters.Add("p_id_tipo_ticket_servicio", PgSqlType.Int).Value = pID_TipoTicketServicio;

            try
            {
                v_respuesta = (bool)pgComando.ExecuteScalar();
                sentencia   = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                v_respuesta = false;
                MessageBox.Show(Exc.Message);
            }

            splashScreenManager1.CloseWaitForm();
            return(v_respuesta);
        }
コード例 #22
0
        private void CargarDatos()
        {
            PgSqlConnection v_conexion_temporal = new PgSqlConnection(Pro_Conexion.ConnectionString);

            v_conexion_temporal.Password = Pro_Conexion.Password;
            v_conexion_temporal.Open();

            string sentencia = @"SELECT * FROM area_servicio.ft_view_dashboard_empleados_con_mas_tickets_atendidos(:p_id_cliente_servicio,
                                                                                                                   :p_id_agencia_servicio,                                                                                                                  
                                                                                                                   :p_desde,
                                                                                                                   :p_hasta);";


            PgSqlCommand pgComando = new PgSqlCommand(sentencia, v_conexion_temporal);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_Cliente_Servicio;
            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_Agencia_Servicio;
            pgComando.Parameters.Add("p_desde", PgSqlType.Date).Value = Pro_Desde;
            pgComando.Parameters.Add("p_hasta", PgSqlType.Date).Value = Pro_Hasta;


            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                if (pgDr.Read())
                {
                    lblNombreEmpleado.Text         = pgDr.GetString("nombre_empleado");
                    lblNumeroTicketsAtendidos.Text = pgDr.GetString("numero_tickets_atendidos");
                    lblSucursalEmpleado.Text       = pgDr.GetString("agencia_servicio");
                }

                pgDr.Close();
                pgDr      = null;
                sentencia = null;
                pgComando.Dispose();
                v_conexion_temporal.Close();
                v_conexion_temporal.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de cargar Dashboard \"EMPLEADO CON MAS TICKETS ATENDIDOS\"." + Exc.Message);
            }
        }
コード例 #23
0
        private void CargarDatosCargosDisponibles()
        {
            ValidarConexion();

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_cargos_disponibles();";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            try
            {
                dsConfiguraciones1.dtCargosEmpleados.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsConfiguraciones1.dtCargosEmpleados);

                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("ALGO SALIÓ MAL EN LA CARGA DE LOS CARGOS DE EMPLEADO. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #24
0
        private async Task ListaTicketsAsincrono()
        {
            while (Pro_CargarLista)
            {
                ValidarConexion();

                string sentencia = @"SELECT * FROM area_servicio.ft_view_cola_tickets_en_espera(:p_id_cliente_servicio,
                                                                                                         :p_id_agencia_servicio,
                                                                                                         :p_usuario);";

                PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);
                pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_ClienteServicio;
                pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_AgenciaServicio;
                pgComando.Parameters.Add("p_usuario", PgSqlType.VarChar).Value         = Pro_Usuario;

                try
                {
                    dsTickets1.dtTickets.Clear();
                    new PgSqlDataAdapter(pgComando).Fill(dsTickets1.dtTickets);

                    Pro_ConteoTicketsEspera = dsTickets1.dtTickets.Count;

                    sentencia = null;
                    pgComando.Dispose();
                }
                catch (Exception Exc)
                {
                    DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                    v_depurador.CapturadorExcepciones(Exc,
                                                      this.Name,
                                                      "ListaTicketsAsincrono()");
                    v_depurador = null;

                    MessageBox.Show("ALGO SALIÓ MAL EN EL MOMENTO DE CARGAR LA LISTA DE TICKETS EN ESPERA.", "FLUCOL");
                }

                await Task.Delay(500);
            }
        }
コード例 #25
0
        private void CargarDatos()
        {
            PgSqlConnection v_conexion_temporal = new PgSqlConnection(Pro_Conexion.ConnectionString);

            v_conexion_temporal.Password = Pro_Conexion.Password;
            v_conexion_temporal.Open();

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_dashboard_promedio_atencion(
                                                                                                 :p_id_cliente_servicio,
                                                                                                 :p_id_agencia_servicio,
                                                                                                 :p_desde,
                                                                                                 :p_hasta);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, v_conexion_temporal);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_ClienteServicio;
            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_AgenciaServicio;
            pgComando.Parameters.Add("p_desde", PgSqlType.Date).Value = Pro_Desde;
            pgComando.Parameters.Add("p_hasta", PgSqlType.Date).Value = Pro_Hasta;

            try
            {
                PgSqlDataReader pgDr = pgComando.ExecuteReader();
                if (pgDr.Read())
                {
                    lblPromedioAtencion.Text = pgDr.GetString("promedio_atencion");
                }

                pgDr.Close();
                pgDr      = null;
                sentencia = null;
                pgComando.Dispose();
                v_conexion_temporal.Close();
                v_conexion_temporal.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de cargar Dashboard \"PROMEDIO DE ATENCION\"." + Exc.Message);
            }
        }
コード例 #26
0
        private void CargarDatos()
        {
            PgSqlConnection v_conexion_temporal = new PgSqlConnection(Pro_Conexion.ConnectionString);

            v_conexion_temporal.Password = Pro_Conexion.Password;
            v_conexion_temporal.Open();

            string       sentencia = @"SELECT * FROM area_servicio.ft_view_dashboard_tickets_atendidos_no_atendidos(
                                                                                                              :p_id_cliente_servicio,
                                                                                                              :p_id_agencia_servicio,
                                                                                                              :p_desde,
                                                                                                              :p_hasta
                                                                                                            )";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, v_conexion_temporal);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_Cliente_Servicio;
            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_Agencia_Servicio;
            pgComando.Parameters.Add("p_desde", PgSqlType.Date).Value = Pro_Desde;
            pgComando.Parameters.Add("p_hasta", PgSqlType.Date).Value = Pro_Hasta;


            try
            {
                dsDashboards.dtTicketsAtendidos_NoAtendidos.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsDashboards.dtTicketsAtendidos_NoAtendidos);

                chrt_TicketsAtendidos_NoAtendidos.Show();
                chrt_TicketsAtendidos_NoAtendidos.RefreshData();

                sentencia = null;
                pgComando.Dispose();
                v_conexion_temporal.Close();
                v_conexion_temporal.Dispose();
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de cargar el dashboard \"TICKETS ATENDIDOS Y NO ATENDIDOS\". " + Exc.Message);
            }
        }
コード例 #27
0
ファイル: CtlOperacional.cs プロジェクト: jesdav18/Flucol
        public void MarcarParoTiempo(MOTIVOS_PARO_TIEMPO pMotivo)
        {
            ValidarConexion();

            string       sentencia = @"SELECT * FROM area_servicio.ft_mant_registra_paros_tiempo (
                                                                                              :p_codigoempleado,
                                                                                              :p_id_cliente_servicio,
                                                                                              :p_id_agencia_servicio,
                                                                                              :p_id_motivo,
                                                                                              :p_observaciones
                                                                                            )";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_codigoempleado", PgSqlType.VarChar).Value  = Pro_CodigoEmpleado;
            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_ClienteServicio;
            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_AgenciaServicio;
            pgComando.Parameters.Add("p_id_motivo", PgSqlType.Int).Value           = pMotivo;
            pgComando.Parameters.Add("p_observaciones", PgSqlType.VarChar).Value   = DBNull.Value;

            try
            {
                pgComando.ExecuteNonQuery();
                pgComando.Dispose();
                sentencia = null;

                MessageBox.Show("EL PARO DE TIEMPO FUE REGISTRADO, YA PUEDE CERRAR SU SESIÓN. ", "FLUCOL");
                this.BringToFront();
            }
            catch (Exception Exc)
            {
                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "MarcarParoTiempo(MOTIVOS_PARO_TIEMPO pMotivo)");
                v_depurador = null;
                MessageBox.Show("ALGO SALIÓ MAL EN EL MOMENTO DE MARCAR EL PARO DE TIEMPO. " + Exc.Message, "FLUCOL");
            }
        }
コード例 #28
0
        private void CargarColaTickets()
        {
            ValidarConexion();

            PgSqlConnection vConexion = new PgSqlConnection(Pro_Conexion.ConnectionString);

            vConexion.Password = Pro_Conexion.Password;
            vConexion.Open();


            string       sentencia = @"SELECT * FROM area_servicio.ft_view_cola_tickets (
                                                                                    :p_cliente_servicio,
                                                                                    :p_agencia_servicio
                                                                                    );";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, vConexion);

            pgComando.Parameters.Add("p_cliente_servicio", PgSqlType.Int).Value = Pro_ID_Cliente;
            pgComando.Parameters.Add("p_agencia_servicio", PgSqlType.Int).Value = Pro_Sucursal;

            try
            {
                dsTicketsPosiciones1.dtTicketsPosiciones.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsTicketsPosiciones1.dtTicketsPosiciones);

                sentencia = null;
                pgComando.Dispose();
                vConexion.Close();
                vConexion.Dispose();
            }
            catch (Exception Exc)
            {
                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "CargarColaTickets()");
                v_depurador = null;
            }
        }
コード例 #29
0
        private void LimpiarTickets()
        {
            if (Pro_Conexion.State != System.Data.ConnectionState.Open)
            {
                try
                {
                    Pro_Conexion.Open();
                }
                catch (Exception Exc)
                {
                    MessageBox.Show(Exc.Message, "FLUCOL");
                    return;
                }
            }

            string       sentencia = @"SELECT * FROM configuracion.ft_proc_limpiar_tickets_temporal(:p_id_cliente_servicio,
                                                                                              :p_id_agencia_servicio
                                                                                              );";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, Pro_Conexion);

            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_AgenciaServicio;
            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_ClienteServicio;

            try
            {
                pgComando.ExecuteNonQuery();
                sentencia = null;
                pgComando.Dispose();
            }
            catch (Exception Exc)
            {
                DepuradorExcepciones v_depurador = new DepuradorExcepciones();
                v_depurador.CapturadorExcepciones(Exc,
                                                  this.Name,
                                                  "LimpiarTickets()");
                v_depurador = null;
            }
        }
コード例 #30
0
        private void CargarDatos()
        {
            PgSqlConnection v_conexion_temporal = new PgSqlConnection(Pro_Conexion.ConnectionString);

            v_conexion_temporal.Password = Pro_Conexion.Password;
            v_conexion_temporal.Open();


            string       sentencia = @"SELECT * FROM area_servicio.ft_view_dashboard_visitas_segun_prioridad_servicio(
                                                                                                                :p_id_cliente_servicio,
                                                                                                                :p_id_agencia_servicio,
                                                                                                                :p_desde,
                                                                                                                :p_hasta);";
            PgSqlCommand pgComando = new PgSqlCommand(sentencia, v_conexion_temporal);

            pgComando.Parameters.Add("p_id_cliente_servicio", PgSqlType.Int).Value = Pro_ID_Cliente_Servicio;
            pgComando.Parameters.Add("p_id_agencia_servicio", PgSqlType.Int).Value = Pro_ID_Agencia_Servicio;
            pgComando.Parameters.Add("p_desde", PgSqlType.Date).Value = Pro_Desde;
            pgComando.Parameters.Add("p_hasta", PgSqlType.Date).Value = Pro_Hasta;

            try
            {
                dsDashboards1.dtVisitasSegunPrioridadServicio.Clear();
                new PgSqlDataAdapter(pgComando).Fill(dsDashboards1.dtVisitasSegunPrioridadServicio);

                chartControl1.Show();
                chartControl1.RefreshData();

                sentencia = null;
                pgComando.Dispose();
                v_conexion_temporal.Close();
                v_conexion_temporal = null;
            }
            catch (Exception Exc)
            {
                MessageBox.Show("Algo salió mal en el momento de cargar dashboard \"VISITAS SEGUN PRIORIDAD DE SERVICIO\". " + Exc.Message);
            }
        }