public void SetCartItemDetails(ServerCatalogGroup _catalogGroupItem) { _cartItem = _catalogGroupItem; if (!string.IsNullOrEmpty(_cartItem.iItem.itemName)) { itemName.Text = _cartItem.iItem.itemName; } else { itemName.Text = ""; } if (!string.IsNullOrEmpty(_cartItem.iItem.itemImage)) { itemImage.Source = _cartItem.iItem.itemImage; //logoGrid.BackgroundColor = Color.Transparent; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(_cartItem.iItem.itemName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { itemImage.Source = ""; //logoGrid.BackgroundColor = Color.FromHex("#31c3ee"); Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(_cartItem.iItem.itemName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } itemQuantity.Text = _cartItem.cItem.itemCurrentQuantity; if (!string.IsNullOrEmpty(_cartItem.cItem.itemPrice)) { itemPrice.Text = "$" + (int.Parse(_cartItem.cItem.itemCurrentQuantity) * double.Parse(_cartItem.cItem.itemPrice)); } else { itemPrice.Text = "$0"; } }
public void SetSpeakerDetails(ServerCatalogGroup _catalogGroupItem) { catalogGroup = _catalogGroupItem; if (!string.IsNullOrEmpty(catalogGroup.iItem.itemName)) { itemName.Text = catalogGroup.iItem.itemName; } else { itemName.Text = ""; } if (!string.IsNullOrEmpty(catalogGroup.iItem.itemImage)) { itemImage.Source = catalogGroup.iItem.itemImage; //logoGrid.BackgroundColor = Color.Transparent; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(catalogGroup.iItem.itemName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { itemImage.Source = ""; //logoGrid.BackgroundColor = Color.FromHex("#31c3ee"); Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(catalogGroup.iItem.itemName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } if (!string.IsNullOrEmpty(catalogGroup.cItem.itemPrice)) { itemPrice.Text = "$" + catalogGroup.cItem.itemPrice; } else { itemPrice.Text = "$0"; } }
public void SetPurchaseItemInformation(ServerCatalogGroup catalogGroup) { item = catalogGroup; if (!string.IsNullOrEmpty(item.iItem.itemImage)) { productImage.Source = item.iItem.itemImage; } else { productImage.Source = ""; } SetImageText(); ItemName.Text = "Name: " + item.iItem.itemName; ItemQuantity.Text = "Quantity: " + item.cItem.itemCurrentQuantity; ItemPrice.Text = "Price: $" + item.cItem.itemPrice; ItemTotalPrice.Text = "Total Price: $" + (int.Parse(item.cItem.itemCurrentQuantity) * double.Parse(item.cItem.itemPrice)); ItemCategory.Text = "Type: " + item.iItem.itemType; purchaseShippingType.Text = item.iItem.itemShippingType; purchaseRefund.Text = item.iItem.itemRefund; }
public void CatalogDetails(ServerCatalogGroup item) { currentItem = item; if (currentItem != null) { if (!string.IsNullOrEmpty(currentItem.iItem.itemImage)) { itemImage.Source = currentItem.iItem.itemImage; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentItem.iItem.itemName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { itemImage.Source = ""; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentItem.iItem.itemName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } if (!string.IsNullOrEmpty(currentItem.iItem.itemName)) { itemName.Text = currentItem.iItem.itemName; } if (!string.IsNullOrEmpty(currentItem.iItem.itemDescription)) { description.Text = currentItem.iItem.itemDescription; } else { description.Text = "Description unavailable"; } if (!string.IsNullOrEmpty(currentItem.iItem.itemType)) { itemType.Text = "Category : " + currentItem.iItem.itemType; } if (!string.IsNullOrEmpty(currentItem.cItem.itemPrice)) { itemPrice.Text = "Price : $" + currentItem.cItem.itemPrice; } else { itemPrice.Text = "Price : Free"; purchaseButton.IsVisible = false; } if (!string.IsNullOrEmpty(currentItem.cItem.itemCurrentQuantity)) { if (currentItem.cItem.itemMaxQuantity == "-1") { itemAvailable.Text = "Quantity Available : No Limit"; } else { int avai = (int.Parse(currentItem.cItem.itemMaxQuantity) - int.Parse(currentItem.cItem.itemCurrentQuantity)); if (avai <= 0) { itemAvailable.Text = "Quantity Available : Sold out!"; purchaseButton.Text = "Sold Out"; purchaseButton.BackgroundColor = Color.FromHex("#ff3232"); purchaseButton.IsEnabled = false; } else { itemAvailable.Text = "Quantity Available : " + avai.ToString(); } } } if (!string.IsNullOrEmpty(currentItem.iItem.itemShippingType)) { shipping.Text = currentItem.iItem.itemShippingType; } if (!string.IsNullOrEmpty(currentItem.iItem.itemRefund)) { refund.Text = currentItem.iItem.itemRefund; } currentItem.cItem.itemCurrentQuantity = "1"; } if (!currentItem.Available(1)) { purchaseButton.Text = "Sold Out!"; purchaseButton.IsEnabled = false; } }
public PurchaseItemInformation(ServerCatalogGroup catalogGroup) { InitializeComponent(); SetPurchaseItemInformation(catalogGroup); }