Exemplo n.º 1
0
        public void Inicio(DateTime fecinicio)
        {
            string titulo = "                       PLANILLAS PENDIENTES POR ENVIAR A BAVARIA\r\n" + "                            ========== == ==========\r\n";

            console = new Consola(titulo);
            //LLogReporteBavaria = new List<LogReporteBavaria>(ICLogReporteBavaria);
            if (LLogReporteBavaria.Count > 0)
            {
                detLogBavarias = new List <DetLogBavaria>();
                foreach (var item in LLogReporteBavaria)
                {
                    adicionarRegistroLogReporteBavaria(item);
                    console.Clear();
                    console.Ih(pp());
                }
            }
            if (detLogBavarias.Count > 0)
            {
                foreach (var item in detLogBavarias)
                {
                    escribirRegistro(item);
                    console.Clear();
                    console.Ih(pp());
                }
            }
        }
Exemplo n.º 2
0
        public void Inicio(DateTime fecini)
        {
            int Total      = ICLogReporteDian.Count;
            int Procesadas = 0;

            if (ICLogReporteDian.Count > 0)
            {
                foreach (var p in ICLogReporteDian)
                {
                    console.CBlack();
                    console.Clear();
                    console.Ih("Facturas a procesar : " + Total + ". Procesadas : " + Procesadas + ". Pendientes : " + (Total - Procesadas).ToString() + "\r\n");
                    procesarFactura(p);
                    Procesadas++;
                    console.Clear();
                }
            }
            else
            {
                addLog("if (ICLogReporteDian.Count > 0) NO HAY REGISTROS PARA PROCESAR....");
            }
        }
Exemplo n.º 3
0
        public void Inicio(DateTime fecini)
        {
            int Total      = ICLogReporteBavaria.Count;
            int Procesadas = 0;

            if (ICLogReporteBavaria.Count > 0)
            {
                foreach (var p in ICLogReporteBavaria)
                {
                    console.CBlack();
                    console.Clear();
                    console.Ih("Planilla a procesar : " + Total + ". Procesadas : " + Procesadas + ". Pendientes : " + (Total - Procesadas).ToString() + "\r\n");
                    console.Ih("Info Planilla : " + p.REBA_LLAVE_V2 + "  Fecha Planilla : " + p.REBA_FECHA_DT + "\r\n");
                    procesarDespacho(p);
                    Procesadas++;
                    console.Clear();
                }
            }
            else
            {
                addLog("if (ICLogReporteDian.Count > 0) NO HAY REGISTROS PARA PROCESAR....");
            }
        }
Exemplo n.º 4
0
        private void analizarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Consola.Clear();
            try
            {
                bool resultado = instancia.analizar();

                if (resultado)
                {
                    Console.WriteLine("Cadena Correcta.\n\n");


                    List <String> errseman = new List <string>();
                    errseman = Analizador.Acciones.ErroresSemanticos;
                    for (int i = 0; i < errseman.Count; i++)
                    {
                        Consola.AppendText(errseman[i] + "\n");
                    }
                }

                else
                {
                    Console.WriteLine("Cadena Incorrecta.\n\n");

                    List <String> errosintac = new List <string>();
                    errosintac = Analizador.Analizar.erroressintacticos;
                    for (int i = 0; i < errosintac.Count; i++)
                    {
                        string remplaz0 = errosintac[i].Replace("expected", "Se esperaba");
                        errosintac[i] = remplaz0;
                        string remplaz1 = errosintac[i].Replace(",,", " ");
                        errosintac[i] = remplaz1;
                        Consola.AppendText(errosintac[i] + "\n");
                    }

                    List <String> errolexic = new List <string>();
                    errolexic = Analizador.Analizar.erroreslexicos;
                    for (int i = 0; i < errolexic.Count; i++)
                    {
                        Consola.AppendText(errolexic[i] + "\n");
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Porfavor Agregue un texto de trabajo.");
            }
        }
Exemplo n.º 5
0
        private void LoadICLogReporteBavaria()
        {
            string mensaje = "                            MINISTERIO DE TRANSPORTE\r\n";

            mensaje += "                            ========== == ==========\r\n\r\n";
            string[] _nParametros;
            object[] _vParametros;
            _nParametros = new string[1] {
                ":LRMI_ESTADO"
            };
            _vParametros = new object[1] {
                "P"
            };
            Factory data = new Factory(Usuario, Password, Ambiente);

            try
            {
                mensaje += "Recuperando registros a Procesar . . .";
                console.Ih(mensaje);
                //var dt = data.getTable("getInfoLogReporteBavaria", _nParametros, _vParametros);
                var dt = data.getTable("getInfoLogReporteBavaria");
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        console.Clear();
                        console.Ih(pp());
                        ICLogReporteBavaria.Add(addLogReporteBavaria(item));
                    }
                }
            }
            catch (Exception ex)
            {
                ManejoError(ex, "var dtLogReporteMinisterio = data.getTable(\"getLogReporteMinisterio\", _nParametros, _vParametros);");
            }
        }
