Beispiel #1
1
        public static void AddAvarias(int idOOPR, string descricao, SAPbobsCOM.Company oCompany, SAPbouiCOM.Application SBO_Application)
        {
            SAPbobsCOM.GeneralService oGeneralService = null;
            SAPbobsCOM.GeneralData oGeneralData = null;
            SAPbobsCOM.GeneralDataParams oGeneralParams = null;
            SAPbobsCOM.CompanyService oCompanyService = null;
            string proxCode = GetProxCodeAvarias(oCompany);

            try
            {
                oCompanyService = oCompany.GetCompanyService();
                oGeneralService = oCompanyService.GetGeneralService("FLX_FB_AVR");
                oGeneralData = ((SAPbobsCOM.GeneralData)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData)));
                oGeneralData.SetProperty("Code", proxCode);
                oGeneralData.SetProperty("Name", proxCode);
                oGeneralData.SetProperty("U_FLX_FB_AVR_IDOOPR", idOOPR);
                oGeneralData.SetProperty("U_FLX_FB_AVR_DESC", descricao);

                oGeneralParams = oGeneralService.Add(oGeneralData);
            }
            catch (Exception ex)
            {
                SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
            }
        }
Beispiel #2
0
        public static void UpdateAvarias(string code, string name, int idOOPR, string descricao, SAPbobsCOM.Company oCompany, SAPbouiCOM.Application SBO_Application)
        {
            SAPbobsCOM.GeneralService oGeneralService = null;
            SAPbobsCOM.GeneralData oGeneralData = null;
            SAPbobsCOM.CompanyService oCompanyService = null;

            try
            {
                oCompanyService = oCompany.GetCompanyService();
                oGeneralService = oCompanyService.GetGeneralService("FLX_FB_AVR");
                oGeneralData = ((SAPbobsCOM.GeneralData)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData)));
                oGeneralData.SetProperty("Code", code);
                oGeneralData.SetProperty("Name", name);
                oGeneralData.SetProperty("U_FLX_FB_AVR_IDOOPR", idOOPR);
                oGeneralData.SetProperty("U_FLX_FB_AVR_DESC", descricao);

                oGeneralService.Update(oGeneralData);
            }
            catch (Exception ex)
            {
                SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
            }
        }
Beispiel #3
0
        private void UIAPILog(LoggingEvent loggingEvent, SAPbouiCOM.Application app, string asm)
        {
            string msg = String.Format("{0}: {1}", asm, loggingEvent.RenderedMessage);
            if (loggingEvent.Level == Level.Alert)
            {
                if (!SilentMode)
                    app.StatusBar.SetText(msg, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_None);
            }
            else if (loggingEvent.Level == Level.Info || loggingEvent.Level == Level.Debug)
            {
                if (!SilentMode)
                    app.StatusBar.SetText(msg, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
            }
            else if (loggingEvent.Level == Level.Warn)
            {
                if (!SilentMode)
                    app.StatusBar.SetText(msg, SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
            }
            else
            {
                app.StatusBar.SetText(msg, SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }

            if (loggingEvent.ExceptionObject != null)
            {
                var traceForm = ContainerManager.Container.Resolve<ExceptionTrace>();
                if (traceForm.UIAPIRawForm != null)
                // if it's an error on Dover Boot, B1SResourceManager may not have XML form on hand.
                {
                    traceForm.ex = loggingEvent.ExceptionObject;
                    traceForm.Show();
                }
                else
                {
                    app.MessageBox(string.Format("{0}\n\n{1}",
                        loggingEvent.ExceptionObject.Message, loggingEvent.ExceptionObject.StackTrace));
                }
            }
        }