예제 #1
0
        public string CreateDocument(string pStrCardCode, double pDblTotal, string pStrRef)//(List<Locations> pObjLocation, string pStrCardCode)
        {
            ExpoganServiceFactory mObjExpoganService = new ExpoganServiceFactory();
            string lStrDocEntry = string.Empty;

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

            lObjDocument.CardCode              = pStrCardCode;
            lObjDocument.DocDueDate            = DateTime.Now;
            lObjDocument.Lines.COGSCostingCode = mObjExpoganService.GetLocationService().GetCostCenter();
            lObjDocument.Lines.ItemCode        = mObjExpoganService.GetLocationService().GetItemCode("EX_ITEMSTAND");
            lObjDocument.Lines.Price           = pDblTotal; //GetPryce
            lObjDocument.Lines.Add();
            if (lObjDocument.Add() != 0)
            {
                string lStrError = DIApplication.Company.GetLastErrorDescription();
                UIApplication.ShowMessageBox(string.Format("Exception: {0}", DIApplication.Company.GetLastErrorDescription()));
                LogService.WriteError("PurchaseOrderDI (CreateDocument) " + DIApplication.Company.GetLastErrorDescription());
            }
            else
            {
                return(DIApplication.Company.GetNewObjectKey().ToString());
            }

            return(lStrDocEntry);
        }
예제 #2
0
파일: Program.cs 프로젝트: radtek/UGRS_Full
        static void Main(string[] args)
        {
            try
            {
                Application oApp = null;
                if (args.Length < 1)
                {
                    oApp = new Application();
                }
                else
                {
                    oApp = new Application(args[0]);
                }
                LogService.Filename("AddonExpogan");

                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"));
                ExpoganServiceFactory lObjExpoganFactory = new ExpoganServiceFactory();
                lObjExpoganFactory.GetSetupService().InitializeTables();
                UIApplication.ShowSuccess(string.Format("AddonExpogan 0.0.6 iniciado correctamente"));
                LogService.WriteSuccess(string.Format("AddonExpogan 0.0.6 iniciado correctamente"));

                oApp.Run();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }