Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace STPMonoDroid.DataTypes {
- public class Sku {
- public string Id { get; set; }
- // these properties are unique to Skus within the Cart
- public int QuantityAvailable { get; set; }
- public decimal ListPrice { get; set; }
- public decimal FinalPrice { get; set; }
- public string ColorCode { get; set; }
- public bool BackOrdered { get; set; }
- public List<SkuAttribute> Attributes { get; set; }
- public Dictionary<string, string> OrderedAttributes { get; set; }
- // these properties are unique to Skus within the Cart
- public string Url { get; set; } // not avail outside of cart b/c it's avail in the Product object
- public string WebUrl {get;set;} // not avail outside of cart b/c it's avail in the Product object
- public string RemoveUrl { get; set; } // WARNING: this removes all by default
- public int Quantity { get; set; } // How many are in the cart
- // the way skus are packaged in the API is awkward to work with
- // rebuild relationship as a CategoryName = CategoryValue dictionary
- public void SortAttributes() {
- if (Attributes != null && Attributes.Count > 0) {
- OrderedAttributes = new Dictionary<string, string>();
- for (int i = 0; i < Attributes.Count; i++) {
- SkuAttribute attr = Attributes[i];
- OrderedAttributes[attr.Category] = attr.CategoryValue;
- }
- }
- }
- }
- public class SkuAttribute {
- public string Category { get; set; }
- public string CategoryValue { get; set; }
- public string CategoryValueDescription { get; set; }
- }
- }
Add Comment
Please, Sign In to add comment