Exemplo n.º 1
0
 private bool PreviousCheck( )
 {
     if (!IsResumeMode( ))
     {
         if (GXUtil.DbmsVersion(context, "DEFAULT") < 9)
         {
             SetCheckError(GXResourceManager.GetMessage("GXM_bad_DBMS_version", new   object[]  { "2005" }));
             return(false);
         }
     }
     if (!MustRunCheck( ))
     {
         return(true);
     }
     if (GXUtil.IsSQLSERVER2005(context, "DEFAULT"))
     {
         /* Using cursor P00023 */
         pr_default.execute(1);
         while ((pr_default.getStatus(1) != 101))
         {
             sSchemaVar  = P00023_AsSchemaVar[0];
             nsSchemaVar = P00023_nsSchemaVar[0];
             pr_default.readNext(1);
         }
         pr_default.close(1);
     }
     else
     {
         /* Using cursor P00034 */
         pr_default.execute(2);
         while ((pr_default.getStatus(2) != 101))
         {
             sSchemaVar  = P00034_AsSchemaVar[0];
             nsSchemaVar = P00034_nsSchemaVar[0];
             pr_default.readNext(2);
         }
         pr_default.close(2);
     }
     return(true);
 }
Exemplo n.º 2
0
 private void EnableButtons()
 {
     if (!ReorgStartup.reorgPending())
     {
         btnExecute.Enabled = false;
         btnClose.Enabled   = true;
         lblStatus.Text     = GXResourceManager.GetMessage("GXM_ids_noneeded");
         imgCancel.Visible  = false;
         imgOk.Visible      = false;
         imgEqual.Visible   = true;
         imgReorg.Visible   = false;
     }
     else
     {
         btnExecute.Enabled = true;
         imgCancel.Visible  = false;
         imgOk.Visible      = false;
         imgEqual.Visible   = false;
         imgReorg.Visible   = true;;
         lblStatus.Text     = GXResourceManager.GetMessage("GXM_ids_needed");
     }
 }
Exemplo n.º 3
0
 private void SetPrecedencetables( )
 {
     GXReorganization.SetMsg(1, GXResourceManager.GetMessage("GXM_fileupdate", new   object[]  { "Pedido", "" }));
 }
Exemplo n.º 4
0
 private void SetPrecedenceris( )
 {
     GXReorganization.SetMsg(2, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IFACTURA1]" }));
     ReorgExecute.RegisterPrecedence("RIFacturaCliente", "ReorganizeCliente");
 }
