Example #1
0
        public static void Initialize(GlobalServerComponent vismaConnection)
        {
            object dictionaryObj; //Används som inparameter i bcGetSrvDictioanry då den bara tar Object.

            //Anv dictionary-objektet för att dynamiskt hämta objektid:n för egendefinerade fält.
            vismaConnection.bcGetSrvDictionary(out dictionaryObj); //dictionaryObj får en referens
            var dictComp = (ISrvDictionary)dictionaryObj;

            //Hämta objekt-id:n för egendefinierade fält.
            ArticleZUsrPimSku = dictComp.bcGetObjectIDFromName("ZUsrPimSku", (int)GLOBAL_Components.BC_Article);
            ArticleZUsrLuthmanKortTextDen = dictComp.bcGetObjectIDFromName("ZUsrLuthmanKortTextDAN", (int)GLOBAL_Components.BC_Article);
            ArticleZUsrLuthmanKortTextSwe = dictComp.bcGetObjectIDFromName("ZUsrLuthmanKortTextSWE", (int)GLOBAL_Components.BC_Article);
            ArticleZUsrLuthmanKortTextNor = dictComp.bcGetObjectIDFromName("ZUsrLuthmanKortTextNOR", (int)GLOBAL_Components.BC_Article);

            if (ArticleZUsrPimSku == 0
                || ArticleZUsrLuthmanKortTextDen == 0
                || ArticleZUsrLuthmanKortTextSwe == 0
                || ArticleZUsrLuthmanKortTextNor == 0)
            {
                Log.ForCurrent.InfoFormat("ZUsrPimSku = {0}", ArticleZUsrPimSku);
                Log.ForCurrent.InfoFormat("ZUsrLuthmanKortTextDan = {0}", ArticleZUsrLuthmanKortTextDen);
                Log.ForCurrent.InfoFormat("ZUsrLuthmanKortTextSwe = {0}", ArticleZUsrLuthmanKortTextSwe);
                Log.ForCurrent.InfoFormat("ZUsrLuthmanKortTextNor = {0}", ArticleZUsrLuthmanKortTextNor);
                throw new PimIntegrationConfigurationException("Failed to initalize ZUsrFields. Check log file for clues.");
            }

            System.Runtime.InteropServices.Marshal.ReleaseComObject(dictComp);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(dictionaryObj);
        }
Example #2
0
        public static void Initialize(GlobalServerComponent vismaConnection)
        {
            object dictionaryObj;             //Används som inparameter i bcGetSrvDictioanry då den bara tar Object.

            //Anv dictionary-objektet för att dynamiskt hämta objektid:n för egendefinerade fält.
            vismaConnection.bcGetSrvDictionary(out dictionaryObj);             //dictionaryObj får en referens
            var dictComp = (ISrvDictionary)dictionaryObj;

            //Hämta objekt-id:n för egendefinierade fält.
            ArticleZUsrPimSku             = dictComp.bcGetObjectIDFromName("ZUsrPimSku", (int)GLOBAL_Components.BC_Article);
            ArticleZUsrLuthmanKortTextDen = dictComp.bcGetObjectIDFromName("ZUsrLuthmanKortTextDAN", (int)GLOBAL_Components.BC_Article);
            ArticleZUsrLuthmanKortTextSwe = dictComp.bcGetObjectIDFromName("ZUsrLuthmanKortTextSWE", (int)GLOBAL_Components.BC_Article);
            ArticleZUsrLuthmanKortTextNor = dictComp.bcGetObjectIDFromName("ZUsrLuthmanKortTextNOR", (int)GLOBAL_Components.BC_Article);

            if (ArticleZUsrPimSku == 0 ||
                ArticleZUsrLuthmanKortTextDen == 0 ||
                ArticleZUsrLuthmanKortTextSwe == 0 ||
                ArticleZUsrLuthmanKortTextNor == 0)
            {
                Log.ForCurrent.InfoFormat("ZUsrPimSku = {0}", ArticleZUsrPimSku);
                Log.ForCurrent.InfoFormat("ZUsrLuthmanKortTextDan = {0}", ArticleZUsrLuthmanKortTextDen);
                Log.ForCurrent.InfoFormat("ZUsrLuthmanKortTextSwe = {0}", ArticleZUsrLuthmanKortTextSwe);
                Log.ForCurrent.InfoFormat("ZUsrLuthmanKortTextNor = {0}", ArticleZUsrLuthmanKortTextNor);
                throw new PimIntegrationConfigurationException("Failed to initalize ZUsrFields. Check log file for clues.");
            }

            System.Runtime.InteropServices.Marshal.ReleaseComObject(dictComp);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(dictionaryObj);
        }
Example #3
0
        private static string GetNameOfClient(GlobalServerComponent connection)
        {
            string name; int connectionNo;

            connection.bcGetDataConnectionInfo(out connectionNo, out name);
            return(name);
        }
