Пример #1
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }

                LogService.Filename("AddOnFinances");

                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
                Application.SBO_Application.AppEvent  += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
                Application.SBO_Application.ItemEvent += new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);
                UIApplication.ShowSuccess(string.Format("Addon Finanzas iniciado correctamente"));
                LogService.WriteSuccess(string.Format("Addon Finanzas iniciado correctamente"));
                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
        private void tmrWorkerThree_Tick(object sender, EventArgs e)
        {
            tmrWorkerThree.Enabled = false;
            Recordset lObjRecordset = null;

            try
            {
                lObjRecordset = DIApplication.GetRecordset();
                lObjRecordset.DoQuery("SELECT ItemCode FROM OITM");

                lstThreadThree.Items.Clear();
                if (lObjRecordset.RecordCount > 0)
                {
                    for (int i = 0; i < lObjRecordset.RecordCount; i++)
                    {
                        lstThreadThree.Items.Add(lObjRecordset.Fields.Item(0).Value.ToString());
                        lObjRecordset.MoveNext();
                    }
                }
            }
            catch (Exception ex)
            {
                lstThreadThree.Items.Add(ex.ToString());
            }
            finally
            {
                MemoryUtility.ReleaseComObject(lObjRecordset);
                tmrWorkerThree.Enabled = true;
            }
        }
Пример #3
0
 static void Main(string[] args)
 {
     try
     {
         Application oApp = null;
         if (args.Length < 1)
         {
             oApp = new Application();
         }
         else
         {
             oApp = new Application(args[0]);
         }
         Menu MyMenu = new Menu();
         MyMenu.AddMenuItems();
         oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
         DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
         Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
         oApp.Run();
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Пример #4
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }

                //Using Utilities DIApplication..
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);


                SetupService lObjSetupService = new SetupService();
                lObjSetupService.InitializeTables();

                EarringsRanks pObjEarringsRanks = new EarringsRanks();

                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #5
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }

                LogService.Filename("AddOnFacturadeProveedor");
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                PurchaseInvoices pObjpurchaseInvoices = new PurchaseInvoices();
                LogService.WriteInfo("Addon Iniciado");
                //Menu MyMenu = new Menu();
                //MyMenu.AddMenuItems();
                //oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #6
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }

                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());

                BatchCreator mObjBatchCreator = new BatchCreator();
                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);

                oApp.Run();
                LogService.WriteSuccess("Application running");
            }
            catch (Exception ex)
            {
                LogService.WriteError(ex);
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #7
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }
                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);

                //Initialize Tables
                UIApplication.ShowSuccess(string.Format("Inicializar las tablas"));
                CyCServiceFactory lObjCyCServiceFactory = new CyCServiceFactory();
                lObjCyCServiceFactory.GetSetupService().InitializeTables();
                UIApplication.ShowSuccess(string.Format("Addon de compras iniciado correctamente"));

                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #8
0
 public frmTest()
 {
     DIApplication.DIConnect();
     InitializeComponent();
     tmrWorkerOne.Start();
     tmrWorkerTwo.Start();
     tmrWorkerThree.Start();
     tmrWorkerFour.Start();
 }
Пример #9
0
        public void CheckXMLStatusTest()
        {
            DIApplication.DIConnect((SAPbobsCOM.Company)UGRSap.GetCompany());

            try {
                var file        = @"C:\Users\ssandoval\Desktop\Qualisys Saul\PROJECTS\Union Ganadera\Compras\XML Enero- Feb\1b123a60-karla consuelo franco guitierrez.xml";
                var lObjReadXML = new ReadXMLService();
                var objectXML   = lObjReadXML.ReadXML(file);
                var result      = lObjReadXML.CheckVoucherStatus(objectXML);

                Assert.IsTrue(result);
                return;
            }
            catch (Exception ex) {
                Assert.Fail(ex.Message);
            }
        }
