>().Value;
+
+ var useCustomizationData = settings.UseCustomizationData;
+ var contentRootPath = env.ContentRootPath;
+ var webroot = env.WebRootPath;
+
+ if (useCustomizationData)
+ {
+ GetPreconfiguredImages(contentRootPath, webroot, log);
+
+ GetPreconfiguredCSS(contentRootPath, webroot, log);
+ }
+ }
+
+ static void GetPreconfiguredCSS(string contentRootPath, string webroot, ILogger log)
+ {
+ try
+ {
+ string overrideCssFile = Path.Combine(contentRootPath, "Setup", "override.css");
+ if (!File.Exists(overrideCssFile))
+ {
+ log.LogError($" override css file '{overrideCssFile}' does not exists.");
+ return;
+ }
+
+ string destinationFilename = Path.Combine(webroot, "css", "override.css");
+ File.Copy(overrideCssFile, destinationFilename, true );
+ }
+ catch (Exception ex)
+ {
+ log.LogError($"Exception in method GetPreconfiguredCSS WebMVC. Exception Message={ex.Message}");
+ }
+ }
+
+ static void GetPreconfiguredImages(string contentRootPath, string webroot, ILogger log)
+ {
+ try
+ {
+ string imagesZipFile = Path.Combine(contentRootPath, "Setup", "images.zip");
+ if (!File.Exists(imagesZipFile))
+ {
+ log.LogError($" zip file '{imagesZipFile}' does not exists.");
+ return;
+ }
+
+ string imagePath = Path.Combine(webroot, "images");
+ string[] imageFiles = Directory.GetFiles(imagePath).Select(file => Path.GetFileName(file)).ToArray();
+
+ using (ZipArchive zip = ZipFile.Open(imagesZipFile, ZipArchiveMode.Read))
+ {
+ foreach (ZipArchiveEntry entry in zip.Entries)
+ {
+ if (imageFiles.Contains(entry.Name))
+ {
+ string destinationFilename = Path.Combine(imagePath, entry.Name);
+ if (File.Exists(destinationFilename))
+ {
+ File.Delete(destinationFilename);
+ }
+ entry.ExtractToFile(destinationFilename);
+ }
+ else
+ {
+ log.LogWarning($"Skip file '{entry.Name}' in zipfile '{imagesZipFile}'");
+ }
+ }
+ }
+ }
+ catch ( Exception ex )
+ {
+ log.LogError($"Exception in method GetPreconfiguredImages WebMVC. Exception Message={ex.Message}");
+ }
+ }
+
+ }
+
+}
diff --git a/src/Web/WebMVC/Setup/images.zip b/src/Web/WebMVC/Setup/images.zip
new file mode 100644
index 000000000..531ed26f2
Binary files /dev/null and b/src/Web/WebMVC/Setup/images.zip differ
diff --git a/src/Web/WebMVC/Setup/override.css b/src/Web/WebMVC/Setup/override.css
new file mode 100644
index 000000000..e8b5bb50f
--- /dev/null
+++ b/src/Web/WebMVC/Setup/override.css
@@ -0,0 +1,3 @@
+.esh-catalog-button {
+ background-color: #83D01B; /* to override the style of this button ie. to make it red, use background-color: #FF001b; */
+}
diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs
index 8147f6720..ef0228604 100644
--- a/src/Web/WebMVC/Startup.cs
+++ b/src/Web/WebMVC/Startup.cs
@@ -12,6 +12,7 @@ using Microsoft.Extensions.HealthChecks;
using Microsoft.Extensions.Logging;
using System;
using System.IdentityModel.Tokens.Jwt;
+using WebMVC.Infrastructure;
namespace Microsoft.eShopOnContainers.WebMVC
{
@@ -129,6 +130,9 @@ namespace Microsoft.eShopOnContainers.WebMVC
Scope = { "openid", "profile", "orders", "basket", "marketing" }
};
+ //Seed Data
+ WebContextSeed.Seed(app, env, loggerFactory);
+
//Wait untill identity service is ready on compose.
app.UseOpenIdConnectAuthentication(oidcOptions);
diff --git a/src/Web/WebMVC/Views/Order/Detail.cshtml b/src/Web/WebMVC/Views/Order/Detail.cshtml
index c17ffb2a9..810a59559 100644
--- a/src/Web/WebMVC/Views/Order/Detail.cshtml
+++ b/src/Web/WebMVC/Views/Order/Detail.cshtml
@@ -68,9 +68,9 @@
- $ @Math.Round(item.UnitPrice, 2)
+ $ @item.UnitPrice.ToString("N2")
- $ @Math.Round(item.Units * item.UnitPrice, 2)
+ $ @Math.Round(item.Units * item.UnitPrice, 2).ToString("N2")
}
diff --git a/src/Web/WebMVC/Views/Order/_OrderItems.cshtml b/src/Web/WebMVC/Views/Order/_OrderItems.cshtml
index 8b9cdd534..6feaa9838 100644
--- a/src/Web/WebMVC/Views/Order/_OrderItems.cshtml
+++ b/src/Web/WebMVC/Views/Order/_OrderItems.cshtml
@@ -20,14 +20,14 @@
- $ @item.UnitPrice
+ $ @item.UnitPrice.ToString("N2")
- $ @Math.Round(item.Units * item.UnitPrice, 2)
+ $ @Math.Round(item.Units * item.UnitPrice, 2).ToString("N2")
}
@@ -41,7 +41,7 @@
- $ @Model.Total
+ $ @Model.Total.ToString("N2")
diff --git a/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml b/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml
index 5885291ef..1f0d05320 100644
--- a/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml
+++ b/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml
@@ -23,12 +23,12 @@
-
+ $ @item.UnitPrice.ToString("N2")
- $ @Math.Round(item.Quantity * item.UnitPrice, 2)
+ $ @Math.Round(item.Quantity * item.UnitPrice, 2).ToString("N2")
diff --git a/src/Web/WebMVC/Views/Shared/_Layout.cshtml b/src/Web/WebMVC/Views/Shared/_Layout.cshtml
index ab1a4e542..678c962e1 100644
--- a/src/Web/WebMVC/Views/Shared/_Layout.cshtml
+++ b/src/Web/WebMVC/Views/Shared/_Layout.cshtml
@@ -19,12 +19,14 @@
+
+
@@ -56,7 +58,7 @@
diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj
index 2c8e47175..c0cc08da0 100644
--- a/src/Web/WebMVC/WebMVC.csproj
+++ b/src/Web/WebMVC/WebMVC.csproj
@@ -9,6 +9,24 @@
..\..\..\docker-compose.dcproj
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+