Ejemplo n.º 1
0
        public void SapUpdateBusinessPartner(Trigger request)
        {
            string host = HttpContext.Current.Request.Url.Host;

            SapXmlExtractor.LogTrigger(request, ObjectTypeEnums.BusinessPartner.ToString(), host);
            var businessPartner = _businessPartnerService.GetBusinessPartnerForIncoming(request.ID);
            var syncRequest     = _businessPartnerSyncRequestCreator.Create(businessPartner);

            _middlewareService.Sync(syncRequest);
        }
Ejemplo n.º 2
0
        /*public string SapUpdate(string sapRequest)
         * {
         *  var serializer = new XmlSerializer(typeof(TriggerXml));
         *  TriggerXml sapTrigger = (TriggerXml)serializer.Deserialize(GenerateStreamFromString(sapRequest));
         *  return ProcessTrigger(sapTrigger);
         * }*/

        public string ProcessTrigger(Trigger sapTrigger)
        {
            if (sapTrigger.TriggerObject.ToLower().Equals("supplier") || sapTrigger.TriggerObject.ToLower().Equals("customer"))
            {
                var businessPartner = _businessPartnerService.GetBusinessPartnerForIncoming(sapTrigger.ID);
                var syncRequest     = _businessPartnerSyncRequestCreator.Create(businessPartner);
                return(_middlewareService.Sync(syncRequest));
            }

            return(null);
        }