Exemplo n.º 5
0
 private void CreateDataBase( )
 {
     DS           = (GxDataStore)(context.GetDataStore("Default"));
     ErrCode      = DS.Connection.FullConnect();
     DataBaseName = DS.Connection.Database;
     if (ErrCode != 0)
     {
         DS.Connection.Database = "";
         ErrCode = DS.Connection.FullConnect();
         if (ErrCode == 0)
         {
             try
             {
                 GeneXus.Reorg.GXReorganization.AddMsg(GXResourceManager.GetMessage("GXM_dbcrea") + " " + DataBaseName, null);
                 cmdBuffer     = "CREATE DATABASE " + "[" + DataBaseName + "]";
                 RGZ           = new GxCommand(dsDefault.Db, cmdBuffer, dsDefault, 0, true, false, null);
                 RGZ.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
                 RGZ.ExecuteStmt();
                 RGZ.Drop();
                 Count = 1;
             }
             catch (Exception ex)
             {
                 ErrCode = 1;
                 GeneXus.Reorg.GXReorganization.AddMsg(ex.Message, null);
                 throw ex;
             }
             ErrCode = DS.Connection.Disconnect();
             DS.Connection.Database = DataBaseName;
             ErrCode = DS.Connection.FullConnect();
             while ((ErrCode != 0) && (Count > 0) && (Count < 30))
             {
                 Res     = GXUtil.Sleep(1);
                 ErrCode = DS.Connection.FullConnect();
                 Count   = (short)(Count + 1);
             }
             setupDB = 0;
             if ((setupDB == 1) || GeneXus.Configuration.Preferences.MustSetupDB( ))
             {
                 defaultUsers = GXUtil.DefaultWebUser(context);
                 short gxidx;
                 gxidx = 1;
                 while (gxidx <= defaultUsers.Count)
                 {
                     defaultUser = ((String)defaultUsers.Item(gxidx));
                     try
                     {
                         GeneXus.Reorg.GXReorganization.AddMsg(GXResourceManager.GetMessage("GXM_dbadduser", new   object[]  { defaultUser, DataBaseName }), null);
                         cmdBuffer     = "CREATE LOGIN " + "[" + defaultUser + "]" + " FROM WINDOWS";
                         RGZ           = new GxCommand(dsDefault.Db, cmdBuffer, dsDefault, 0, true, false, null);
                         RGZ.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
                         RGZ.ExecuteStmt();
                         RGZ.Drop();
                     }
                     catch (Exception ex)
                     {
                     }
                     try
                     {
                         cmdBuffer     = "CREATE USER " + "[" + defaultUser + "]" + " FOR LOGIN " + "[" + defaultUser + "]";
                         RGZ           = new GxCommand(dsDefault.Db, cmdBuffer, dsDefault, 0, true, false, null);
                         RGZ.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
                         RGZ.ExecuteStmt();
                         RGZ.Drop();
                     }
                     catch (Exception ex)
                     {
                     }
                     try
                     {
                         cmdBuffer     = "EXEC sp_addrolemember N'db_datareader', N'" + defaultUser + "'";
                         RGZ           = new GxCommand(dsDefault.Db, cmdBuffer, dsDefault, 0, true, false, null);
                         RGZ.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
                         RGZ.ExecuteStmt();
                         RGZ.Drop();
                     }
                     catch (Exception ex)
                     {
                     }
                     try
                     {
                         cmdBuffer     = "EXEC sp_addrolemember N'db_datawriter', N'" + defaultUser + "'";
                         RGZ           = new GxCommand(dsDefault.Db, cmdBuffer, dsDefault, 0, true, false, null);
                         RGZ.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
                         RGZ.ExecuteStmt();
                         RGZ.Drop();
                     }
                     catch (Exception ex)
                     {
                     }
                     gxidx = (short)(gxidx + 1);
                 }
             }
         }
         if (ErrCode != 0)
         {
             ErrMsg = DS.ErrDescription;
             GeneXus.Reorg.GXReorganization.AddMsg(ErrMsg, null);
             ErrCode = 1;
             throw new Exception(ErrMsg);
         }
     }
 }
