Ejemplo n.º 1
0
        private void EstadoBotones(TipoProceso TipoProceso)
        {
            try
            {
                if (TipoProceso == frmCon_ProcesosContables.TipoProceso.Mayorizar)
                {
                    btn_mayorizar.Enabled   = true;
                    btn_cierre.Enabled      = false;
                    btn_ReversoMayo.Enabled = true;
                }

                if (TipoProceso == frmCon_ProcesosContables.TipoProceso.CierrePerido)
                {
                    btn_mayorizar.Enabled   = false;
                    btn_cierre.Enabled      = true;
                    btn_ReversoMayo.Enabled = false;
                }

                if (TipoProceso == frmCon_ProcesosContables.TipoProceso.Reverso)
                {
                    btn_mayorizar.Enabled   = true;
                    btn_cierre.Enabled      = false;
                    btn_ReversoMayo.Enabled = true;
                }
            }
            catch (Exception ex)
            { Log_Error_bus.Log_Error(ex.ToString());
              MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
Ejemplo n.º 2
0
 private void cboFechasGen_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboFechasGen.Items.Count > 0)
     {
         tipoProceso = TipoProceso.Visualizacion;
         Procesar();
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Método encargado de Editar los Procesos de Paquetes
 /// </summary>
 /// <param name="tipo_proceso">Tipo de Proceso</param>
 /// <param name="estatus">Estatus del Proceso</param>
 /// <param name="id_compania">Compania Emisora</param>
 /// <param name="consecutivo_compania">Consecutivo por Compania</param>
 /// <param name="id_cliente">Cliente Receptor</param>
 /// <param name="fecha_inicio">Fecha de Inicio</param>
 /// <param name="fecha_fin">Fecha de Fin</param>
 /// <param name="id_usuario_responsable">Usuario Responsable del Proceso</param>
 /// <param name="referencia">Referencia</param>
 /// <param name="id_usuario">Usuario que Actualiza el Registro</param>
 /// <returns></returns>
 public RetornoOperacion EditaPaqueteProceso(TipoProceso tipo_proceso, Estatus estatus, int id_compania, int consecutivo_compania,
                                             int id_cliente, DateTime fecha_inicio, DateTime fecha_fin, int id_usuario_responsable, string referencia,
                                             int id_usuario)
 {
     //Devolviendo Resultado Obtenido
     return(this.actualizaRegistros(tipo_proceso, estatus, id_compania, consecutivo_compania, id_cliente, fecha_inicio,
                                    fecha_fin, id_usuario_responsable, referencia, id_usuario, this._habilitar));
 }
        public ActionResult DeleteConfirmed(int id)
        {
            TipoProceso tipoProceso = db.TipoProceso.Find(id);

            db.TipoProceso.Remove(tipoProceso);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Envía un correo genérico informando la conformidad de un proceso
        /// </summary>
        /// <param name="tipoProceso"></param>
        public void sendMailConfirmacion(TipoProceso tipoProceso)
        {
            logger.info("Enviando mail de Confirmacion...");
            var nombreCorreo  = string.Format("EL ROBOT DE {0} SABRE SE EJECUTÓ SATISFACTORIAMENTE", tipoProceso.ToString());
            var subjectCorreo = string.Format("EL ROBOT DE {0} SABRE SE EJECUTÓ SATISFACTORIAMENTE ", tipoProceso.ToString());
            var bodyCorreo    = string.Format("EL ROBOT DE {0} SABRE SE EJECUTÓ SATISFACTORIAMENTE ", tipoProceso.ToString());

            sendMail(nombreCorreo, subjectCorreo, bodyCorreo);
        }
Ejemplo n.º 6
0
 public int Grabar(System.Data.DataSet Dataset, string NombreTabla, TipoProceso TipoProceso)
 {
     object[] results = this.Invoke("Grabar", new object[] {
         Dataset,
         NombreTabla,
         TipoProceso
     });
     return((int)(results[0]));
 }
Ejemplo n.º 7
0
        /// <summary>
        ///     Envía un correo genérico informando de algún error ocurrido en un proceso
        /// </summary>
        /// <param name="exception">Exception generada que se notificará</param>
        public void sendMailError(Exception exception, TipoProceso tipoProceso)
        {
            logger.info("Enviando mail de error...");
            var nombreCorreo  = string.Format("ERROR EN ROBOT DE ANULACIONES, Proceso: {0}", tipoProceso.ToString());
            var subjectCorreo = "ERROR EN ROBOT DE ANULACIONES ";
            var bodyCorreo    = "ERROR AL EJECUTAR EL ROBOT DE ANULACIONES " + exception;

            sendMail(nombreCorreo, subjectCorreo, bodyCorreo);
        }
 public ActionResult Edit([Bind(Include = "IdTipoProceso,NombreTipoProceso")] TipoProceso tipoProceso)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tipoProceso).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tipoProceso));
 }
