From 16fd49af3fcc57dd836c0986233259ef568bddd4 Mon Sep 17 00:00:00 2001 From: AndriiSyrotenko Date: Sun, 15 Oct 2023 19:34:39 +0000 Subject: [PATCH] SA-55 add cart page --- .../Pages/Cart.cshtml | 96 +++++++++++++++++- .../Pages/Cart.cshtml.cs | 13 +++ .../wwwroot/assets/amazon.png | Bin 0 -> 1085 bytes .../wwwroot/assets/star.png | Bin 0 -> 375 bytes 4 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 ShoppingAssistantWebClient.Web/wwwroot/assets/amazon.png create mode 100644 ShoppingAssistantWebClient.Web/wwwroot/assets/star.png diff --git a/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml b/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml index 5b501af..406d0b8 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml +++ b/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml @@ -2,9 +2,99 @@ @model ShoppingAssistantWebClient.Web.Pages.CartModel @{ } +

Cart

- -
- +
+ @foreach (var product in Model.products) { +
+ + +
+ + + @{ + string price = "N/A"; + if(!(product.Price is null)) { + price = "$" + product.Price.ToString(); + } + } + +
+
+ +
+
+ }
\ No newline at end of file diff --git a/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml.cs b/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml.cs index 626414f..5d99cb5 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml.cs +++ b/ShoppingAssistantWebClient.Web/Pages/Cart.cshtml.cs @@ -5,8 +5,21 @@ namespace ShoppingAssistantWebClient.Web.Pages { public class CartModel : PageModel { + public List products = new List { + new Product {Description = "HDMI cabel HDMI cabel HDMI cabel HDMI cabel HDMI cabel HDMI cabelHDMI cabel", Rating = 4.0, Price = 12}, + new Product {Description = "super mega hdmi cabel", Rating = 3.8, Price = 13.11}, + new Product {Description = "", Rating = 4.0} + }; + public void OnGet() { + } } + + public class Product { + public string Description {get; set;} + public double? Rating {get; set;} + public double? Price {get; set;} + } } diff --git a/ShoppingAssistantWebClient.Web/wwwroot/assets/amazon.png b/ShoppingAssistantWebClient.Web/wwwroot/assets/amazon.png new file mode 100644 index 0000000000000000000000000000000000000000..45b729e02d4e412f14085975761c9972d6384760 GIT binary patch literal 1085 zcmV-D1j74?P)&()a(wUU z#mHYITaj&<9tc=#BYY$%Ba}YM24#tI*X#8P!86PQ?tkOo6Mp9b`OnBB8@DJi>z`5o z01E7vIP^5kU86ja9mQSn*qZQ$@4PnHc6J|;vsQLfZf>ye4u89G1HW@GV?Zy=Z5R_d z2%*nVavvXM<*hT=CnG>}fk>*B6T%8UjE_$+6uH#45n|p$zo(*^W{A%;Wcq z&+lZ`|A8FhfbAEhiy8u!TR$R4UI^tv7@0_RAYci~K-sZ8K+@kT{m5fK6ZVadufe=r z@N&_Y3Vqt3mp&zOlp)Gk>1WdUfC>Gkz#OWV6IJ@L(D$|95MOap!J&*cqObH#)T$(~ zb+${yf-kp~V5`%J{K^Ry5cpUekcCju zY5EA?!>>cg7d!wrXaWTwLb*cu{S)J!;O>AkN|p&!a$Mni*APZ3-YHP-p(9-IGZs3k zq2AjjdnC+6`<3b+UZSDwnnU$L9iDdTqY8TLrlCz}T?G;@V50_SH*i`Q@cSM4cy_m7 zc9`>qyy8Q^@W);@*fXMC=mOU1Ap~`zkmHf{*IFs_WuH9Ccgg|fLt@N2Sr?UTmn2vG zocUARju#J?Y~Ofn#|`5f2z@5>iOaAD^);wS%{L_Fx)j~ zskqzajG6NUb(WFtRoEu1^|fnn*s2yvRg@{y#vtm_PK)fqYX|C2C%}n6|77)qOI<}d0*En#5m>)bYg zaIUcRzOxOS4b)91^55tE%3b1V94k0y@PKo-9C)cja3XM!BC#Y(-Xh#VGlO#n4_2Q- zC7&!ap5V8#j{`JfJ1=&3-^y%#a=LoUKnLi-5n$^IeA+;vI*CrEf`!`hNsTB5GA`{dEU8JF1bKca`CXH+ z1eb|RsH*es>ZUz#vVduD0BPwN_;^z=7JKXNqND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