Exemplo n.º 1
0
 public ArrayList execute( )
 {
     if (GeneXus.Configuration.Config.ConfigFileName.Length == 0)
     {
         GeneXus.Configuration.Config.ConfigFileName = "client.exe.config";
     }
     try
     {
         new reorg().execute();
         GXReorganization.NotifyEnd();
     }
     catch (Exception ex)
     {
         if (IsBadImageFormatException(ex))
         {
             throw ex;
         }
         else
         {
             GXReorganization.NotifyError();
             GeneXus.Reorg.GXReorganization.AddMsg(ex.Message, null);
         }
     }
     return(GXReorganization.ReorgLog);
 }
Exemplo n.º 2
0
        private void execute(int cursor, Object[] parms, bool batch)
        {
            ICursor oCur = getCursor(cursor);

            if (GxContext.isReorganization && oCur is ForEachCursor && GXReorganization.ExecutedBefore(oCur.Id))
            {
                return;
            }
            if (!batch)
            {
                oCur.createCursor(_ds, _errorHandler);
            }
            short[] parmHasValue = oCur.preExecute(cursor, this, _ds);
            if (Preferences.Instrumented && wmiDataStoreProvider != null)
            {
                wmiDataStoreProvider.IncSentencesCount(oCur);
                wmiDataStoreProvider.BeginExecute(oCur, _ds.Connection);
            }
            try
            {
                if (!batch)
                {
                    try
                    {
                        if (parmHasValue != null)
                        {
                            Object[] parmsNew = new Object[parms.Length + parmHasValue.Length];
                            parmHasValue.CopyTo(parmsNew, 0);
                            parms.CopyTo(parmsNew, parmHasValue.Length);
                            _dataStoreHelper.setParameters(cursor, oCur.getFieldSetter(), parmsNew);
                        }
                        else
                        {
                            _dataStoreHelper.setParameters(cursor, oCur.getFieldSetter(), parms);
                        }
                    }
                    catch (Exception ex)
                    {
                        _ds.CloseConnections();
                        throw ex;
                    }
                }

                GXLogging.Debug(log, "gxObject:" + _dataStoreHelper.GetType() + ", handle '" + _ds.Handle + "' cursorName:" + oCur.Id);
                oCur.execute();
            }finally
            {
                oCur.getFieldSetter().RestoreParametersRT();
            }
            _dataStoreHelper.getResults(cursor, oCur.getFieldGetter(), results[cursor]);

            _dynConstraints = null;

            if (Preferences.Instrumented)
            {
                wmiDataStoreProvider.EndExecute(oCur, _ds.Connection);
            }
            dataStoreRequestCount++;
        }
Exemplo n.º 3
0
        private void btnExecute_Click(object sender, System.EventArgs e)
        {
            if (ReorgStartup.reorgPending())
            {
                btnExecute.Enabled                    = false;
                GXReorganization._ReorgReader         = this;
                GXReorganization.ignoreResume         = ReorgStartup.ignoreresume;
                GXReorganization.noPreCheck           = ReorgStartup.noprecheck;
                GXReorganization.printOnlyRecordCount = ReorgStartup.onlyRecordCount;
                if (ReorgStartup.gxReorganization.GetCreateDataBase())
                {
                    GXReorganization.SetCreateDataBase();
                }

                //
                // Start the thread
                //
                try
                {
                    if (ReorgStartup.gxReorganization.BeginResume())
                    {
                        m_oThread        = new Thread(new ThreadStart(ReorgStartup.gxReorganization.ExecForm));
                        reorgRunning     = true;
                        btnClose.Enabled = false;

                        lblStatus.Text = GXResourceManager.GetMessage("GXM_ids_run");
                        m_oThread.Start();
                        timer1.Enabled = true;
                    }
                    else
                    {
                        throw new Exception();
                    }
                }
                catch (Exception)
                {
                    imgCancel.Visible      = true;
                    imgOk.Visible          = false;
                    imgEqual.Visible       = false;
                    imgReorg.Visible       = false;
                    reorgRunning           = false;
                    btnClose.Enabled       = true;
                    lblStatus.Text         = GXResourceManager.GetMessage("GXM_ids_failed");
                    ReorgStartup.errorCode = -1;
                    return;
                }
                imgCancel.Visible  = false;
                imgOk.Visible      = false;
                imgEqual.Visible   = false;
                imgReorg.Visible   = false;
                btnExecute.Enabled = false;
            }
            else
            {
                MessageBox.Show(GXResourceManager.GetMessage("GXM_ids_noneeded"), "GeneXus.NET");
                Close();
            }
        }
