[原创]關于SAP Business One三角貿易的程序設計(拋轉其他資料庫部分)

方案設計。在UI+DI中嵌套DI(其他資料庫).

在處理其他資料庫新建單據時,可以在SBO_Application_ItemEvent事件中將SAPbobsCOM.Company CompanyTWO=new SAPbobsCOM.Company();

實例化。

                            SAPbobsCOM.Company CompanyTWO = null;

                            CompanyTWO = new SAPbobsCOM.Company();

                            CompanyTWO.Server = oRecordset.Fields.Item("U_server").Value.ToString().TrimEnd();

                            CompanyTWO.DbUserName = oRecordset.Fields.Item("U_user").Value.ToString().TrimEnd();

                            SymmCrypto sc = new SymmCrypto(SymmCrypto.SymmProvEnum.DES);

                            CompanyTWO.DbPassword = sc.Decrypting(oRecordset.Fields.Item("U_password").Value.ToString().TrimEnd(), "el");

                            CompanyTWO.CompanyDB = oRecordset.Fields.Item("U_dbname").Value.ToString().TrimEnd();

                            CompanyTWO.UserName = oRecordset.Fields.Item("U_dbuser").Value.ToString().TrimEnd();

                            CompanyTWO.Password = sc.Decrypting(oRecordset.Fields.Item("U_dbps").Value.ToString().TrimEnd(), "el");

                            CompanyTWO.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005;

                            CompanyTWO.language = SAPbobsCOM.BoSuppLangs.ln_TrdtnlChinese_Hk;

                            CompanyTWO.UseTrusted = false;

                            int valCompanyTWO = CompanyTWO.Connect();

即可,如果需新建修改刪除單據只需(SAPbobsCOM.Documents)(CompanyTWO.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders));

 

 

 

你可能感兴趣的:(SAP)