Example #4
0
        public VismaConnection(string clientName, string user, string password, string bapiKey)
        {
            _connection = new GlobalServerComponent();

            _clientName = clientName;
            _user = user;
            _password = EncryptPassword(password);
            _bapiKey = bapiKey;
        }
Example #5
0
        public static BusinessComponentNavigate GetBusinessComponent(this GlobalServerComponent globalSrvComponent, GLOBAL_Components componentId)
        {
            var comp = (BusinessComponentNavigate)globalSrvComponent.bcBusinessComponent[(int)componentId];

            comp.bcEstablishData();
            comp.bcBindData();

            return(comp);
        }
Example #6
0
        public static SalesOrderServerComponent GetSalesOrderServerComponent(this GlobalServerComponent globalSrvComponent)
        {
            var comp = (SalesOrderServerComponent)globalSrvComponent.bcBusinessComponent[(int)GLOBAL_Components.BC_SalesOrder];

            comp.bcEstablishData();
            comp.bcBindData();

            return(comp);
        }
Example #7
0
        public VismaConnection(string clientName, string user, string password, string bapiKey)
        {
            _connection = new GlobalServerComponent();

            _clientName = clientName;
            _user       = user;
            _password   = EncryptPassword(password);
            _bapiKey    = bapiKey;
        }
Example #8
0
 public SalesOrderManager(GlobalServerComponent vgConnection, CustomerQuery customerQuery, PostageCalculationParameters postageCalculationParameters)
 {
     _vgConnection = vgConnection;
     _customerQuery = customerQuery;
     _postageCalculationParameters = postageCalculationParameters;
 }
Example #9
0
 public ArticleManager(GlobalServerComponent vgConnection)
 {
     _vgConnection = vgConnection;
     _articleComponent = _vgConnection.GetBusinessComponent(GLOBAL_Components.BC_Article);
 }
Example #10
0
 public InvoiceQuery(GlobalServerComponent vgConnection)
 {
     _vgConnection = vgConnection;
 }
Example #11
0
 public InvoiceManager(GlobalServerComponent vgConnection)
 {
     _invoiceComp  = vgConnection.GetBusinessComponent(GLOBAL_Components.BC_CustomerOrderCopy);
     _colInvoiceNo = _invoiceComp.bcGetTableObjectName((int)CustomerOrderCopy_Properties.COP_InvoiceNo);
 }
Example #12
0
 public InvoiceQuery(GlobalServerComponent vgConnection)
 {
     _vgConnection = vgConnection;
 }
Example #13
0
 static VgConnections()
 {
     SourceConnection      = new GlobalServerComponent();
     DestinationConnection = new GlobalServerComponent();
 }
Example #14
0
 public InvoiceManager(GlobalServerComponent vgConnection)
 {
     _invoiceComp = vgConnection.GetBusinessComponent(GLOBAL_Components.BC_CustomerOrderCopy);
     _colInvoiceNo = _invoiceComp.bcGetTableObjectName((int)CustomerOrderCopy_Properties.COP_InvoiceNo);
 }
Example #15
0
 public CustomerQuery(GlobalServerComponent vgConnection)
 {
     _vgConnection      = vgConnection;
     _customerComponent = _vgConnection.GetBusinessComponent(GLOBAL_Components.BC_Customer);
     _colCustomerNo     = _customerComponent.bcGetTableObjectName((int)Customer_Properties.CUS_CustomerNo);
 }
Example #16
0
 public SalesOrderManager(GlobalServerComponent vgConnection, CustomerQuery customerQuery, PostageCalculationParameters postageCalculationParameters)
 {
     _vgConnection  = vgConnection;
     _customerQuery = customerQuery;
     _postageCalculationParameters = postageCalculationParameters;
 }
Example #17
0
 static VgConnections()
 {
     SourceConnection = new GlobalServerComponent();
     DestinationConnection = new GlobalServerComponent();
 }
Example #18
0
 private static string GetNameOfClient(GlobalServerComponent connection)
 {
     string name; int connectionNo;
     connection.bcGetDataConnectionInfo(out connectionNo, out name);
     return name;
 }
Example #19
0
 public ArticleManager(GlobalServerComponent vgConnection)
 {
     _vgConnection     = vgConnection;
     _articleComponent = _vgConnection.GetBusinessComponent(GLOBAL_Components.BC_Article);
 }
Example #20
0
 public CustomerQuery(GlobalServerComponent vgConnection)
 {
     _vgConnection = vgConnection;
     _customerComponent = _vgConnection.GetBusinessComponent(GLOBAL_Components.BC_Customer);
     _colCustomerNo = _customerComponent.bcGetTableObjectName((int)Customer_Properties.CUS_CustomerNo);
 }