Exemplo n.º 6
0
    public void Save()
    {
        string          dataPath        = Path.Combine(Application.streamingAssetsPath, "save.sv");
        BinaryFormatter binaryFormatter = new BinaryFormatter();

        FileStream stream = File.Open(dataPath, FileMode.OpenOrCreate);

        SaveData save = new SaveData();

        for (int i = 0; i < mg.anchorablePrefs.Count; i++)
        {
            ClaseSav clase = new ClaseSav();
            clase.nombre = mg.anchorablePrefs[i].nombre;
            clase.color  = new float[] { mg.anchorablePrefs[i].Material.color.r, mg.anchorablePrefs[i].Material.color.g, mg.anchorablePrefs[i].Material.color.b };
            for (int j = 0; j < mg.anchorablePrefs[i].variablesInt.Count; j++)
            {
                AtributoSav atributo = new AtributoSav();
                atributo.nombre     = mg.anchorablePrefs[i].variablesInt[j].nombre;
                atributo.tipo       = "int";
                atributo.proteccion = mg.anchorablePrefs[i].variablesInt[j].proteccion.ToString();
                clase.atributos.Add(atributo);
            }
            for (int j = 0; j < mg.anchorablePrefs[i].variablesFloat.Count; j++)
            {
                AtributoSav atributo = new AtributoSav();
                atributo.nombre     = mg.anchorablePrefs[i].variablesFloat[j].nombre;
                atributo.tipo       = "float";
                atributo.proteccion = mg.anchorablePrefs[i].variablesFloat[j].proteccion.ToString();
                clase.atributos.Add(atributo);
            }
            for (int j = 0; j < mg.anchorablePrefs[i].variablesBool.Count; j++)
            {
                AtributoSav atributo = new AtributoSav();
                atributo.nombre     = mg.anchorablePrefs[i].variablesBool[j].nombre;
                atributo.tipo       = "bool";
                atributo.proteccion = mg.anchorablePrefs[i].variablesBool[j].proteccion.ToString();
                clase.atributos.Add(atributo);
            }
            for (int j = 0; j < mg.anchorablePrefs[i].metodos.Count; j++)
            {
                MetodoSav metodo = new MetodoSav();
                metodo.nombre = mg.anchorablePrefs[i].metodos[j].nombre;
                clase.metodos.Add(metodo);
            }
            save.clases.Add(clase);
        }

        for (int i = 0; i < mg.variables.Count; i++)
        {
            VariableSav variable = new VariableSav();
            variable.clase  = mg.variables[i].clase;
            variable.nombre = mg.variables[i].nombre;
            variable.color  = new float[] { mg.variables[i].ColorVariable.color.r, mg.variables[i].ColorVariable.color.g, mg.variables[i].ColorVariable.color.b };
            save.variables.Add(variable);
        }

        for (int i = 0; i < mg.objects.Count; i++)
        {
            int  x     = 0;
            bool found = false;
            for (int j = 0; j < mg.anchorablePrefs.Count && !found; j++)
            {
                if (mg.objects[i].nombre == mg.anchorablePrefs[j].nombre)
                {
                    found = true;
                }
                else
                {
                    x++;
                }
            }
            save.objetos.Add(x);
        }

        for (int i = 0; i < mg.variables.Count; i++)
        {
            int index = mg.objects.IndexOf(mg.objects.FirstOrDefault(x => mg.variables[i].objetoReferenciado == x));
            save.referencias.Add(index);
        }

        for (int i = 0; i < c.lineas.Count; i++)
        {
            save.consola.Add(c.lineas[i]);
        }

        binaryFormatter.Serialize(stream, save);
        stream.Close();

        ini.GetButton("Cargar").Blocked = false;

        c.Clear();
        mg.RemoveAllObjects();
        mg.RemoveAllVariables();
        mg.RemoveClases();
        mc.NumberClases    = 0;
        mc.NumberObjetos   = 0;
        mc.NumberVariables = 0;
        colors.Clear();
    }