Пример #10
0
 /// <summary>
 /// Checks if a User Defined Field exists.
 /// </summary>
 /// <param name="tableName">The table of the field.</param>
 /// <param name="ufdName">The name of the field.</param>
 /// <returns><c>true</c> if it exists, <c>false</c> otherwise.</returns>
 public static bool ExistsUFD(string tableName, string ufdName)
 {
     SAPbobsCOM.Recordset rs = DIApplication.GetRecordset();
     try
     {
         rs.DoQuery(string.Format("SELECT \"AliasID\" FROM \"CUFD\" WHERE \"TableID\" = '{0}' AND \"AliasID\" = '{1}'", tableName, ufdName));
         if (rs.RecordCount > 0)
         {
             return(true);
         }
     }
     catch (Exception)
     {
     }
     finally
     {
         MemoryUtility.ReleaseComObject(rs);
     }
     return(false);
 }
Пример #11
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }

                LogService.Filename("AddOnMaquinaria");

                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);

                //Using Utilities DIApplication..
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());

                //Initialize Tables
                UIApplication.ShowSuccess("Inicializando tablas");
                MachinerySeviceFactory lObjMachinerySeviceFactory = new MachinerySeviceFactory();
                lObjMachinerySeviceFactory.GetSetupService().InitializeTables();

                UIApplication.ShowSuccess("Addon de Maquinaria iniciado correctamente");
                LogService.WriteSuccess(string.Format("Addon de Maquinaria iniciado correctamente"));

                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #12
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }
                LogService.Filename("Addon_Permissions");
                //Using Utilities DIApplication..
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);


                PermissionsFactory lObjPermissionsFactorty = new PermissionsFactory();
                lObjPermissionsFactorty.GetSetupService().InitializeTables();

                EarringsRanks pObjEarringsRanks = new EarringsRanks();

                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
                LogService.WriteSuccess("Addon_Permissions 0.0.11 cargado con exito");
                oApp.Run();

                UIApplication.ShowMessage("Addon Permissions 0.0.11 agregado con exito");
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #13
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                //CONFIGURACION
                AccountingAccountsSetupLoginService lObjSetupLoginService = new AccountingAccountsSetupLoginService();
                lObjSetupLoginService.CreateTable();
                AccountingAccountsSetupDBService lObjSetupDBService = new AccountingAccountsSetupDBService();
                lObjSetupDBService.CreateTable();
                //IMPORTACION
                //Logg
                AccountingAccountsLoggService lObjLoggService = new AccountingAccountsLoggService();
                lObjLoggService.CreateTable();
                AccountingAccountsLoggDetailService lObjLoggDetailService = new AccountingAccountsLoggDetailService();
                lObjLoggDetailService.CreateTable();

                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #14
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }

                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());

                //BatchNameCua batchNameCua = new BatchNameCua();
                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);

                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
                //Using Utilities DIApplication..
                //DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());

                UIApplication.ShowSuccess(string.Format("Inicializar las tablas"));
                Services.SetupService lObjSetupService = new Services.SetupService();
                lObjSetupService.InitializeTables();
                UIApplication.ShowSuccess(string.Format("Addon de cuarentenaria iniciado correctamente"));

                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #15
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }
                LogService.Filename("AddOnCompras");

                Menu MyMenu = new Menu();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
                //TestXML();

                //Initialize Tables
                UIApplication.ShowSuccess(string.Format("Inicializar las tablas"));
                PurchasesServiceFactory lObjFoodProductionFactory = new PurchasesServiceFactory();
                lObjFoodProductionFactory.GetSetupService().InitializeTables();
                UIApplication.ShowSuccess(string.Format("AddonCompras 1.2.69 iniciado correctamente"));
                LogService.WriteSuccess(string.Format("AddonCompras 1.2.69 iniciado correctamente"));
                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                System.Windows.Forms.Application.Exit();
            }
        }
Пример #16
0
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }
                LogService.Filename("AddonTransportes");
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                Menu     MyMenu       = new Menu();
                Freights lObjFreights = new Freights();
                MyMenu.AddMenuItems();
                oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
                Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);

                //Initialize Tables
                UIApplication.ShowSuccess(string.Format("Inicializar las tablas"));
                TransportServiceFactory mObjServiceFactory = new TransportServiceFactory();
                mObjServiceFactory.GetSetUpService().InitializeTables();
                UIApplication.ShowSuccess(string.Format("Addon de transportes 1.0.18 iniciado correctamente"));

                LogService.WriteSuccess("Addon de transportes 1.0.18 iniciado correctamente");

                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Пример #17