Exemplo n.º 6
0
 private bool PreviousCheck( )
 {
     if (!IsResumeMode( ))
     {
         if (GXUtil.DbmsVersion(context, "DEFAULT") < 9)
         {
             SetCheckError(GXResourceManager.GetMessage("GXM_bad_DBMS_version", new   object[]  { "2005" }));
             return(false);
         }
     }
     if (!MustRunCheck( ))
     {
         return(true);
     }
     if (GXUtil.IsSQLSERVER2005(context, "DEFAULT"))
     {
         /* Using cursor P00012 */
         pr_default.execute(0);
         while ((pr_default.getStatus(0) != 101))
         {
             sSchemaVar  = P00012_AsSchemaVar[0];
             nsSchemaVar = P00012_nsSchemaVar[0];
             pr_default.readNext(0);
         }
         pr_default.close(0);
     }
     else
     {
         /* Using cursor P00023 */
         pr_default.execute(1);
         while ((pr_default.getStatus(1) != 101))
         {
             sSchemaVar  = P00023_AsSchemaVar[0];
             nsSchemaVar = P00023_nsSchemaVar[0];
             pr_default.readNext(1);
         }
         pr_default.close(1);
     }
     if (tableexist("PASAJEROS", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "PASAJEROS" }));
         return(false);
     }
     if (tableexist("TarifasGranelesSecos", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "TarifasGranelesSecos" }));
         return(false);
     }
     if (tableexist("REF_CGRAL_DESP", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "REF_CGRAL_DESP" }));
         return(false);
     }
     if (tableexist("VEH_RORO", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "VEH_RORO" }));
         return(false);
     }
     if (tableexist("PortaContenedoresRango", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "PortaContenedoresRango" }));
         return(false);
     }
     if (tableexist("PortaContenedores", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "PortaContenedores" }));
         return(false);
     }
     if (tableexist("LNG", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "LNG" }));
         return(false);
     }
     if (tableexist("LPG", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "LPG" }));
         return(false);
     }
     if (tableexist("Quimiqueros", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "Quimiqueros" }));
         return(false);
     }
     if (tableexist("TanqueroEsclusasRango", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "TanqueroEsclusasRango" }));
         return(false);
     }
     if (tableexist("TanqueroEsclusas", sSchemaVar))
     {
         SetCheckError(GXResourceManager.GetMessage("GXM_table_exist", new   object[]  { "TanqueroEsclusas" }));
         return(false);
     }
     return(true);
 }
Exemplo n.º 7
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.º 8
0
        void executePrivate( )
        {
            /* GeneXus formulas */
            /* Output device settings */
            cmdBuffer = " SET IDENTITY_INSERT [GXA0004] ON "
            ;
            RGZ           = new GxCommand(dsDefault.Db, cmdBuffer, dsDefault, 0, true, false, null);
            RGZ.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
            RGZ.ExecuteStmt();
            RGZ.Drop();
            /* Using cursor INVOICECON2 */
            pr_default.execute(0);
            while ((pr_default.getStatus(0) != 101))
            {
                A1CountryId    = INVOICECON2_A1CountryId[0];
                n1CountryId    = INVOICECON2_n1CountryId[0];
                A3CustomerId   = INVOICECON2_A3CustomerId[0];
                A15InvoiceDate = INVOICECON2_A15InvoiceDate[0];
                A14InvoiceId   = INVOICECON2_A14InvoiceId[0];
                A1CountryId    = INVOICECON2_A1CountryId[0];
                n1CountryId    = INVOICECON2_n1CountryId[0];

                /*
                 * INSERT RECORD ON TABLE GXA0004
                 *
                 */
                AV2InvoiceId   = A14InvoiceId;
                AV3InvoiceDate = A15InvoiceDate;
                AV4CustomerId  = A3CustomerId;
                if (INVOICECON2_n1CountryId[0])
                {
                    AV5InvoiceCountryId = 0;
                }
                else
                {
                    AV5InvoiceCountryId = A1CountryId;
                }
                /* Using cursor INVOICECON3 */
                pr_default.execute(1, new Object[] { AV2InvoiceId, AV3InvoiceDate, AV4CustomerId, AV5InvoiceCountryId });
                pr_default.close(1);
                if ((pr_default.getStatus(1) == 1))
                {
                    context.Gx_err = 1;
                    Gx_emsg        = (String)(GXResourceManager.GetMessage("GXM_noupdate"));
                }
                else
                {
                    context.Gx_err = 0;
                    Gx_emsg        = "";
                }
                /* End Insert */
                pr_default.readNext(0);
            }
            pr_default.close(0);
            cmdBuffer = " SET IDENTITY_INSERT [GXA0004] OFF "
            ;
            RGZ           = new GxCommand(dsDefault.Db, cmdBuffer, dsDefault, 0, true, false, null);
            RGZ.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
            RGZ.ExecuteStmt();
            RGZ.Drop();
            this.cleanup();
        }