Exemplo n.º 4
0
 private void SetPrecedenceris( )
 {
     GXReorganization.SetMsg(12, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[ITANQUEROESCLUSASRANGO1]" }));
     ReorgExecute.RegisterPrecedence("RITanqueroEsclusasRangoTanqueroEsclusas", "CreateTanqueroEsclusasRango");
     ReorgExecute.RegisterPrecedence("RITanqueroEsclusasRangoTanqueroEsclusas", "CreateTanqueroEsclusas");
     GXReorganization.SetMsg(13, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IPORTACONTENEDORESRANGO1]" }));
     ReorgExecute.RegisterPrecedence("RIPortaContenedoresRangoPortaContenedores", "CreatePortaContenedoresRango");
     ReorgExecute.RegisterPrecedence("RIPortaContenedoresRangoPortaContenedores", "CreatePortaContenedores");
 }
Exemplo n.º 5
0
 private void SetPrecedenceris( )
 {
     GXReorganization.SetMsg(2, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IALQUILER1]" }));
     ReorgExecute.RegisterPrecedence("RIAlquilerPropiedad", "ReorganizePropiedad");
     GXReorganization.SetMsg(3, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IVISITASVISITAPRO2]" }));
     GXReorganization.SetMsg(4, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IVISITASVISITAPRO1]" }));
     ReorgExecute.RegisterPrecedence("RIVisitasVisitaProPropiedad", "ReorganizePropiedad");
     GXReorganization.SetMsg(5, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IPROPIEDAD1]" }));
     ReorgExecute.RegisterPrecedence("RIPropiedadBarrio", "ReorganizePropiedad");
 }
Exemplo n.º 6
0
        public int getStatus(int cursorIdx)
        {
            ICursor cursor = getCursor(cursorIdx);

            if (GxContext.isReorganization && cursor is ForEachCursor && GXReorganization.ExecutedBefore(cursor.Id))
            {
                return(Cursor.EOF);
            }
            else
            {
                return(cursor.getStatus());
            }
        }
Exemplo n.º 7
0
        private static GXReorganization GetReorgProgram()
        {
            GXReorganization rg = null;

            try
            {
                string ns;
                string assmblyName;
                string nme;
                if (Config.GetValueOf("ReorgAssemblyName", out nme))
                {
                    assmblyName = nme;
                }
                else
                {
                    assmblyName = "";
                }

                if (Config.GetValueOf("AppMainNamespace", out nme))
                {
                    ns = nme;
                }
                else
                {
                    ns = "GeneXus.Programs";
                }
                if (assmblyName.Length == 0)
                {
                    rg = (GXReorganization)GeneXus.Metadata.ClassLoader.GetInstance("Reorganization", ns + ".reorganization", null);
                }
                else
                {
                    rg = (GXReorganization)GeneXus.Metadata.ClassLoader.GetInstance(assmblyName, ns + ".reorganization", null);
                }
            }
            catch (Exception ex)
            {
                if (GXUtil.IsBadImageFormatException(ex))
                {
                    throw ex;
                }
                else
                {
                    rg = (GXReorganization)GeneXus.Metadata.ClassLoader.GetInstance("Reorganization", "GeneXus.Programs.reorganization", null);
                }
            }
            return(rg);
        }
Exemplo n.º 8
0
 private void SetPrecedencetables( )
 {
     GXReorganization.SetMsg(1, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "PASAJEROS", "" }));
     GXReorganization.SetMsg(2, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "TarifasGranelesSecos", "" }));
     GXReorganization.SetMsg(3, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "REF_CGRAL_DESP", "" }));
     GXReorganization.SetMsg(4, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "VEH_RORO", "" }));
     GXReorganization.SetMsg(5, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "PortaContenedoresRango", "" }));
     ReorgExecute.RegisterPrecedence("CreatePortaContenedoresRango", "CreatePortaContenedores");
     GXReorganization.SetMsg(6, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "PortaContenedores", "" }));
     GXReorganization.SetMsg(7, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "LNG", "" }));
     GXReorganization.SetMsg(8, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "LPG", "" }));
     GXReorganization.SetMsg(9, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "Quimiqueros", "" }));
     GXReorganization.SetMsg(10, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "TanqueroEsclusasRango", "" }));
     ReorgExecute.RegisterPrecedence("CreateTanqueroEsclusasRango", "CreateTanqueroEsclusas");
     GXReorganization.SetMsg(11, GXResourceManager.GetMessage("GXM_filecrea", new   object[]  { "TanqueroEsclusas", "" }));
 }