0
 public void Reconnection()
 {
     if (DIApplication.Connected)
     {
         try
         {
             mObjQueryManager = new QueryManager();
             //test connection
             string lStrValue = mObjQueryManager.GetValue("U_Value", "Name", "SU_HE_SERIE", "[@UG_CONFIG]");
         }
         catch (System.Exception)
         {
             DIApplication.DIReconnect();
             //Check if reconnected
             LogService.WriteInfo("Intentando reconectar");
             Reconnection();
             return;
         }
     }
     else
     {
         DIApplication.DIReconnect();
     }
 }
Пример #18
0
        /// <summary> Default constructor. </summary>
        /// <remarks> Ranaya, 24/05/2017. </remarks>

        public PermissionsServicesFactory()
        {
            DIApplication.DIConnect();
        }
Пример #19
0
        static void Main(string[] args)
        {
            Credentials lObjCredentials = new Credentials();

            //lObjCredentials.LicenseServer = ConfigurationManager.AppSettings["LicenseServer"].ToString();
            lObjCredentials.UserName = ConfigurationManager.AppSettings["UsernameSAP"].ToString();
            lObjCredentials.Password = ConfigurationManager.AppSettings["PasswordSAP"].ToString();
            switch (ConfigurationManager.AppSettings["DBServer"].ToString())
            {
            case "MSSQL2012":
                lObjCredentials.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2012;
                break;

            case "MSSQL2014":
                lObjCredentials.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2014;
                break;

            case "MSSQL2016":
                lObjCredentials.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2016;
                break;

            default:
                break;
            }
            //lObjCredentials.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2012;
            lObjCredentials.SQLServer    = ConfigurationManager.AppSettings["SQLServer"].ToString();
            lObjCredentials.SQLUserName  = ConfigurationManager.AppSettings["UsernameSQL"].ToString();
            lObjCredentials.SQLPassword  = ConfigurationManager.AppSettings["PasswordSQL"].ToString();
            lObjCredentials.DataBaseName = ConfigurationManager.AppSettings["DBName"].ToString();
            //lObjCredentials.Language = SAPbobsCOM.BoSuppLangs.ln_English;

            DIConnection lObjDIConnection = new DIConnection();

            lObjDIConnection.ConnectToDI(lObjCredentials);

            if (lObjDIConnection.Company != null && lObjDIConnection.Company.Connected)
            {
                DIApplication.DIConnect(lObjDIConnection.Company);
            }
            //IList<string> list = new List<string>() { "raul", "martin", "anaya", "rojo" };
            //Console.WriteLine(string.Join(",", list.ToArray()));
            //Console.ReadLine();

            GPSFactoryServices lObjGPSFactoryServices = new GPSFactoryServices();

            lObjGPSFactoryServices.GetSetupService().InitializeTables();
            UGRS.Core.SDK.DI.Configuration.ConfigurationServicesFactory lObjConfigurationFactoryServices = new UGRS.Core.SDK.DI.Configuration.ConfigurationServicesFactory();



            //ServiceBase[] ServicesToRun = new ServiceBase[]
            //{
            //    new SAP_ServiceGPS()
            //};
            //ServiceBase.Run(ServicesToRun);



            string lStrPathKM   = ConfigurationManager.AppSettings["PathKM"].ToString();
            string lStrPathTime = ConfigurationManager.AppSettings["PathTime"].ToString();

            if (!string.IsNullOrEmpty(lStrPathKM))
            {
                //@"C:\Users\amartinez\Desktop\csv\KM";
                List <string> lLstFilesKM = ImportFiles.FindFiles(lStrPathKM);
                ReadCsvKm.VerifyFilesKM(lLstFilesKM, lStrPathKM);
            }
            else
            {
                LogUtility.Write("Error al momento de consultar el directorio Kilometros recorridos");
            }
            if (!string.IsNullOrEmpty(lStrPathTime))
            {
                //@"C:\Users\amartinez\Desktop\csv\TIME";
                List <string> lLstFilesTime = ImportFiles.FindFiles(lStrPathTime);
                // ReadCsvTime.VerifyFilesTime(lLstFilesTime, lStrPathTime);
            }
            else
            {
                LogUtility.Write("Error al momento de consultar el directorio de Horas de motor");
            }

            //ReadCSV.ReadKilometers(@"C:\testkm.csv");
            //ReadCSV.ReadTimeEngine(@"C:\test.csv");
        }
