Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BookStoreMVC.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
# Visual Studio Version 17
VisualStudioVersion = 17.7.34031.279
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "eShopSolution.WebApp", "eShopSolution.WebApp\eShopSolution.WebApp.csproj", "{B3DD9B83-FF04-47FB-A39D-9FD98EE4E685}"
EndProject
Expand Down
3 changes: 2 additions & 1 deletion EmailService/EmailService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public void Send(string from, string to, string subject, string text)
// send email
using var smtp = new SmtpClient();
smtp.Connect("smtp.gmail.com", 587, SecureSocketOptions.StartTls);
smtp.Authenticate("hytranluan@gmail.com", "");
smtp.Authenticate("nguyenthanhtoanx2@gmail.com", "kvkh jioj hies lrjn");


try
{
Expand Down
2 changes: 1 addition & 1 deletion EmailService/EmailService.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
- Admin App
- template : https://startbootstrap.com/template/sb-admin
- Tich hop api
- .....
- Sử dụng kĩ thuât Left-join trong csdl để gán sản phẩm vào danh mục
26: Cookie Authentication va Login Logout
## Cấu hình và Run
* Git clone
Expand All @@ -38,4 +40,5 @@
* Thay đổi kết nối cơ sở dữ liệu trong appsinstall.Development.json trong dự án eShopSolution.WebApp
* Chọn 3 project BackEndApi-AdminApp-WebApp thành self-host
* Chọn multiple run project: Chuột phải vào Solution và choose Properties and set Multiple Project, choose Start for 3 Projects: BackendApi, WebApp and AdminApp
* Build Prj và F5
* Build Prj và F5
* Done
4 changes: 2 additions & 2 deletions eShopSolution.AdminApp/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<i class="fas fa-table mr-1"></i>
DataTable Example
</div>
<div class="card-body">
@* <div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
Expand Down Expand Up @@ -560,6 +560,6 @@
</tbody>
</table>
</div>
</div>
</div> *@
</div>
</div>
2 changes: 1 addition & 1 deletion eShopSolution.AdminApp/Views/Login/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<footer class="py-4 bg-light mt-auto">
<div class="container-fluid">
<div class="d-flex align-items-center justify-content-between small">
<div class="text-muted">Bản quyền thuộc &copy; Electro Store 2021</div>
<div class="text-muted">Bản quyền thuộc &copy; Electro Store 2023</div>
</div>
</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion eShopSolution.AdminApp/Views/Product/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</tr>
<tr>
<td class="font-weight-bold">
Chi tiết sản phẩm
Thông tin sản phầm
</td>
<td>
@{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model NavigationViewModel
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand" href="index.html">Electro Admin</a><button class="btn btn-link btn-sm order-1 order-lg-0" id="sidebarToggle" href="#">
<a class="navbar-brand" href="index.html">Thế giới sách Admin</a><button class="btn btn-link btn-sm order-1 order-lg-0" id="sidebarToggle" href="#">
<i class="fas fa-bars"></i>
</button><!-- Navbar Search-->
<form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0">
Expand Down
2 changes: 1 addition & 1 deletion eShopSolution.AdminApp/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<footer class="py-4 bg-light mt-auto">
<div class="container-fluid">
<div class="d-flex align-items-center justify-content-between small">
<div class="text-muted">Bản quyền thuộc &copy; Electro Store 2021</div>
<div class="text-muted">Bản quyền thuộc &copy; Electro Store 2023</div>
</div>
</div>
</footer>
Expand Down
6 changes: 3 additions & 3 deletions eShopSolution.AdminApp/eShopSolution.AdminApp.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentValidation.AspNetCore" Version="8.6.2" />
<PackageReference Include="MailKit" Version="2.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="2.1.1" />
<PackageReference Include="Microsoft.IdentityModel.Logging" Version="6.5.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
<PackageReference Include="RestSharp" Version="106.11.7" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MailKit" Version="2.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions eShopSolution.Application/eShopSolution.Application.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation.AspNetCore" Version="8.6.2" />
<PackageReference Include="MailKit" Version="2.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.23" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 10 additions & 9 deletions eShopSolution.Data/eShopSolution.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentValidation.AspNetCore" Version="8.6.2" />
<PackageReference Include="MailKit" Version="2.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.4">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.23" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.23" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.23" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.23">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.4">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.23" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.23">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion eShopSolution.Utilities/eShopSolution.Utilities.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion eShopSolution.ViewModels/eShopSolution.ViewModels.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions eShopSolution.WebApp/Controllers/CartController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public async Task<IActionResult> Checkout(CheckoutViewModel request)
{
// mail admin when have new email
var email1 = new EmailService.EmailService();
email1.Send("hytranluan@gmail.com", "hytranluan@gmail.com",
email1.Send("nguyenthanhtoanx2@gmail.com", "nguyenthanhtoanx2@gmail.com",
"ĐƠN HÀNG MỚI", $"Mã đơn hàng là <strong>{result}</strong>, nhấn vào <a href='" + "https://localhost:5002/Order/Detail?orderId=" + result + "'>đây</a> để đến trang quản lý đơn hàng này.");

var orderSummaryHtml = "<table border='1' style='border-collapse:collapse'>"
Expand Down Expand Up @@ -192,7 +192,7 @@ public async Task<IActionResult> Checkout(CheckoutViewModel request)

var userMail = claims.FirstOrDefault(x => x.Type == ClaimTypes.Email).Value;
var email2 = new EmailService.EmailService();
email2.Send("hytranluan@gmail.com", userMail,
email2.Send("nguyenthanhtoanx2@gmail.com", userMail,
"ĐẶT HÀNG THÀNH CÔNG",
templateHtml
+ orderSummaryHtml
Expand Down Expand Up @@ -349,8 +349,8 @@ public async Task<IActionResult> Processing(string stripeToken, string stripeEma
{
// mail admin when have new email
var email1 = new EmailService.EmailService();
email1.Send("hytranluan@gmail.com", "hytranluan@gmail.com",
"ĐƠN HÀNG MỚI", $"Mã đơn hàng là <strong>{result}</strong>, nhấn vào <a href='" + "https://localhost:5002/Order/Detail?orderId=" + result + "'>đây</a> để đến trang quản lý đơn hàng này.");
email1.Send("nguyenthanhtoanx2@gmail.com", "nguyenthanhtoanx2@gmail.com",
"ĐƠN HÀNG MỚI", $"Mã đơn hàng là <strong>{result}</strong>, nhấn vào <a href='" + "https://localhost:9002/Order/Detail?orderId=" + result + "'>đây</a> để đến trang quản lý đơn hàng này.");

var orderSummaryHtml = "<table border='1' style='border-collapse:collapse'>"
+ "<thead>"
Expand Down Expand Up @@ -422,7 +422,7 @@ public async Task<IActionResult> Processing(string stripeToken, string stripeEma

var userMail = claims.FirstOrDefault(x => x.Type == ClaimTypes.Email).Value;
var email2 = new EmailService.EmailService();
email2.Send("hytranluan@gmail.com", userMail,
email2.Send("nguyenthanhtoanx2@gmail.com", userMail,
"ĐẶT HÀNG THÀNH CÔNG",
templateHtml
+ orderSummaryHtml
Expand Down
6 changes: 6 additions & 0 deletions eShopSolution.WebApp/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,11 @@ private ClaimsPrincipal ValidateToken(string jwtToken)
// trả về một principal có token đã giải mã
return principal;
}

[HttpGet]
public IActionResult About()
{
return View();
}
}
}
4 changes: 2 additions & 2 deletions eShopSolution.WebApp/Controllers/LoginController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public async Task<IActionResult> Register(RegisterRequest registerRequest)
// "your_email_here", "your_password_here");

var email = new EmailService.EmailService();
email.Send("hytranluan@gmail.com", user.ResultObj.Email, "XÁC NHẬN TÀI KHOẢN", confirmationLink);
email.Send("nguyenthanhtoanx2@gmail.com", user.ResultObj.Email, "XÁC NHẬN TÀI KHOẢN", confirmationLink);
return RedirectToAction(nameof(SuccessRegistration));
}

Expand Down Expand Up @@ -184,7 +184,7 @@ public async Task<IActionResult> ForgotPassword(ForgotPasswordViewModel request)
// "your_email_here", "your_password_here");

var email = new EmailService.EmailService();
email.Send("hytranluan@gmail.com", request.Email, "Link khôi phục mật khẩu", passwordResetLink);
email.Send("nguyenthanhtoanx2@gmail.com", request.Email, "Link khôi phục mật khẩu", passwordResetLink);

return View("ForgotPasswordConfirmation");
}
Expand Down
20 changes: 20 additions & 0 deletions eShopSolution.WebApp/Views/Home/About.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@model HomeViewModel
@{
ViewData["Title"] = "About";
Layout = "~/Views/Shared/_Layout.cshtml";
}

<li>
<div class="tg-linkstitle">
<h2>Art Forms</h2>
</div>
<ul>
<li><a href="products.html">Consectetur adipisicing</a></li>
<li><a href="products.html">Aelit sed do eiusmod</a></li>
<li><a href="products.html">Tempor incididunt labore</a></li>
<li><a href="products.html">Dolore magna aliqua</a></li>
<li><a href="products.html">Ut enim ad minim</a></li>
</ul>
<a class="tg-btnviewall" href="products.html">View All</a>
</li>

2 changes: 1 addition & 1 deletion eShopSolution.WebApp/Views/Product/Detail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<div id="product-tab">
<!-- product tab nav -->
<ul class="tab-nav">
<li class="active"><a data-toggle="tab" href="#tab1">Chi tiết sản phẩm</a></li>
<li class="active"><a data-toggle="tab" href="#tab1">Thông tin sản phẩm</a></li>
<li><a data-toggle="tab" href="#tab2">Chi tiết sản phẩm</a></li>
<li><a data-toggle="tab" href="#tab3">Đánh giá</a></li>
</ul>
Expand Down
Loading