Exemplo n.º 9
0
        public int close(int cursor)
        {
            int           result = 0;
            ICursor       oCur   = getCursor(cursor);
            ForEachCursor fc     = oCur as ForEachCursor;

            if (GxContext.isReorganization && fc != null && GXReorganization.ExecutedBefore(oCur.Id))
            {
                return(result);
            }
            else
            {
                dataStoreRequestCount++;
                result = oCur.close();
                if (GxContext.isReorganization && fc != null)
                {
                    GXReorganization.AddExecutedStatement(oCur.Id);
                }
                return(result);
            }
        }
Exemplo n.º 10
0
 public static void EndReorg()
 {
     if (File.Exists(REORG_FILE_1))
     {
         File.Delete(REORG_FILE_1);
     }
     if (File.Exists(REORG_FILE_2))
     {
         File.Delete(REORG_FILE_2);
     }
     if (File.Exists(REORG_FILE_3))
     {
         File.Delete(REORG_FILE_3);
     }
     if (File.Exists(REORG_FILE_4))
     {
         File.Delete(REORG_FILE_4);
     }
     if (GXReorganization.printOnlyRecordCount)
     {
         GXReorganization.DeleteResumeFile();
     }
 }
Exemplo n.º 11
0
 private void SetPrecedencetables( )
 {
     GXReorganization.SetMsg(1, GXResourceManager.GetMessage("GXM_fileupdate", new   object[]  { "Pedido", "" }));
 }
Exemplo n.º 12
0
 private void SetPrecedenceris( )
 {
     GXReorganization.SetMsg(2, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IFACTURA1]" }));
     ReorgExecute.RegisterPrecedence("RIFacturaCliente", "ReorganizeCliente");
 }