Пример #20
0
        public void AddMenuItems()
        {
            SAPbouiCOM.Menus    oMenus    = null;
            SAPbouiCOM.MenuItem oMenuItem = null;

            oMenus = Application.SBO_Application.Menus;

            SAPbouiCOM.MenuCreationParams oCreationPackage = null;
            oCreationPackage = ((SAPbouiCOM.MenuCreationParams)(Application.SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)));
            oMenuItem        = Application.SBO_Application.Menus.Item("43520"); // moudles'

            oCreationPackage.Type     = SAPbouiCOM.BoMenuType.mt_POPUP;
            oCreationPackage.UniqueID = "UGRS.AddOn.Purchases";
            oCreationPackage.String   = "Compras";
            oCreationPackage.Enabled  = true;
            oCreationPackage.Position = -1;

            oMenus = oMenuItem.SubMenus;

            try
            {
                //  If the manu already exists this code will fail
                oMenus.AddEx(oCreationPackage);
            }
            catch (Exception)
            {
            }

            try
            {
                // Get the menu collection of the newly added pop-up item
                oMenuItem = Application.SBO_Application.Menus.Item("UGRS.AddOn.Purchases");
                oMenus    = oMenuItem.SubMenus;

                //// Create s sub menu
                //oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
                //oCreationPackage.UniqueID = "UGRS.AddOn.Purchases.Form1";
                //oCreationPackage.String = "Notas";
                //oMenus.AddEx(oCreationPackage);

                //// Create s sub menu
                //oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
                //oCreationPackage.UniqueID = "UGRS.AddOn.Purchases.frmPurchaseXML";
                //oCreationPackage.String = "XML";
                //oMenus.AddEx(oCreationPackage);

                // Create s sub menu

                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                string lStrCostCenter = mObjPurchasesServiceFactory.GetPurchaseInvoiceService().GetCostCenter();

                /* if (mObjPurchasesServiceFactory.GetPurchasePermissionsService().GetPermissionType(lStrCostCenter, "U_GLO_Refund") != PermissionsEnum.Permission.None)
                 * {*/
                oCreationPackage.Type     = SAPbouiCOM.BoMenuType.mt_STRING;
                oCreationPackage.UniqueID = "UGRS.AddOn.Purchases.frmReceipts";
                oCreationPackage.String   = "Captura de comprobantes";
                oMenus.AddEx(oCreationPackage);

                // Create s sub menu
                oCreationPackage.Type     = SAPbouiCOM.BoMenuType.mt_STRING;
                oCreationPackage.UniqueID = "UGRS.AddOn.Purchases.frmSearchRefunds";
                oCreationPackage.String   = "Búsqueda de reembolsos";
                oMenus.AddEx(oCreationPackage);

                /* }
                 *
                 *
                 * if (mObjPurchasesServiceFactory.GetPurchasePermissionsService().GetPermissionType(lStrCostCenter, "U_GLO_ExpeCheck") != PermissionsEnum.Permission.None)
                 * {*/

                // Create s sub menu
                oCreationPackage.Type     = SAPbouiCOM.BoMenuType.mt_STRING;
                oCreationPackage.UniqueID = "UGRS.AddOn.Purchases.frmCheeckingCosts";
                oCreationPackage.String   = "Comprobación de gastos";
                oMenus.AddEx(oCreationPackage);
                // }

                // Create s sub menu
                oCreationPackage.Type     = SAPbouiCOM.BoMenuType.mt_STRING;
                oCreationPackage.UniqueID = "UGRS.AddOn.Purchases.frmXML";
                oCreationPackage.String   = "Carga de xml";
                oMenus.AddEx(oCreationPackage);
            }
            catch (Exception)
            { //  Menu already exists
                Application.SBO_Application.SetStatusBarMessage("Menu Already Exists", SAPbouiCOM.BoMessageTime.bmt_Short, true);
            }
        }