Exemplo n.º 9
0
 private void SetPrecedenceris( )
 {
     GXReorganization.SetMsg(2, GXResourceManager.GetMessage("GXM_refintcrea", new   object[]  { "[IBR_FAMILYHISTORY1]" }));
     ReorgExecute.RegisterPrecedence("RIBR_FamilyhistoryBR_Encounter", "ReorganizeBR_Familyhistory");
 }
Exemplo n.º 10
0
        void executePrivate( )
        {
            /* GeneXus formulas */
            /* Output device settings */
            /* Using cursor VIEW_NEW_E2 */
            pr_default.execute(0);
            while ((pr_default.getStatus(0) != 101))
            {
                A601View_New_Encounter2view_NE_Information_PatientNo = VIEW_NEW_E2_A601View_New_Encounter2view_NE_Information_PatientNo[0];
                n601View_New_Encounter2view_NE_Information_PatientNo = VIEW_NEW_E2_n601View_New_Encounter2view_NE_Information_PatientNo[0];
                A600View_New_Encounter2view_NE_Information_ID        = VIEW_NEW_E2_A600View_New_Encounter2view_NE_Information_ID[0];
                n600View_New_Encounter2view_NE_Information_ID        = VIEW_NEW_E2_n600View_New_Encounter2view_NE_Information_ID[0];
                A599View_New_Encounter2view_NE_TenantTenantCode      = VIEW_NEW_E2_A599View_New_Encounter2view_NE_TenantTenantCode[0];
                n599View_New_Encounter2view_NE_TenantTenantCode      = VIEW_NEW_E2_n599View_New_Encounter2view_NE_TenantTenantCode[0];
                A598View_New_Encounter2view_NE_IsUpdate      = VIEW_NEW_E2_A598View_New_Encounter2view_NE_IsUpdate[0];
                n598View_New_Encounter2view_NE_IsUpdate      = VIEW_NEW_E2_n598View_New_Encounter2view_NE_IsUpdate[0];
                A597View_New_Encounter2view_NE_IsRandApprove = VIEW_NEW_E2_A597View_New_Encounter2view_NE_IsRandApprove[0];
                n597View_New_Encounter2view_NE_IsRandApprove = VIEW_NEW_E2_n597View_New_Encounter2view_NE_IsRandApprove[0];
                A596View_New_Encounter2view_NE_IsRandRecheck = VIEW_NEW_E2_A596View_New_Encounter2view_NE_IsRandRecheck[0];
                n596View_New_Encounter2view_NE_IsRandRecheck = VIEW_NEW_E2_n596View_New_Encounter2view_NE_IsRandRecheck[0];
                A595View_New_Encounter2view_NE_Status        = VIEW_NEW_E2_A595View_New_Encounter2view_NE_Status[0];
                n595View_New_Encounter2view_NE_Status        = VIEW_NEW_E2_n595View_New_Encounter2view_NE_Status[0];
                A593View_New_Encounter2view_NE_Departmentadm = VIEW_NEW_E2_A593View_New_Encounter2view_NE_Departmentadm[0];
                n593View_New_Encounter2view_NE_Departmentadm = VIEW_NEW_E2_n593View_New_Encounter2view_NE_Departmentadm[0];
                A592View_New_Encounter2view_NE_ENCType       = VIEW_NEW_E2_A592View_New_Encounter2view_NE_ENCType[0];
                n592View_New_Encounter2view_NE_ENCType       = VIEW_NEW_E2_n592View_New_Encounter2view_NE_ENCType[0];
                A591View_New_Encounter2view_NE_EncounterID   = VIEW_NEW_E2_A591View_New_Encounter2view_NE_EncounterID[0];
                A594View_New_Encounter2view_NE_AdmitDate     = VIEW_NEW_E2_A594View_New_Encounter2view_NE_AdmitDate[0];
                n594View_New_Encounter2view_NE_AdmitDate     = VIEW_NEW_E2_n594View_New_Encounter2view_NE_AdmitDate[0];
                A40000GXC1 = DateTimeUtil.ResetTime(A594View_New_Encounter2view_NE_AdmitDate);

                /*
                 * INSERT RECORD ON TABLE GXA0075
                 *
                 */
                AV2View_New_Encounter2view_NE_EncounterID = A591View_New_Encounter2view_NE_EncounterID;
                if (VIEW_NEW_E2_n592View_New_Encounter2view_NE_ENCType[0])
                {
                    AV3View_New_Encounter2view_NE_ENCType = "";
                    nV3View_New_Encounter2view_NE_ENCType = false;
                    nV3View_New_Encounter2view_NE_ENCType = true;
                }
                else
                {
                    AV3View_New_Encounter2view_NE_ENCType = A592View_New_Encounter2view_NE_ENCType;
                    nV3View_New_Encounter2view_NE_ENCType = false;
                }
                if (VIEW_NEW_E2_n593View_New_Encounter2view_NE_Departmentadm[0])
                {
                    AV4View_New_Encounter2view_NE_Departmentadm = "";
                    nV4View_New_Encounter2view_NE_Departmentadm = false;
                    nV4View_New_Encounter2view_NE_Departmentadm = true;
                }
                else
                {
                    AV4View_New_Encounter2view_NE_Departmentadm = A593View_New_Encounter2view_NE_Departmentadm;
                    nV4View_New_Encounter2view_NE_Departmentadm = false;
                }
                if (VIEW_NEW_E2_n594View_New_Encounter2view_NE_AdmitDate[0])
                {
                    AV5View_New_Encounter2view_NE_AdmitDate = DateTime.MinValue;
                    nV5View_New_Encounter2view_NE_AdmitDate = false;
                    nV5View_New_Encounter2view_NE_AdmitDate = true;
                }
                else
                {
                    AV5View_New_Encounter2view_NE_AdmitDate = A40000GXC1;
                    nV5View_New_Encounter2view_NE_AdmitDate = false;
                }
                if (VIEW_NEW_E2_n595View_New_Encounter2view_NE_Status[0])
                {
                    AV6View_New_Encounter2view_NE_Status = 0;
                    nV6View_New_Encounter2view_NE_Status = false;
                    nV6View_New_Encounter2view_NE_Status = true;
                }
                else
                {
                    AV6View_New_Encounter2view_NE_Status = A595View_New_Encounter2view_NE_Status;
                    nV6View_New_Encounter2view_NE_Status = false;
                }
                if (VIEW_NEW_E2_n596View_New_Encounter2view_NE_IsRandRecheck[0])
                {
                    AV7View_New_Encounter2view_NE_IsRandRecheck = false;
                    nV7View_New_Encounter2view_NE_IsRandRecheck = false;
                    nV7View_New_Encounter2view_NE_IsRandRecheck = true;
                }
                else
                {
                    AV7View_New_Encounter2view_NE_IsRandRecheck = (bool)(Convert.ToBoolean(A596View_New_Encounter2view_NE_IsRandRecheck));
                    nV7View_New_Encounter2view_NE_IsRandRecheck = false;
                }
                if (VIEW_NEW_E2_n597View_New_Encounter2view_NE_IsRandApprove[0])
                {
                    AV8View_New_Encounter2view_NE_IsRandApprove = false;
                    nV8View_New_Encounter2view_NE_IsRandApprove = false;
                    nV8View_New_Encounter2view_NE_IsRandApprove = true;
                }
                else
                {
                    AV8View_New_Encounter2view_NE_IsRandApprove = (bool)(Convert.ToBoolean(A597View_New_Encounter2view_NE_IsRandApprove));
                    nV8View_New_Encounter2view_NE_IsRandApprove = false;
                }
                if (VIEW_NEW_E2_n598View_New_Encounter2view_NE_IsUpdate[0])
                {
                    AV9View_New_Encounter2view_NE_IsUpdate = false;
                    nV9View_New_Encounter2view_NE_IsUpdate = false;
                    nV9View_New_Encounter2view_NE_IsUpdate = true;
                }
                else
                {
                    AV9View_New_Encounter2view_NE_IsUpdate = (bool)(Convert.ToBoolean(A598View_New_Encounter2view_NE_IsUpdate));
                    nV9View_New_Encounter2view_NE_IsUpdate = false;
                }
                if (VIEW_NEW_E2_n599View_New_Encounter2view_NE_TenantTenantCode[0])
                {
                    AV10View_New_Encounter2view_NE_TenantTenantCode = "";
                    nV10View_New_Encounter2view_NE_TenantTenantCode = false;
                    nV10View_New_Encounter2view_NE_TenantTenantCode = true;
                }
                else
                {
                    AV10View_New_Encounter2view_NE_TenantTenantCode = A599View_New_Encounter2view_NE_TenantTenantCode;
                    nV10View_New_Encounter2view_NE_TenantTenantCode = false;
                }
                if (VIEW_NEW_E2_n600View_New_Encounter2view_NE_Information_ID[0])
                {
                    AV11View_New_Encounter2view_NE_Information_ID = 0;
                    nV11View_New_Encounter2view_NE_Information_ID = false;
                    nV11View_New_Encounter2view_NE_Information_ID = true;
                }
                else
                {
                    AV11View_New_Encounter2view_NE_Information_ID = A600View_New_Encounter2view_NE_Information_ID;
                    nV11View_New_Encounter2view_NE_Information_ID = false;
                }
                if (VIEW_NEW_E2_n601View_New_Encounter2view_NE_Information_PatientNo[0])
                {
                    AV12View_New_Encounter2view_NE_Information_PatientNo = "";
                    nV12View_New_Encounter2view_NE_Information_PatientNo = false;
                    nV12View_New_Encounter2view_NE_Information_PatientNo = true;
                }
                else
                {
                    AV12View_New_Encounter2view_NE_Information_PatientNo = A601View_New_Encounter2view_NE_Information_PatientNo;
                    nV12View_New_Encounter2view_NE_Information_PatientNo = false;
                }
                /* Using cursor VIEW_NEW_E3 */
                pr_default.execute(1, new Object[] { AV2View_New_Encounter2view_NE_EncounterID, nV3View_New_Encounter2view_NE_ENCType, AV3View_New_Encounter2view_NE_ENCType, nV4View_New_Encounter2view_NE_Departmentadm, AV4View_New_Encounter2view_NE_Departmentadm, nV5View_New_Encounter2view_NE_AdmitDate, AV5View_New_Encounter2view_NE_AdmitDate, nV6View_New_Encounter2view_NE_Status, AV6View_New_Encounter2view_NE_Status, nV7View_New_Encounter2view_NE_IsRandRecheck, AV7View_New_Encounter2view_NE_IsRandRecheck, nV8View_New_Encounter2view_NE_IsRandApprove, AV8View_New_Encounter2view_NE_IsRandApprove, nV9View_New_Encounter2view_NE_IsUpdate, AV9View_New_Encounter2view_NE_IsUpdate, nV10View_New_Encounter2view_NE_TenantTenantCode, AV10View_New_Encounter2view_NE_TenantTenantCode, nV11View_New_Encounter2view_NE_Information_ID, AV11View_New_Encounter2view_NE_Information_ID, nV12View_New_Encounter2view_NE_Information_PatientNo, AV12View_New_Encounter2view_NE_Information_PatientNo });
                pr_default.close(1);
                dsDefault.SmartCacheProvider.SetUpdated("GXA0075");
                if ((pr_default.getStatus(1) == 1))
                {
                    context.Gx_err = 1;
                    Gx_emsg        = (String)(GXResourceManager.GetMessage("GXM_noupdate"));
                }
                else
                {
                    context.Gx_err = 0;
                    Gx_emsg        = "";
                }
                /* End Insert */
                pr_default.readNext(0);
            }
            pr_default.close(0);
            this.cleanup();
        }