Exemplo n.º 13
0
        public static int Main(string[] args)
        {
#if NETCORE
            var configFilePath = Path.Combine(FileUtil.GetStartupDirectory(), CLIENT_EXE_CONFIG);
            if (File.Exists(configFilePath))
            {
                GeneXus.Configuration.Config.ConfigFileName = configFilePath;
            }
#else
            string parentConfigFile = Path.Combine("..", CLIENT_EXE_CONFIG);
            if (File.Exists(CLIENT_EXE_CONFIG))
            {
                GeneXus.Configuration.Config.ConfigFileName = CLIENT_EXE_CONFIG;
            }
            else if (File.Exists(parentConfigFile))
            {
                GeneXus.Configuration.Config.ConfigFileName = parentConfigFile;
            }
            else
            {
                string configPath = Path.Combine(GxContext.StaticPhysicalPath(), CLIENT_EXE_CONFIG);
                if (File.Exists(configPath))
                {
                    GeneXus.Configuration.Config.ConfigFileName = configPath;
                }
            }
            bool nogui = false;
#endif
            bool notexecute = false;
            foreach (string sw in args)
            {
                if (sw.ToLower().StartsWith("\\config:") || sw.ToLower().StartsWith("-config:"))
                {
                    string configFile = sw.Substring(8);
                    GeneXus.Configuration.Config.ConfigFileName = configFile;
                    REORG_FILE_3 = Path.Combine(Path.GetDirectoryName(configFile), REORGPGM_GEN);
                }
#if !NETCORE
                else if (sw.ToLower().Trim() == "-nogui")
                {
                    nogui = true;
                }
#endif
                else if (sw.ToLower().Trim() == "-force")
                {
                    force = true;
                }
                else if (sw.ToLower().Trim() == "-recordcount")
                {
                    onlyRecordCount = true;
                }
                else if (sw.ToLower().Trim() == "-ignoreresume")
                {
                    ignoreresume = true;
                }
                else if (sw.ToLower().Trim() == "-noverifydatabaseschema")
                {
                    noprecheck = true;
                }
                else if (sw.ToLower().Trim() == "-donotexecute")
                {
                    notexecute = true;
                }
            }

            if (notexecute)
            {
                SetStatus(GXResourceManager.GetMessage("GXM_dbnotreorg"));
                errorCode = 0;
            }
            else
            {
                try
                {
                    GxContext.isReorganization = true;
                    gxReorganization           = GetReorgProgram();
#if !NETCORE
                    if (nogui)
                    {
                        try
                        {
                            Console.OutputEncoding = Encoding.Default;
                        }
                        catch (IOException)                         //Docker: System.IO.IOException: The parameter is incorrect.
                        {
                            try
                            {
                                Console.OutputEncoding = Encoding.UTF8;
                            }
                            catch (IOException)
                            {
                            }
                        }
#endif
                    GXReorganization._ReorgReader         = new NoGuiReorg();
                    GXReorganization.printOnlyRecordCount = onlyRecordCount;
                    GXReorganization.ignoreResume         = ignoreresume;
                    GXReorganization.noPreCheck           = noprecheck;
                    if (gxReorganization.GetCreateDataBase())
                    {
                        GXReorganization.SetCreateDataBase();
                    }

                    if (ReorgStartup.reorgPending())
                    {
                        if (gxReorganization.BeginResume())
                        {
                            gxReorganization.ExecForm();
                        }
                        if (GXReorganization.Error)
                        {
                            SetStatus(GXResourceManager.GetMessage("GXM_reorgnotsuccess"));
                            if (GXReorganization.ReorgLog != null && GXReorganization.ReorgLog.Count > 0)
                            {
                                SetStatus((string)GXReorganization.ReorgLog[GXReorganization.ReorgLog.Count - 1]);
                            }
                            errorCode = -1;
                        }
                        else
                        {
                            SetStatus(GXResourceManager.GetMessage("GXM_reorgsuccess"));
                            errorCode = 0;
                        }
                    }
                    else
                    {
                        SetStatus(GXResourceManager.GetMessage("GXM_ids_noneeded"));
                        errorCode = 0;
                    }
#if !NETCORE
                }
                else
                {
                    FreeConsole();
                    System.Windows.Forms.Application.Run(new GuiReorg());
                }
#endif
                }
                catch (Exception ex)
                {
#if !NETCORE
                    if (GXUtil.IsBadImageFormatException(ex) && !GXUtil.ExecutingRunX86())
                    {
                        GXReorganization.CloseResumeFile();
                        int exitCode;
                        if (GXUtil.RunAsX86(GXUtil.REOR, args, DataReceived, out exitCode))
                        {
                            return(exitCode);
                        }
                        else
                        {
                            SetStatus(GXResourceManager.GetMessage("GXM_reorgnotsuccess"));
                            SetStatus(GXResourceManager.GetMessage("GXM_callerr", GXUtil.RUN_X86));
                            errorCode = -1;
                        }
                    }
                    else
#endif
                    {
                        SetStatus(GXResourceManager.GetMessage("GXM_reorgnotsuccess"));
                        SetStatus(ex.Message);

                        errorCode = -1;
                    }
                }
            }
            return(errorCode);
        }
Exemplo n.º 14
0
 private void SetPrecedenceris( )
 {
     GXReorganization.SetMsg(2, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IBR_FAMILYHISTORY1]" }));
     ReorgExecute.RegisterPrecedence("RIBR_FamilyhistoryBR_Encounter", "ReorganizeBR_Familyhistory");
 }