Ejemplo n.º 9
0
 public ServiceBoleto(TipoProceso tipoProceso, string fecha)
 {
     this.objDominio   = new classBO();
     this.logger       = new GestorLog();
     this.utilSession  = new UtilSession();
     this.tipoProceso  = tipoProceso;
     this.fechaReporte = fecha;
     this.fileUtils    = FileUtils.getInstance();
     this.dateUtils    = DateUtils.getInstance();
 }
        public ActionResult Create([Bind(Include = "IdTipoProceso,NombreTipoProceso")] TipoProceso tipoProceso)
        {
            if (ModelState.IsValid)
            {
                db.TipoProceso.Add(tipoProceso);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tipoProceso));
        }
Ejemplo n.º 11
0
 /// <remarks/>
 public void GrabarAsync(System.Data.DataSet Dataset, string NombreTabla, TipoProceso TipoProceso, object userState)
 {
     if ((this.GrabarOperationCompleted == null))
     {
         this.GrabarOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGrabarOperationCompleted);
     }
     this.InvokeAsync("Grabar", new object[] {
         Dataset,
         NombreTabla,
         TipoProceso
     }, this.GrabarOperationCompleted, userState);
 }
Ejemplo n.º 12
0
        private void btnPExportar_Click(object sender, EventArgs e)
        {
            if (grdPDatos.Rows.Count == 0)
            {
                MessageBox.Show("No hay datos para exportar", "Exportar a Excel", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            Archivo     = string.Empty;
            tipoProceso = TipoProceso.Extraccion;
            ProcesarP();
        }
Ejemplo n.º 13
0
        public static BoletoFactory getBoletoFactory(TipoProceso tipoProceso, string fecha)
        {
            switch (Configuracion.Gds)
            {
            //case GDS.SABRE:
            //    return new ServiceBoletoSabre();
            case GDS.AMADEUS:
                return(new ServiceBoletoAmadeus(tipoProceso, fecha));

            default:
                return(null);
            }
        }
        // GET: TipoProceso/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TipoProceso tipoProceso = db.TipoProceso.Find(id);

            if (tipoProceso == null)
            {
                return(HttpNotFound());
            }
            return(View(tipoProceso));
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Método encargado de Actualizar los Registros en BD
        /// </summary>
        /// <param name="tipo_proceso">Tipo de Proceso</param>
        /// <param name="estatus">Estatus</param>
        /// <param name="id_compania">Compania Emisora</param>
        /// <param name="consecutivo_compania">Consecutivo por Compania</param>
        /// <param name="id_cliente">Cliente Receptor</param>
        /// <param name="fecha_inicio">Fecha de Inicio</param>
        /// <param name="fecha_fin">Fecha de Fin</param>
        /// <param name="id_usuario_responsable">Usuario Responsable del Proceso</param>
        /// <param name="referencia">Referencia</param>
        /// <param name="id_usuario">Usuario que Actualiza el Registro</param>
        /// <param name="habilitar">Estatus Habilitar</param>
        /// <returns></returns>
        private RetornoOperacion actualizaRegistros(TipoProceso tipo_proceso, Estatus estatus, int id_compania, int consecutivo_compania,
                                                    int id_cliente, DateTime fecha_inicio, DateTime fecha_fin, int id_usuario_responsable, string referencia,
                                                    int id_usuario, bool habilitar)
        {
            //Declarando Objeto de Retorno
            RetornoOperacion result = new RetornoOperacion();

            //Armando Arreglo de Parametros
            object[] param = { 2,                                                     this._id_paquete_proceso,                           tipo_proceso, estatus,   id_compania, consecutivo_compania, id_cliente,
                               TSDK.Base.Fecha.ConvierteDateTimeObjeto(fecha_inicio), TSDK.Base.Fecha.ConvierteDateTimeObjeto(fecha_fin),
                               id_usuario_responsable,                                referencia,                                         id_usuario,   habilitar, "",          "" };

            //Realizando Actualización
            result = CapaDatos.m_capaDeDatos.EjecutaProcAlmacenadoObjeto(_nom_sp, param);

            //Devolviendo Resultado Obtenido
            return(result);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Método encargado de Insertar los Procesos de Paquete
        /// </summary>
        /// <param name="tipo_proceso">Tipo de Proceso</param>
        /// <param name="id_compania">Compania Emisora</param>
        /// <param name="consecutivo_compania">Consecutivo por Compania</param>
        /// <param name="id_cliente">Cliente Receptor</param>
        /// <param name="fecha_inicio">Fecha de Inicio</param>
        /// <param name="fecha_fin">Fecha de Fin</param>
        /// <param name="id_usuario_responsable">Usuario Responsable del Proceso</param>
        /// <param name="referencia">Referencia</param>
        /// <param name="id_usuario">Usuario que Actualiza el Registro</param>
        /// <returns></returns>
        public static RetornoOperacion InsertaPaqueteProceso(TipoProceso tipo_proceso, int id_compania, int consecutivo_compania,
                                                             int id_cliente, DateTime fecha_inicio, DateTime fecha_fin, int id_usuario_responsable, string referencia,
                                                             int id_usuario)
        {
            //Declarando Objeto de Retorno
            RetornoOperacion result = new RetornoOperacion();

            //Armando Arreglo de Parametros
            object[] param = { 1,                                                                                                      0, (byte)tipo_proceso, (byte)Estatus.Registrado, id_compania, consecutivo_compania, id_cliente,
                               TSDK.Base.Fecha.ConvierteDateTimeObjeto(fecha_inicio), TSDK.Base.Fecha.ConvierteDateTimeObjeto(fecha_fin),
                               id_usuario_responsable,                                referencia,                                         id_usuario,         true,                     "",          "" };

            //Realizando Actualización
            result = CapaDatos.m_capaDeDatos.EjecutaProcAlmacenadoObjeto(_nom_sp, param);

            //Devolviendo Resultado Obtenido
            return(result);
        }
Ejemplo n.º 17
0
        public static ReporteFactory getReporteFactory(TipoProceso tipoProceso, List <BoletoRobotDTO> boletosProcesar)
        {
            switch (tipoProceso)
            {
            case TipoProceso.AVISO_ANULACION:
            case TipoProceso.ANULACION:
                return(new ReporteAvisoAnulacion(boletosProcesar));

            case TipoProceso.AVISO_NO_EN_PTA:
                return(new ReporteNoEnPTA(boletosProcesar));

            case TipoProceso.AVISO_NO_FACTURADOS:
                return(new ReporteNoFacturado(boletosProcesar));

            default:
                return(null);
            }
        }
Ejemplo n.º 18
0
        public List <BoletoRobotDTO> getBoletosMock(TipoProceso tipoProceso)
        {
            List <BoletoRobotDTO> boletos = null;
            var service = BoletoFactory.getBoletoFactory(tipoProceso, getFechaPorTipoProceso(tipoProceso));

            var pathNoFacturados = @"C:\ROBOT_ANULACION_AMADEUS\JSON\BoletosNoFacturados.json";

            if (!File.Exists(pathNoFacturados))
            {
                boletos = service.ObtenerBoletosConDeudaPendiente();
                var ljsonBoletosDQB = Utilitario.Serializar(boletos);
                FileUtils.getInstance().write(pathNoFacturados, ljsonBoletosDQB);
            }
            else
            {
                var ljsonBoletosEmitidos = FileUtils.getInstance().read(pathNoFacturados);
                boletos = new JavaScriptSerializer().Deserialize <List <BoletoRobotDTO> >(ljsonBoletosEmitidos);
            }
            return(boletos);
        }
Ejemplo n.º 19
0
        //public static void IngresarProceso(String TxtNumeroProceso, DateTime DateFecha,DateTime FechaRadicacion, String ComboBoxTipoProceso, String ComboBoxTipoNovedad, String TxtConceptoNovedad, String TxtDocAprendiz)
        public static void IngresarProceso(string idProceso, string tipoProceso, DateTime dateFecha, string fechaRadicacion, string tipoNovedad, string conceptoNovedad, string documentoAprendiz)
        {
            try
            {
                SqlCommand   Commando;
                ConnectionBD Puente;
                Puente   = new ConnectionBD();
                Commando = new SqlCommand("insert into Proceso(TipoProceso,Fecha,FechaRadicacion,TipoNovedad,ConceptoNovedad,DocumentoAprendiz) values('"
                                          + TipoProceso.ToUpper() + "','" + DateFecha + "','" + DateFechaRadicacion + "','" + TipoNovedad.ToUpper() +
                                          "','" + ConceptoNovedad.ToUpper() + "','" + DocumentoAprendiz.ToUpper() + "')",
                                          Puente.RetornarConnexion());
                Commando.ExecuteNonQuery();

                MessageBox.Show("INGRESO EXITOSO");

                Commando.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show("INGRESO ERRONEO");
            }
        }
Ejemplo n.º 20
0
 /// <remarks/>
 public void GrabarAsync(System.Data.DataSet Dataset, string NombreTabla, TipoProceso TipoProceso)
 {
     this.GrabarAsync(Dataset, NombreTabla, TipoProceso, null);
 }
Ejemplo n.º 21
0
 public ServiceBoletoAmadeus(TipoProceso tipoProceso, string fecha)
 {
     this.tipoProceso = tipoProceso;
     this.fecha       = fecha;
     logger.info(string.Format("[TipoProceso: {0} - Fecha: {1}]", tipoProceso, fecha));
 }
Ejemplo n.º 22
0
        void ShowColumns(TipoProceso tipoProceso)
        {
            // ocultar bandas
            for (int i = 0; i < gvPrepSample.Bands.Count; i++)
                if (gvPrepSample.Bands[i] != gbMuestra)
                    gvPrepSample.Bands[i].Visible = false;

            // ocultar todas las columnas
            for (int i = 0; i < gvPrepSample.Columns.Count; i++)
                gvPrepSample.Columns[i].Visible = false;

            // asignar visibilidad
            gcol_Cod_sample.Visible = false;
            gcol_Idrecep_sample_detail.Visible = true;
            gcol_Weight_gross.Visible = true;
            gcol_Weight_gross_date.Visible = true;
            gcol_Weight_gross_user.Visible = true;

            switch(tipoProceso)
            {
                case TipoProceso.RecepSample:

                    gcol_Flag_humidity_analysis.OwnerBand.Visible = true;

                    gcol_Flag_humidity_analysis.Visible = true;
                    gcol_Flag_60celsius.Visible = true;
                    gcol_Flag_reject.Visible = true;
                    gcol_Flag_counter_sample.Visible = true;
                    gcol_Observation1.Visible = true;

                    //gcol_Input_sample_date.Visible = true;
                    //gcol_Input_sample_user.Visible = true;
                    break;
                case TipoProceso.PesarRechazos:
                    // peso de rechazo para almacenamiento
                    gcol_Weight_gross.Visible = false;
                    gcol_Weight_gross_date.Visible = false;
                    gcol_Weight_gross_user.Visible = false;

                    gcol_Weight_gross_reject.OwnerBand.Visible = true;
                    gcol_Weight_gross_reject.Visible = true;
                    //gcol_Weight_gross_reject_date.Visible = true;
                    //gcol_Weight_gross_reject_user.Visible = true;
                    break;
                case TipoProceso.Humedad:
                    gcol_Weight_gross.Visible = false;
                    gcol_Weight_gross_date.Visible = false;
                    gcol_Weight_gross_user.Visible = false;

                    // determinación de humedad
                    gcol_Weight_moisture.OwnerBand.Visible = true;
                    gcol_Weight_moisture.Visible = true;
                    //gcol_Weight_moisture_date.Visible = true;
                    //gcol_Weight_moisture_user.Visible = true;

                    gcol_Weight_dry.Visible = true;
                    //gcol_Weight_dry_date.Visible = true;
                    //gcol_Weight_dry_user.Visible = true;

                    gcol_Percent_moisture.Visible = true;

                    gcol_Moisture_reject.Visible = true;
                    //gcol_Moisture_reject_date.Visible = true;
                    //gcol_Moisture_reject_user.Visible = true;
                    break;
                case TipoProceso.SalidaMuestreria:
                    gcol_Weight_gross.Visible = false;
                    gcol_Weight_gross_date.Visible = false;
                    gcol_Weight_gross_user.Visible = false;

                    // marcar salida de muestra, contramuestra y rechazo
                    gcol_Output_date_sample.OwnerBand.Visible = true;

                    gcol_Output_flag_sample.Visible = true;
                    gcol_Output_flag_cs.Visible = true;
                    gcol_Output_flag_re.Visible = true;
                    gcol_Observation2.Visible = true;

                    //gcol_Output_date_sample.Visible = true; // a ataque
                    //gcol_Output_user_sample.Visible = true; // a ataque
                    //gcol_Output_date_cs.Visible = true;     // contramuestra
                    //gcol_Output_user_cs.Visible = true;     // contramuestra
                    //gcol_Output_date_re.Visible = true;     // rechazo
                    //gcol_Output_user_re.Visible = true;     // rechazo
                    break;
                case TipoProceso.Almacen:
                    gcol_Weight_gross.Visible = false;
                    gcol_Weight_gross_date.Visible = false;
                    gcol_Weight_gross_user.Visible = false;

                    // entrada y salida almacen
                    gcol_Store_input_date_cs.OwnerBand.Visible = true;
                    gcol_Store_input_date_cs.Visible = true;
                    gcol_Store_input_user_cs.Visible = true;

                    gcol_Store_input_date_re.Visible = true;
                    gcol_Store_input_user_re.Visible = true;

                    gcol_Store_output_date_cs.Visible = true;
                    gcol_Store_output_user_cs.Visible = true;

                    gcol_Store_output_date_re.Visible = true;
                    gcol_Store_output_user_re.Visible = true;
                    break;
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Obtener boletos emitidos en el DQB
        /// </summary>
        /// <returns></returns>
        public List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente> ObtenerListaBoletosDQB(TipoProceso tipoProceso)
        {
            var lstBoletoEmitidoDQB = new List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente>();

            string lpseudosEvaluacion = "";

            if (this.tipoProceso == TipoProceso.ANULACION || this.tipoProceso == TipoProceso.AVISO_ANULACION)
            {
                lpseudosEvaluacion = Configuracion.pseudosUnificados;
            }
            else
            {
                lpseudosEvaluacion = Configuracion.pseudosEmpresa;
            }

            var lstReporteVentas = obtenerReporteDQB(lpseudosEvaluacion);

            if (lstReporteVentas != null)
            {
                foreach (var reporteDQB in lstReporteVentas)
                {
                    if (reporteDQB.Boletos != null)
                    {
                        // Solo se filtran los boletos que nacieron VOID, los boletos que están VOID por el usuario NO porque se necesitarán para el reporte de AVISO_VOID_DQB_NO_EN_PTA
                        var lstBoletoReporteVentaDQB = reporteDQB.Boletos.Where(boleto => !boleto.PNR.Equals("NO PNR")).ToList();
                        if (lstBoletoReporteVentaDQB.Any())
                        {
                            // Solo para el caso de DM necesitamos filtrar estos boletos VOID
                            lstBoletoReporteVentaDQB = lstBoletoReporteVentaDQB.Where(boleto => !boleto.Estado.Equals("VOID")).ToList();
                            // Boletos emitidos en el pseudo QQ05
                            if (reporteDQB.Pseudo.Equals(PSEUDO_DM))
                            {
                                if (lstBoletoReporteVentaDQB.Any())
                                {
                                    //Vendedores DM
                                    var vendedoresDM           = objDominio.ObtenerVendedoresPorEmpresa(Configuracion.codigoSeguimiento, Configuracion.firmaBD, Configuracion.EsquemaDB.Destinos);
                                    var vendedoresDM_CounterIA = vendedoresDM.Where(v => ID_DEPARTAMENTO_COUNTER_IA_EN_DM.Equals(v.IdDepartamentoVendedor)).ToList();
                                    // Obtener todos los boletos Emitidos en Destinos Mundiales y filtramos los que no están VOID
                                    var boletosRegistradosPTA_DM      = obtenerBoletoRegistradosPTA(Configuracion.EsquemaDB.Destinos);
                                    var boletosRegistradosPTA_Activos = new List <GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente>();
                                    if (boletosRegistradosPTA_DM != null && boletosRegistradosPTA_DM.Any())
                                    {
                                        boletosRegistradosPTA_Activos = boletosRegistradosPTA_DM.Where(boleto => boleto.MarcaVoid == 0).ToList();
                                    }
                                    //Recorrer todos los boletos emitidos en QQ05
                                    foreach (var boletoEnDQB in lstBoletoReporteVentaDQB)
                                    {
                                        // Todos los boletos Emitidos al DK de Nuevo Mundo en Destinos por qué son doble facturación NM => DM
                                        var boletoEsDobleFacturacion = boletosRegistradosPTA_Activos.Where(boleto => boletoEnDQB.NumBoleto.EndsWith(boleto.NumeroBoleto) && boleto.Cliente.DK == DK_NM_EN_DM).FirstOrDefault() != null;
                                        //vendedoresCounterIA.Where(v => v.IdFirmaVendedor.EndsWith(boleto.Vendedor.FirmaAgente.Substring(1))).ToList().Any())
                                        // Boleto fue emitido por counter IA en DM
                                        var boletoEsEmitidoPorCounterIA = vendedoresDM_CounterIA.Where(v => v.IdFirmaVendedor.Equals(boletoEnDQB.Agente.Substring(1, 2))).ToList().Any();
                                        if (boletoEsDobleFacturacion || boletoEsEmitidoPorCounterIA)
                                        {
                                            var objBoleto = new GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente();
                                            objBoleto.Pseudo         = reporteDQB.Pseudo;
                                            objBoleto.NombrePseudo   = reporteDQB.NombrePseudo;
                                            objBoleto.PrefijoBoleto  = boletoEnDQB.NumBoleto.Substring(0, 3);
                                            objBoleto.Hora           = boletoEnDQB.Hora;
                                            objBoleto.NumeroBoleto   = boletoEnDQB.NumBoleto.Substring(3, 10);
                                            objBoleto.PNR            = boletoEnDQB.PNR;
                                            objBoleto.NombrePasajero = boletoEnDQB.NombrePasajero;
                                            var auxAgente = new GDS_NuevoMundoPersistencia.classDatosAgente();
                                            auxAgente.FirmaAgente     = boletoEnDQB.Agente;
                                            objBoleto.Vendedor        = auxAgente;
                                            objBoleto.Estado          = boletoEnDQB.Estado;
                                            objBoleto.EmisionPseudoNM = boletoEsDobleFacturacion;
                                            lstBoletoEmitidoDQB.Add(objBoleto);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                foreach (var boleto in lstBoletoReporteVentaDQB)
                                {
                                    var objBoleto = new GDS_NuevoMundoPersistencia.robotBoletoPendientePago.robotBoletoPendiente();
                                    objBoleto.Pseudo         = reporteDQB.Pseudo;
                                    objBoleto.NombrePseudo   = reporteDQB.NombrePseudo;
                                    objBoleto.PrefijoBoleto  = boleto.NumBoleto.Substring(0, 3);
                                    objBoleto.Hora           = boleto.Hora;
                                    objBoleto.NumeroBoleto   = boleto.NumBoleto.Substring(3, 10);
                                    objBoleto.PNR            = boleto.PNR;
                                    objBoleto.NombrePasajero = boleto.NombrePasajero;
                                    var auxAgente = new GDS_NuevoMundoPersistencia.classDatosAgente();
                                    auxAgente.FirmaAgente     = boleto.Agente;
                                    objBoleto.Vendedor        = auxAgente;
                                    objBoleto.EmisionPseudoNM = false;
                                    objBoleto.Estado          = boleto.Estado;
                                    lstBoletoEmitidoDQB.Add(objBoleto);
                                }
                            }
                        }
                    }
                }
            }
            return(lstBoletoEmitidoDQB);
        }
Ejemplo n.º 24
0
        private void procesarAmadeus(TipoProceso tipoProceso)
        {
            logger.info("Inicio proceso Amadeus: " + tipoProceso);
            var service = BoletoFactory.getBoletoFactory(tipoProceso, getFechaPorTipoProceso(tipoProceso));
            List <BoletoRobotDTO> lboletosAProcesar = null;

            switch (tipoProceso)
            {
            case TipoProceso.ALMACENAR_BOLETOS_EMITIDOS_AMADEUS:
                service.AlmacenarBoletos();
                enviarLogProceso();
                break;

            case TipoProceso.ANULACION:
                lboletosAProcesar = service.ObtenerBoletosConDeudaPendiente();
                lboletosAProcesar = lboletosAProcesar.Where(boleto => boleto.TotalPendiente >= 20).ToList();
                logger.info(string.Format("Se envía a anular {0} boletos", lboletosAProcesar.Count));
                if (lboletosAProcesar.Any())
                {
                    List <BoletoRobotDTO> boletosResultadoAnulacion = anularBoletos(lboletosAProcesar);
                    if (boletosResultadoAnulacion.Any())
                    {
                        logger.info("Resultado anulacion:");
                        boletosResultadoAnulacion.ForEach(boleto =>
                        {
                            logger.info(string.Format("[ Anulacion ] :: [{0} - {1} - {2}] ::  Total Pendiente:{3} | Emisor: {4} - {5} | DK:{6} | Estado:{7} | Anulado? {8} - Mensaje: {9}",
                                                      boleto.Pseudo, boleto.PNR, boleto.BoletoFull, boleto.TotalPendiente.ToString().PadLeft(8), boleto.Vendedor.Firma, boleto.Vendedor.Id, boleto.IdCliente.ToString().PadLeft(7), boleto.Estado.PadLeft(7), boleto.AnulacionOkPorRobot.ToString().PadLeft(6), boleto.MensajeError));
                        });
                    }
                    new EnvioReportes(tipoProceso, boletosResultadoAnulacion).procesar();
                }
                enviarLogProceso();
                break;

            case TipoProceso.AVISO_ANULACION:
                lboletosAProcesar = service.ObtenerBoletosConDeudaPendiente();
                logger.info(string.Format("Se envía aviso de anulación a {0} boletos", lboletosAProcesar.Count));
                if (lboletosAProcesar.Any())
                {
                    lboletosAProcesar.ForEach(boleto =>
                    {
                        logger.info(string.Format("[ Aviso Anulacion ] :: [{0} - {1} - {2}] ::  Total Pendiente:{3} | Emisor: {4} - {5} | DK:{6}",
                                                  boleto.Pseudo, boleto.PNR, boleto.BoletoFull, boleto.TotalPendiente.ToString().PadLeft(8), boleto.Vendedor.Firma, boleto.Vendedor.Id, boleto.IdCliente.ToString().PadLeft(7)));
                    });
                    new EnvioReportes(tipoProceso, lboletosAProcesar).procesar();
                }
                enviarLogProceso();
                break;

            case TipoProceso.AVISO_NO_EN_PTA:
                lboletosAProcesar = service.ObtenerBoletosNoEncuentranEnPTA();
                logger.info(string.Format("Se envía aviso No En PTA a {0} boletos", lboletosAProcesar.Count));
                if (lboletosAProcesar.Any())
                {
                    new EnvioReportes(tipoProceso, lboletosAProcesar).procesar();
                }
                break;

            case TipoProceso.AVISO_NO_FACTURADOS:
                lboletosAProcesar = service.ObtenerBoletosNoFacturados();
                logger.info(string.Format("Se envía aviso de no facturados a {0} boletos", lboletosAProcesar.Count));
                if (lboletosAProcesar.Any())
                {
                    new EnvioReportes(tipoProceso, lboletosAProcesar).procesar();
                }
                break;
            }
        }
Ejemplo n.º 25
0
 private string getFechaPorTipoProceso(TipoProceso tipoProceso)
 {
     return((tipoProceso == TipoProceso.AVISO_NO_FACTURADOS_AYER) ? DateTime.Today.AddDays(-1).ToShortDateString() : DateTime.Now.ToShortDateString());
 }
Ejemplo n.º 26
0
 public EnvioReportes(TipoProceso tipoProceso, List <BoletoRobotDTO> lboletos)
 {
     this.tipoProceso = tipoProceso;
     this.boletos     = lboletos;
 }
Ejemplo n.º 27
0
        void ShowColumns(TipoProceso tipoProceso)
        {
            // ocultar bandas
            for (int i = 0; i < gvPrepSample.Bands.Count; i++)
            {
                if (gvPrepSample.Bands[i] != gbMuestra)
                {
                    gvPrepSample.Bands[i].Visible = false;
                }
            }

            // ocultar todas las columnas
            for (int i = 0; i < gvPrepSample.Columns.Count; i++)
            {
                gvPrepSample.Columns[i].Visible = false;
            }

            // asignar visibilidad
            gcol_Cod_sample.Visible            = false;
            gcol_Idrecep_sample_detail.Visible = true;
            gcol_Weight_gross.Visible          = true;
            gcol_Weight_gross_date.Visible     = true;
            gcol_Weight_gross_user.Visible     = true;

            switch (tipoProceso)
            {
            case TipoProceso.RecepSample:

                gcol_Flag_humidity_analysis.OwnerBand.Visible = true;

                gcol_Flag_humidity_analysis.Visible = true;
                gcol_Flag_60celsius.Visible         = true;
                gcol_Flag_reject.Visible            = true;
                gcol_Flag_counter_sample.Visible    = true;
                gcol_Observation1.Visible           = true;

                //gcol_Input_sample_date.Visible = true;
                //gcol_Input_sample_user.Visible = true;
                break;

            case TipoProceso.PesarRechazos:
                // peso de rechazo para almacenamiento
                gcol_Weight_gross.Visible      = false;
                gcol_Weight_gross_date.Visible = false;
                gcol_Weight_gross_user.Visible = false;

                gcol_Weight_gross_reject.OwnerBand.Visible = true;
                gcol_Weight_gross_reject.Visible           = true;
                //gcol_Weight_gross_reject_date.Visible = true;
                //gcol_Weight_gross_reject_user.Visible = true;
                break;

            case TipoProceso.Humedad:
                gcol_Weight_gross.Visible      = false;
                gcol_Weight_gross_date.Visible = false;
                gcol_Weight_gross_user.Visible = false;

                // determinación de humedad
                gcol_Weight_moisture.OwnerBand.Visible = true;
                gcol_Weight_moisture.Visible           = true;
                //gcol_Weight_moisture_date.Visible = true;
                //gcol_Weight_moisture_user.Visible = true;

                gcol_Weight_dry.Visible = true;
                //gcol_Weight_dry_date.Visible = true;
                //gcol_Weight_dry_user.Visible = true;

                gcol_Percent_moisture.Visible = true;

                gcol_Moisture_reject.Visible = true;
                //gcol_Moisture_reject_date.Visible = true;
                //gcol_Moisture_reject_user.Visible = true;
                break;

            case TipoProceso.SalidaMuestreria:
                gcol_Weight_gross.Visible      = false;
                gcol_Weight_gross_date.Visible = false;
                gcol_Weight_gross_user.Visible = false;

                // marcar salida de muestra, contramuestra y rechazo
                gcol_Output_date_sample.OwnerBand.Visible = true;

                gcol_Output_flag_sample.Visible = true;
                gcol_Output_flag_cs.Visible     = true;
                gcol_Output_flag_re.Visible     = true;
                gcol_Observation2.Visible       = true;

                //gcol_Output_date_sample.Visible = true; // a ataque
                //gcol_Output_user_sample.Visible = true; // a ataque
                //gcol_Output_date_cs.Visible = true;     // contramuestra
                //gcol_Output_user_cs.Visible = true;     // contramuestra
                //gcol_Output_date_re.Visible = true;     // rechazo
                //gcol_Output_user_re.Visible = true;     // rechazo
                break;

            case TipoProceso.Almacen:
                gcol_Weight_gross.Visible      = false;
                gcol_Weight_gross_date.Visible = false;
                gcol_Weight_gross_user.Visible = false;

                // entrada y salida almacen
                gcol_Store_input_date_cs.OwnerBand.Visible = true;
                gcol_Store_input_date_cs.Visible           = true;
                gcol_Store_input_user_cs.Visible           = true;

                gcol_Store_input_date_re.Visible = true;
                gcol_Store_input_user_re.Visible = true;

                gcol_Store_output_date_cs.Visible = true;
                gcol_Store_output_user_cs.Visible = true;

                gcol_Store_output_date_re.Visible = true;
                gcol_Store_output_user_re.Visible = true;
                break;
            }
        }
Ejemplo n.º 28
0
 private void btnPVisualizar_Click(object sender, EventArgs e)
 {
     tipoProceso = TipoProceso.Visualizacion;
     ProcesarP();
 }
Ejemplo n.º 29
0
        public void procesar(TipoProceso tipoProceso)
        {
            logger.info(string.Format("Ejecutando proceso: {0} ", tipoProceso));
            var          utilSession = new UtilSession();
            classSession session     = null;
            string       cuerpoSMS   = "";

            try
            {
                var fecha = getFechaPorTipoProceso(tipoProceso);

                // Crea una instancia de Service Boleto con la configuración según el proceso
                var service = new ServiceBoleto(tipoProceso, fecha);

                // Obtener todos los boletos Emitidos en el DQB
                var boletosEmitidosDQB = service.ObtenerListaBoletosDQB(tipoProceso);

                // Filtra los boletos que no se encuentren VOID
                var boletosAProcesar = boletosEmitidosDQB.Where(boleto => !boleto.Estado.Equals("VOID")).ToList();

                // Obtener todos los boletos Registrados en el PTA
                var boletosRegistradosPTA = service.obtenerBoletoRegistradosPTA(Configuracion.EsquemaDB.Actual);

                // Consolida los boletos en DQB Activos con los boletos en PTA
                var boletosConsolidados = service.consolidarBoletos(boletosAProcesar, boletosRegistradosPTA);

                session = utilSession.getSession();

                // Crea una instancia del Gestor e inyectar session
                GestorProceso gestorProceso = new GestorProceso(session);

                if (boletosConsolidados.Any())
                {
                    if (tipoProceso == TipoProceso.AVISO_NO_FACTURADOS || tipoProceso == TipoProceso.AVISO_NO_FACTURADOS_AYER)
                    {
                        gestorProceso.ejecutarProceso(new ProcesoAvisoNoFacturado(), boletosConsolidados, fecha);
                        gestorProceso.ejecutarProceso(new ProcesoAvisoNoEnPTA(), boletosConsolidados, fecha);
                    }
                    else if (tipoProceso == TipoProceso.AVISO_ANULACION)
                    {
                        gestorProceso.ejecutarProceso(new ProcesoAvisoAnulacion(), boletosConsolidados);
                    }
                    else if (tipoProceso == TipoProceso.ANULACION && "NM".Equals(Configuracion.empresa))
                    {
                        gestorProceso.ejecutarProceso(new ProcesoAnulacion(), boletosConsolidados);
                    }
                    else if (tipoProceso == TipoProceso.AVISO_VOID_DQB_NO_EN_PTA)
                    {
                        boletosAProcesar = boletosEmitidosDQB.Where(boleto => boleto.Estado.Equals("VOID")).ToList();
                        if (boletosAProcesar.Any())
                        {
                        }
                    }
                }
                cuerpoSMS = string.Format("{0} - {1} - Se ejecuto correctamente el proceso {2} del Robot de Anulaciones", Configuracion.Gds, Configuracion.empresa, tipoProceso);
            }
            catch (Exception ex)
            {
                cuerpoSMS = string.Format("{0} - {1} - Ocurrió un error en el proceso {2} del Robot de Anulaciones, Por favor revisar su mail para más detalles.", Configuracion.Gds, Configuracion.empresa, tipoProceso);
                MailUtils.getInstance().sendMailError(ex, tipoProceso);
                logger.info(string.Format("Ocurrió un error inesperado: {0}", ex.ToString()));
            }
            finally
            {
                utilSession.closeSession(session);
                if (tipoProceso == TipoProceso.AVISO_ANULACION || tipoProceso == TipoProceso.ANULACION)
                {
                    new Utilitario().envioSMS(cuerpoSMS, "ROBOT_AVISO_SABRE", Configuracion.contactosEnvioSMS);
                }
            }
        }
Ejemplo n.º 30
0
 private void btnExportarRExcel_Click(object sender, EventArgs e)
 {
     Archivo     = string.Empty;
     tipoProceso = TipoProceso.Extraccion;
     ProcesarDT();
 }