/// <summary> /// Request constructor. /// <param name="client">BaseClient</param> /// <param name="product">Product</param> /// </summary> public ProductUpdateRequest(BaseClient client = null, Product product = null) : base(client) { Function = "Product_Update"; CustomFieldValues = new CustomFieldValues(); if (product != null) { if (product.Id > 0) { ProductId = product.Id; } else if (product.Code.Length > 0) { EditProduct = product.Code; } ProductCode = product.Code; ProductSku = product.Sku; ProductName = product.Name; ProductDescription = product.Description; ProductCanonicalCategoryCode = product.CanonicalCategoryCode; ProductAlternateDisplayPage = product.PageCode; ProductPageTitle = product.PageTitle; ProductThumbnail = product.Thumbnail; ProductImage = product.Image; ProductPrice = product.Price; ProductCost = product.Cost; ProductWeight = product.Weight; ProductInventory = product.ProductInventory; ProductTaxable = product.Taxable; ProductActive = product.Active; CustomFieldValues = product.CustomFieldValues; } }
/// <summary> /// Request constructor. /// <param name="client">BaseClient</param> /// <param name="category">Category</param> /// </summary> public CategoryUpdateRequest(BaseClient client = null, Category category = null) : base(client) { Function = "Category_Update"; CustomFieldValues = new CustomFieldValues(); if (category != null) { if (category.Id > 0) { CategoryId = category.Id; } else if (category.Code.Length > 0) { EditCategory = category.Code; } CategoryCode = category.Code; CategoryName = category.Name; CategoryPageTitle = category.PageTitle; CategoryActive = category.Active; CategoryParentCategory = category.ParentCategory; CategoryAlternateDisplayPage = category.PageCode; CustomFieldValues = category.CustomFieldValues; } }
/// <summary> /// Request constructor. /// <param name="client">BaseClient</param> /// <param name="order">Order</param> /// </summary> public OrderCustomFieldsUpdateRequest(BaseClient client = null, Order order = null) : base(client) { Function = "OrderCustomFields_Update"; CustomFieldValues = new CustomFieldValues(); if (order != null) { if (order.Id > 0) { OrderId = order.Id; } } }
/// <summary> /// Request constructor. /// <param name="client">BaseClient</param> /// <param name="category">Category</param> /// </summary> public CategoryInsertRequest(BaseClient client = null, Category category = null) : base(client) { Function = "Category_Insert"; CustomFieldValues = new CustomFieldValues(); if (category != null) { CategoryCode = category.Code; CategoryName = category.Name; CategoryActive = category.Active; CategoryPageTitle = category.PageTitle; CategoryAlternateDisplayPage = category.PageCode; CustomFieldValues = category.CustomFieldValues; } }
/// <summary> /// Request constructor. /// <param name="client">BaseClient</param> /// <param name="customer">Customer</param> /// </summary> public CustomerUpdateRequest(BaseClient client = null, Customer customer = null) : base(client) { Function = "Customer_Update"; CustomFieldValues = new CustomFieldValues(); if (customer != null) { if (customer.Id > 0) { CustomerId = customer.Id; } else if (customer.Login.Length > 0) { EditCustomer = customer.Login; } CustomerLogin = customer.Login; CustomerPasswordEmail = customer.PasswordEmail; CustomerShipResidential = customer.ShippingResidential; CustomerShipFirstName = customer.ShipFirstName; CustomerShipLastName = customer.ShipLastName; CustomerShipEmail = customer.ShipEmail; CustomerShipCompany = customer.ShipCompany; CustomerShipPhone = customer.ShipPhone; CustomerShipFax = customer.ShipFax; CustomerShipAddress1 = customer.ShipAddress1; CustomerShipAddress2 = customer.ShipAddress2; CustomerShipCity = customer.ShipCity; CustomerShipState = customer.ShipState; CustomerShipZip = customer.ShipZip; CustomerShipCountry = customer.ShipCountry; CustomerBillFirstName = customer.BillFirstName; CustomerBillLastName = customer.BillLastName; CustomerBillEmail = customer.BillEmail; CustomerBillCompany = customer.BillCompany; CustomerBillPhone = customer.BillPhone; CustomerBillFax = customer.BillFax; CustomerBillAddress1 = customer.BillAddress1; CustomerBillAddress2 = customer.BillAddress2; CustomerBillCity = customer.BillCity; CustomerBillState = customer.BillState; CustomerBillZip = customer.BillZip; CustomerBillCountry = customer.BillCountry; CustomerBusinessAccount = customer.BusinessTitle; CustomFieldValues = customer.CustomFieldValues; } }
/// <summary> /// Request constructor. /// <param name="client">BaseClient</param> /// <param name="customer">Customer</param> /// </summary> public OrderCreateRequest(BaseClient client = null, Customer customer = null) : base(client) { Function = "Order_Create"; CustomFieldValues = new CustomFieldValues(); if (customer != null) { if (customer.Id > 0) { CustomerId = customer.Id; } else if (customer.Login.Length > 0) { CustomerLogin = customer.Login; } } }