Exemplo n.º 7
0
        public void Inicio(DateTime fecini)
        {
            int Total      = ICLogReporteDian.Count;
            int Procesadas = 0;

            if (ICLogReporteDian.Count > 0)
            {
                foreach (var p in ICLogReporteDian)
                {
                    console.CBlack();
                    console.Clear();
                    console.Ih("   APLICATIVO FACTURACION ELECTRONICA CON VALIDACION PREVIA  ver 1.0.2", false);
                    console.Ih("   ========== =========== =========== === ========== ======  *** * * *", false);
                    console.Ihe("Facturas a procesar : " + Total + ". Procesadas : " + Procesadas + ". Pendientes : " + (Total - Procesadas).ToString() + "\r\n");
                    ICollection <InformacionDian> ICInformacionDianpROCESO = new List <InformacionDian>();
                    ICInformacionDianpROCESO = LeerInformacionDian(p.LODI_LLAVE_V2);
                    if (ICInformacionDianpROCESO.Count > 0)
                    {
                        string mensaje = string.Empty;
                        foreach (var item in ICInformacionDianpROCESO)
                        {
                            if (item.INDI_CUFEDIAN_V2 == "EN PROCESO")
                            {
                                mensaje  = string.Empty;
                                mensaje += "La Factura " + item.INDI_NUMDOC_V2 + " se encuentra en proceso...!!\r\n";
                                mensaje += "\r\n      ==> Informacion de la factura < == \r\n";
                                mensaje += "\r\n Fecha  : " + item.INDI_FECCREA_TS;
                                mensaje += "\r\n Correo : " + item.INDI_EMAIL_V2;
                                mensaje += "\r\n Id     : " + item.INDI_IDCARVAJAL_V2;
                                mensaje += "\r\n Valida : " + item.INDI_VALIDACION_CL;
                                console.Ih(mensaje);
                                SendEmail("Factura en Proceso", mensaje, "*****@*****.**", "*****@*****.**", "*****@*****.**");
                                //if (p.LODI_LLAVE_V2=="ETCA10039")
                                //{
                                //procesarFactura(p);
                                //}
                                ILogicaInfoFactura Lif  = new LogicaInfoFactura(Usuario, Password, UsuEmail, PassEmail, Ambiente);
                                string             cufe = string.Empty;
                                cufe = Lif.Inicio(p.LODI_LLAVE_V2);
                                break;
                            }
                            else
                            {
                                procesarFactura(p);
                            }
                        }
                    }
                    else
                    {
                        procesarFactura(p);
                    }
                    Procesadas++;
                    console.Clear();
                }
            }
            else
            {
                //addLog("NO HAY REGISTROS PARA PROCESAR....");
                System.Threading.Thread.Sleep(2000);
            }
        }