Пример #21
0
        /// <summary> Default constructor. </summary>
        /// <remarks> Ranaya, 24/05/2017. </remarks>

        public AuctionsServicesFactory()
        {
            DIApplication.DIConnect();
        }
Пример #22
0
 private static void ConnectDIApplication()
 {
     DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
 }
Пример #23
0
 public AuctionsServerObject()
 {
     DIApplication.DIConnect();
 }
Пример #24
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please wait...");
            DIApplication.DIConnect();
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("Connection successful");

            SAPbobsCOM.Documents lObjDocument = null;
            lObjDocument = (SAPbobsCOM.Documents)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);

            var a = lObjDocument.GetByKey(185);
            var b = lObjDocument.GroupNumber;
            var c = lObjDocument.PaymentMethod;
            var d = lObjDocument.ExtraDays;
            var e = lObjDocument.PaymentGroupCode;

            ////SAPbobsCOM.JournalEntries lObjJournalEntries = null;
            //SAPbobsCOM.Documents lObjDocument = null;
            ////int lIntResult = -1;

            //try
            //{
            //    Console.WriteLine("Please wait...");
            //    DIApplication.DIConnect();
            //    Console.ForegroundColor = ConsoleColor.Yellow;
            //    Console.WriteLine("Connection successful");

            //    lObjDocument = (SAPbobsCOM.Documents)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit);
            //    lObjDocument.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO;
            //    lObjDocument.Series = 297;
            //    lObjDocument.DocDate = DateTime.Now;
            //    lObjDocument.DocDueDate = DateTime.Now;
            //    lObjDocument.Comments = "Salida de mercancías";
            //    lObjDocument.JournalMemo = "Salida de mercancías";

            //    lObjDocument.Lines.ItemCode = "A00000468";
            //    lObjDocument.Lines.WarehouseCode = "SUHEG";
            //    lObjDocument.Lines.Quantity = 20;

            //    lObjDocument.Lines.BatchNumbers.Quantity = 20;
            //    lObjDocument.Lines.BatchNumbers.BatchNumber = "Prueba161017_2";
            //    lObjDocument.Lines.BatchNumbers.Add();

            //    lObjDocument.Lines.Add();

            //    if (lObjDocument.Add() != 0)
            //    {
            //        Console.ForegroundColor = ConsoleColor.Red;
            //        Console.WriteLine(DIApplication.Company.GetLastErrorDescription());
            //    }


            //    //lObjDocument = (SAPbobsCOM.Documents)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
            //    //lObjDocument.GetByKey(53);

            //    //if (lObjDocument != null)
            //    //{
            //    //    for (int i = 0; i < lObjDocument.Lines.Count; i++)
            //    //    {
            //    //        lObjDocument.Lines.SetCurrentLine(i);

            //    //        var a = lObjDocument.Lines.CostingCode;
            //    //        var b = lObjDocument.Lines.CostingCode2;
            //    //        var c = lObjDocument.Lines.CostingCode3;
            //    //        var d = lObjDocument.Lines.CostingCode4;
            //    //        var f = lObjDocument.Lines.CostingCode5;
            //    //    }
            //    //}


            //    //lObjJournalEntries = (SAPbobsCOM.JournalEntries)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries);
            //    //lObjJournalEntries.DueDate = DateTime.Today;
            //    //lObjJournalEntries.TaxDate = DateTime.Today;
            //    //lObjJournalEntries.AutoVAT = SAPbobsCOM.BoYesNoEnum.tYES;

            //    //lObjJournalEntries.Lines.AccountCode = "1070050001000";
            //    //lObjJournalEntries.Lines.ContraAccount = "2040010004000";
            //    //lObjJournalEntries.Lines.Credit = 0;
            //    //lObjJournalEntries.Lines.Debit = 100;
            //    //lObjJournalEntries.Lines.CostingCode = "SU_HERMO";
            //    //lObjJournalEntries.Lines.UserFields.Fields.Item("U_GLO_Auxiliary").Value = "CL00000001";
            //    //lObjJournalEntries.Lines.UserFields.Fields.Item("U_GLO_AuxType").Value = "1";
            //    //lObjJournalEntries.Lines.UserFields.Fields.Item("U_SU_Folio").Value = "SU-HE-170001";
            //    //lObjJournalEntries.Lines.Add();

            //    //lObjJournalEntries.Lines.AccountCode = "2040010004000";
            //    //lObjJournalEntries.Lines.ContraAccount = "1070050001000";
            //    //lObjJournalEntries.Lines.Credit = 100;
            //    //lObjJournalEntries.Lines.Debit = 0;
            //    //lObjJournalEntries.Lines.CostingCode = "SU_HERMO";
            //    //lObjJournalEntries.Lines.UserFields.Fields.Item("U_GLO_Auxiliary").Value = "CL00000002";
            //    //lObjJournalEntries.Lines.UserFields.Fields.Item("U_GLO_AuxType").Value = "1";
            //    //lObjJournalEntries.Lines.UserFields.Fields.Item("U_SU_Folio").Value = "SU-HE-170001";
            //    //lObjJournalEntries.Lines.Add();

            //    //lIntResult = lObjJournalEntries.Add();

            //    //if (lIntResult != 0)
            //    //{
            //    //    Console.WriteLine(DIApplication.Company.GetLastErrorDescription());
            //    //}

            //    //DIApplication.Company.StartTransaction();
            //    //CreateDocument("62");
            //    //CreateDocument("63");
            //    //DIApplication.Company.EndTransaction(BoWfTransOpt.wf_RollBack);
            //}
            //catch (Exception lObjException)
            //{
            //    Console.ForegroundColor = ConsoleColor.Red;
            //    Console.WriteLine(lObjException.ToString());
            //}
            //finally
            //{
            //    //MemoryUtility.ReleaseComObject(lObjJournalEntries);
            //    MemoryUtility.ReleaseComObject(lObjDocument);
            //}

            Console.WriteLine("Please wait...");

            EntityFrameworkTransactionTest mObjTest = new EntityFrameworkTransactionTest();

            mObjTest.DoTest();

            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine("Press ENTER to close");
            Console.ReadLine();
        }
