private void GetPurchasesInCarts(string userID) { var cartModel = new PurchaseModel(); double subTotal; IList <Purchase> purchases = cartModel.GetOrdersInCart(userID); CreateShopTable(purchases, out subTotal); var vat = subTotal * 0.21; var totalAmount = subTotal + vat + 15; Total.Text = subTotal + "£"; Vat.Text = vat + "£"; TotalAmount.Text = totalAmount + "£"; }
private void GetPurchasesListInCart(string userId) { try { PurchaseModel model = new PurchaseModel(); var ordersList = model.GetOrdersInCart(userId); LayoutProductsTable(ordersList, out double price); double vat = Math.Round(price * 0.21, 2); const double shipping = 15; double totalAmount = price + vat + shipping; LiteralPrice.Text = string.Format("{0:c}", price); LiteralVAT.Text = string.Format("{0:c}", vat); LiteralShipping.Text = string.Format("{0:c}", shipping); LiteralTotal.Text = string.Format("{0:c}", totalAmount); } catch (Exception ex) { LabelError.Text = ex.ToString(); } }