Beispiel #1
0
        public void UpdateCustomerCanViewPricing(Guid customerId, bool canView)
        {
            CommerceUpdate <Organization> update = new CommerceUpdate <Organization>();

            // have to use the Commerce Server ID to search for customers so we cannot use branch/customer number
            update.SearchCriteria.Model.Id = customerId.ToCommerceServerFormat();
            update.Model.CanViewPricing    = canView;

            CommerceUpdateOperationResponse res = FoundationService.ExecuteRequest(update.ToRequest()).OperationResponses[0] as CommerceUpdateOperationResponse;

            Customer cus = GetCustomerById(customerId);

            _customerCacheRepository.RemoveItem(CACHE_GROUPNAME, CACHE_PREFIX, CACHE_NAME, GetCacheKey(string.Join("-", cus.CustomerNumber, cus.CustomerBranch)));
        }
        public Guid UpdateAccount(string name, Guid accountId)
        {
            KeithLink.Svc.Core.Models.Generated.SiteTerm orgTypes = GetOrganizationTypes();
            string accountOrgTypeId = orgTypes.Elements.Where(o => o.DisplayName == "Account").FirstOrDefault().Id;

            var createOrg = new CommerceServer.Foundation.CommerceUpdate <KeithLink.Svc.Core.Models.Generated.Organization>();

            createOrg.SearchCriteria.Model.Id = accountId.ToCommerceServerFormat();
            createOrg.Model.Name = name;

            createOrg.Model.OrganizationType    = accountOrgTypeId;
            createOrg.UpdateOptions.ReturnModel = new Core.Models.Generated.Organization();

            CommerceUpdateOperationResponse res = Svc.Impl.Helpers.FoundationService.ExecuteRequest(createOrg.ToRequest()).OperationResponses[0] as CommerceUpdateOperationResponse;

            return(new Guid(res.CommerceEntities[0].Id));
        }
        public override void ExecuteUpdate(CommerceUpdateOperation updateOperation, OperationCacheDictionary operationCache, CommerceUpdateOperationResponse response)
        {
            base.ExecuteUpdate(updateOperation, operationCache, response);

            EnsureLineItemsHasShippingMethod();
        }
 public override void ExecuteUpdate(CommerceUpdateOperation updateOperation, OperationCacheDictionary operationCache, CommerceUpdateOperationResponse response)
 {
     base.ExecuteUpdate(updateOperation, operationCache, response);
 }