Пример #25
0
        static void Main(string[] pArrStrArgs)
        {
            try
            {
                LogService.Filename("FoodProduction");
                LogService.WriteInfo("Inicio del addon 1.2.56");

                Application lObjApplication = null;

                if (pArrStrArgs.Length < 1)
                {
                    lObjApplication = new Application();
                }
                else
                {
                    lObjApplication = new Application(pArrStrArgs[0]);
                }


                //Prepare menu
                MenuManager lObjMenuManager = new MenuManager();
                lObjMenuManager.Initialize();

                //Prepare filters
                EventManager lObjEventManager = new EventManager();
                UIApplication.GetApplication().SetFilter(lObjEventManager.GetItemEventFiltersByMenu(lObjMenuManager.Menu));
                UIApplication.ShowSuccess(string.Format("Menu manager"));

                //Add menu events
                lObjApplication.RegisterMenuEventHandler(lObjMenuManager.GetApplicationMenuEvent);
                LogService.WriteSuccess("Registro del menú");
                UIApplication.ShowSuccess(string.Format("Registro del menu"));


                //Add application events
                UIApplication.GetApplication().AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(GetApplicationAppEvent);
                DIApplication.DIConnect((SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany());
                UIApplication.ShowSuccess(string.Format("DI Connect"));
                //Bascula
                ConnectRemoteAccess();


                //Initialize Tables
                UIApplication.ShowSuccess(string.Format("Inicializar las tablas"));
                SetupService mObjSetupService;
                mObjSetupService = new SetupService();
                mObjSetupService.InitializeTables();


                UIApplication.ShowSuccess(string.Format("Addon Iniciado correctamente"));
                LogService.WriteSuccess("[AddOn FoodProduction 1.2.55 STARTED]");
                //Ticket instance = (Ticket)Activator.CreateInstance(typeof(Ticket));

                //Init application
                lObjApplication.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                LogService.WriteError("[ERROR]" + ex.Message);
            }
        }
Пример #26
0
 public void Test()
 {
     DIApplication.DIConnect((SAPbobsCOM.Company)SAPbouiCOM.Framework.Application.SBO_Application.Company.GetDICompany());
 }