Example #1
0
        public async Task <CustomerAuthTicket> AddCustomerAccount(int tenantId, int?siteId,
                                                                  int?masterCatalogId, CustomerAccountAndAuthInfo account)
        {
            _apiContext = new ApiContext(tenantId, siteId);

            var customerAccountResource = new CustomerAccountResource(_apiContext);
            var newAccount = await customerAccountResource.AddAccountAndLoginAsync(account);

            return(newAccount);
        }
Example #2
0
        public async Task <Credit> AddCustomerCredit(Credit credit, int tenantId,
                                                     int?siteId, int?masterCatalogId)
        {
            _apiContext = new ApiContext(tenantId, siteId);

            var customerCreditResource = new CreditResource(_apiContext);
            var newCustomerCredit      = await customerCreditResource.AddCreditAsync(credit);

            return(newCustomerCredit);
        }
Example #3
0
        public async Task <Mozu.Api.Contracts.ProductAdmin.Attribute> UpdateAttribute(int tenantId, int?siteId,
                                                                                      int?masterCatalogId, Mozu.Api.Contracts.ProductAdmin.Attribute attribute)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var attributeResource = new AttributeResource(_apiContext);
            var updatedAttribute  = await attributeResource.UpdateAttributeAsync(attribute, attribute.AttributeFQN, null);

            return(updatedAttribute);
        }
        public async Task <IEnumerable <Mozu.Api.Contracts.ProductAdmin.ProductType> > GetProductTypes(int tenantId, int?siteId,
                                                                                                       int?masterCatalogId, int?startIndex, int?pageSize, string sortBy = null, string filter = null)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productTypeResource = new ProductTypeResource(_apiContext);
            var productTypes        = await productTypeResource.GetProductTypesAsync(startIndex, pageSize, sortBy, filter, null);

            return(productTypes.Items);
        }
        public async Task <Mozu.Api.Contracts.ProductAdmin.ProductType> AddProductType(int tenantId, int?siteId,
                                                                                       int?masterCatalogId, Mozu.Api.Contracts.ProductAdmin.ProductType productType)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productTypeResource = new ProductTypeResource(_apiContext);
            var newProductType      = await productTypeResource.AddProductTypeAsync(productType, null);

            return(newProductType);
        }
Example #6
0
        public async Task <Mozu.Api.Contracts.ProductAdmin.Product> AddProduct(int tenantId, int?siteId,
                                                                               int?masterCatalogId, Mozu.Api.Contracts.ProductAdmin.Product product)
        {
            _apiContext = new ApiContext(tenantId, siteId);

            var productResource = new ProductResource(_apiContext);
            var newProduct      = await productResource.AddProductAsync(product);

            return(newProduct);
        }
Example #7
0
        public async Task <IEnumerable <CustomerAccount> > GetCustomerAccounts(int tenantId, int?siteId,
                                                                               int?masterCatalogId, int?startIndex, int?pageSize, string sortBy = null, string filter = null)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var customerAccountResource = new CustomerAccountResource(_apiContext);
            var accounts = await customerAccountResource.GetAccountsAsync(startIndex, pageSize, sortBy, filter, null);

            return(accounts.Items);
        }
Example #8
0
        public async Task <Mozu.Api.Contracts.ProductAdmin.Product> GetProduct(int tenantId, int?siteId,
                                                                               int?masterCatalogId, string productCode)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productResource = new ProductResource(_apiContext);
            var product         = await productResource.GetProductAsync(productCode, null);

            return(product);
        }
Example #9
0
        public async Task <Credit> UpdateCustomerCredit(int tenantId, int?siteId,
                                                        int?masterCatalogId, Credit credit)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var customerCreditResource = new CreditResource(_apiContext);
            var updatedCustomerCredit  = await customerCreditResource.UpdateCreditAsync(credit, credit.Code);

            return(updatedCustomerCredit);
        }
Example #10
0
        public async Task <Credit> GetCustomerCredit(int tenantId, int?siteId,
                                                     int?masterCatalogId, string code)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var customerCreditResource = new CreditResource(_apiContext);
            var credit = await customerCreditResource.GetCreditAsync(code);

            return(credit);
        }
Example #11
0
        public async Task <CustomerContact> AddCustomerContact(int accountId, CustomerContact contact,
                                                               int tenantId, int?siteId, int?masterCatalogId)
        {
            _apiContext = new ApiContext(tenantId, siteId);

            var customerContactResource = new CustomerContactResource(_apiContext);
            var newContact = await customerContactResource.AddAccountContactAsync(contact, accountId);

            return(newContact);
        }
Example #12
0
        public async Task <CustomerContact> GetCustomerContact(int tenantId, int?siteId,
                                                               int?masterCatalogId, int accountId, int contactId)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var customerContactResource = new CustomerContactResource(_apiContext);
            var contact = await customerContactResource.GetAccountContactAsync(accountId, contactId);

            return(contact);
        }
        public async Task <Mozu.Api.Contracts.ProductAdmin.ProductType> UpdateProductType(int tenantId, int?siteId,
                                                                                          int?masterCatalogId, Mozu.Api.Contracts.ProductAdmin.ProductType productType)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productTypeResource = new ProductTypeResource(_apiContext);
            var updatedProductType  = await productTypeResource.UpdateProductTypeAsync(productType,
                                                                                       Convert.ToInt32(productType.Id), null);

            return(updatedProductType);
        }
Example #14
0
        public async Task <Mozu.Api.Contracts.ProductAdmin.Product> UpdateProduct(int tenantId, int?siteId,
                                                                                  int?masterCatalogId, Mozu.Api.Contracts.ProductAdmin.Product product)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productResource = new ProductResource(_apiContext);
            var updatedProduct  = await productResource.UpdateProductAsync(product,
                                                                           product.ProductCode, null);

            return(updatedProduct);
        }
Example #15
0
        public async Task <CustomerContact> UpdateCustomerContact(int tenantId, int?siteId,
                                                                  int?masterCatalogId, CustomerContact contact)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var customerContactResource = new CustomerContactResource(_apiContext);
            var updatedcontact          = await customerContactResource.UpdateAccountContactAsync(contact,
                                                                                                  contact.AccountId, contact.Id);

            return(updatedcontact);
        }
Example #16
0
        public async Task <CustomerAccount> UpdateCustomerAccount(int tenantId, int?siteId,
                                                                  int?masterCatalogId, CustomerAccount account)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var customerAccountResource = new CustomerAccountResource(_apiContext);
            var updatedAccount          = await customerAccountResource.UpdateAccountAsync(account,
                                                                                           account.Id);

            return(updatedAccount);
        }
Example #17
0
 public CustomerHandler(int tenantId, int?siteId, int?masterCatalogId)
 {
     _apiContext = new Mozu.Api.ApiContext(tenantId, siteId);
 }