@RenderBody() diff --git a/demoMvcCore/Views/Shared/_LoginPartial.cshtml b/demoMvcCore/Views/Shared/_LoginPartial.cshtml new file mode 100644 index 0000000..83b7729 --- /dev/null +++ b/demoMvcCore/Views/Shared/_LoginPartial.cshtml @@ -0,0 +1,27 @@ +@using Microsoft.AspNetCore.Identity + +@inject SignInManager SignInManager +@inject UserManager UserManager + + diff --git a/demoMvcCore/Views/Transactions/Index.cshtml b/demoMvcCore/Views/Transactions/Index.cshtml new file mode 100644 index 0000000..fdda6d6 --- /dev/null +++ b/demoMvcCore/Views/Transactions/Index.cshtml @@ -0,0 +1,106 @@ +@using demoMvcCore.ViewModels; +@using System.Globalization; +@model TransactionsViewModel + + +@section title { +

Transactions Report

+} + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +@if (Model.Transactions is not null) +{ + + + + + + + + + + + + + + + + @foreach (var tran in Model.Transactions) + { + + + + + + + + + + + } + + + + + + + + +
Date TimeCashier NameProduct NameQty BeforeQty SoldQty AfterPriceSold Amt
@tran.TimeStamp.ToString("yyyy-MM-dd hh:mm")@tran.CashierName@tran.ProductName@tran.BeforeQty@tran.SoldQty@(tran.BeforeQty - tran.SoldQty)@(string.Format(new CultureInfo("en-US"),"{0:c}", tran.Price))@(string.Format(new CultureInfo("en-US"), "{0:c}", tran.SoldQty * tran.Price))
  + Grand Total: + + + @(string.Format(new CultureInfo("en-US"),"{0:c}", Model.Transactions.Sum(x => x.Price * x.SoldQty))) + +
+ + +} +
+ +@section Scripts +{ + + + +} + diff --git a/demoMvcCore/appsettings.json b/demoMvcCore/appsettings.json index af0538f..687f371 100644 --- a/demoMvcCore/appsettings.json +++ b/demoMvcCore/appsettings.json @@ -1,10 +1,13 @@ -{ +{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" -} - + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Server=localhost,1433;Database=MarketManagement;User Id=sa;Password=ragh2404;TrustServerCertificate=True;", + "MarketContextConnection": "Server=(localdb)\\mssqllocaldb;Database=demoMvcCore;Trusted_Connection=True;MultipleActiveResultSets=true", + } +} \ No newline at end of file diff --git a/demoMvcCore/demoMvcCore.csproj b/demoMvcCore/demoMvcCore.csproj index 8dbeb8c..c4fe00d 100644 --- a/demoMvcCore/demoMvcCore.csproj +++ b/demoMvcCore/demoMvcCore.csproj @@ -13,15 +13,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/demoMvcCore/wwwroot/css/site.css b/demoMvcCore/wwwroot/css/site.css index 8ad7251..f76bb8e 100644 --- a/demoMvcCore/wwwroot/css/site.css +++ b/demoMvcCore/wwwroot/css/site.css @@ -20,3 +20,24 @@ html { body { margin-bottom: 60px; } + +tr.highlight > td { + background-color: yellow; +} + + +@media print { + body * { + visibility: hidden; + } + + #printarea, #printarea * { + visibility: visible; + } + + #printarea { + position: absolute; + left: 0; + top: 0; + } +} \ No newline at end of file