Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vuthugiang update all #5

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
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
Binary file added .vs/FPT-store/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file added .vs/FPT-store/v16/.suo
Binary file not shown.
17 changes: 17 additions & 0 deletions FPT-DB/DAOs/CategoryDao.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<<<<<<< HEAD
using FptDB.DTOs;
using Microsoft.Data.SqlClient;
using System.Collections.Generic;
using System.Data;
=======
using System.Collections.Generic;
using System.Data;
using FptDB.DTOs;
using Microsoft.Data.SqlClient;
>>>>>>> master

namespace FptDB.DAOs
{
Expand All @@ -10,11 +17,18 @@ public class CategoryDao
public List<CategoryDto> GetAll()
{
var categories = new List<CategoryDto>();
<<<<<<< HEAD
using (var connection = DbUtil.GetConn())
{
var sql = "select id, name from categories";
using (var command = new SqlCommand(sql, connection))
=======
IDbConnection cnn = DbUtil.GetConn();
using (var connection = DbUtil.GetConn())
{
var query = "select id, name from categories";
using (var command = new SqlCommand(query, connection))
>>>>>>> master
{
connection.Open();
using (var reader = command.ExecuteReader())
Expand All @@ -29,7 +43,10 @@ public List<CategoryDto> GetAll()
}
}
}
<<<<<<< HEAD
=======

>>>>>>> master
return categories;
}
}
Expand Down
33 changes: 32 additions & 1 deletion FPT-DB/DAOs/ProductDao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,18 @@ public List<ProductDto> GetByCategory(string cateName)

using (var connection = DbUtil.GetConn())
{
using (var command = new SqlCommand())
using (var command = new SqlCommand("GetProductsByCategory", connection))
{
<<<<<<< HEAD
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@CategoryName", cateName);
connection.Open();
using (var reader = command.ExecuteReader())
{
while (reader.Read()) products.Add(initProduct(reader));
}
=======
>>>>>>> master
}
}

Expand Down Expand Up @@ -86,6 +96,27 @@ public List<ProductDto> GetByBrand(string brandName)
return products;
}

public List<ProductDto> GetByName(string productName)
{
var products = new List<ProductDto>();

using (var connection = DbUtil.GetConn())
{
using (var command = new SqlCommand("GetProductByName", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@Name", productName);
connection.Open();
using (var reader = command.ExecuteReader())
{
while (reader.Read()) products.Add(initProduct(reader));
}
}
}

return products;
}

private ProductDto initProduct(SqlDataReader reader)
{
var id = reader.GetString("id");
Expand Down
Binary file modified FPT-DB/obj/Debug/netcoreapp3.1/FPT-DB.assets.cache
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f9c16dafe20721e567c8fc01cc2604f7c7a7f711
d7e3f45630bf17fd4032e7b618b9cbebb47fc0f1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ D:/FPT/CN5/PRN292/FPT-store/FPT-DB/obj/Debug/netcoreapp3.1/FPT-DB.AssemblyInfo.c
D:/FPT/CN5/PRN292/FPT-store/FPT-DB/obj/Debug/netcoreapp3.1/FPT-DB.csproj.CoreCompileInputs.cache
D:/FPT/CN5/PRN292/FPT-store/FPT-DB/obj/Debug/netcoreapp3.1/FPT-DB.dll
D:/FPT/CN5/PRN292/FPT-store/FPT-DB/obj/Debug/netcoreapp3.1/FPT-DB.pdb
<<<<<<< HEAD
D:\Code\PRN292-Code\PRN292-SE1406-WebBanDienThoai\FPT-store\FPT-DB\bin\Debug\netcoreapp3.1\FPT-DB.deps.json
D:\Code\PRN292-Code\PRN292-SE1406-WebBanDienThoai\FPT-store\FPT-DB\bin\Debug\netcoreapp3.1\FPT-DB.dll
D:\Code\PRN292-Code\PRN292-SE1406-WebBanDienThoai\FPT-store\FPT-DB\bin\Debug\netcoreapp3.1\FPT-DB.pdb
Expand All @@ -25,3 +26,11 @@ D:\Code\PRN292-Code\PRN292-SE1406-WebBanDienThoai\FPT-store\FPT-DB\obj\Debug\net
D:\Code\PRN292-Code\PRN292-SE1406-WebBanDienThoai\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.csproj.CoreCompileInputs.cache
D:\Code\PRN292-Code\PRN292-SE1406-WebBanDienThoai\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.dll
D:\Code\PRN292-Code\PRN292-SE1406-WebBanDienThoai\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.pdb
=======
D:\FPT\CN5\PRN292\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.csprojAssemblyReference.cache
D:\FPT\CN5\PRN292\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.AssemblyInfoInputs.cache
D:\FPT\CN5\PRN292\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.AssemblyInfo.cs
D:\FPT\CN5\PRN292\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.csproj.CoreCompileInputs.cache
D:\FPT\CN5\PRN292\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.dll
D:\FPT\CN5\PRN292\FPT-store\FPT-DB\obj\Debug\netcoreapp3.1\FPT-DB.pdb
>>>>>>> b3aafa1a42c7575536cba450799c130aeada744a
Binary file not shown.
16 changes: 8 additions & 8 deletions FPT-DB/obj/FPT-DB.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"format": 1,
"restore": {
"D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\FPT-DB.csproj": {}
"D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\FPT-DB.csproj": {}
},
"projects": {
"D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\FPT-DB.csproj": {
"D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\FPT-DB.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"projectUniqueName": "D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"projectName": "FPT-DB",
"projectPath": "D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"packagesPath": "C:\\Users\\jiahn\\.nuget\\packages\\",
"outputPath": "D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\obj\\",
"projectPath": "D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"packagesPath": "C:\\Users\\MY HP\\.nuget\\packages\\",
"outputPath": "D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\jiahn\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\MY HP\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
Expand Down Expand Up @@ -62,7 +62,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.402\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions FPT-DB/obj/FPT-DB.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\jiahn\.nuget\packages\</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\MY HP\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.7.0</NuGetToolVersion>
</PropertyGroup>
Expand All @@ -16,6 +16,6 @@
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgNewtonsoft_Json Condition=" '$(PkgNewtonsoft_Json)' == '' ">C:\Users\jiahn\.nuget\packages\newtonsoft.json\10.0.1</PkgNewtonsoft_Json>
<PkgNewtonsoft_Json Condition=" '$(PkgNewtonsoft_Json)' == '' ">C:\Users\MY HP\.nuget\packages\newtonsoft.json\10.0.1</PkgNewtonsoft_Json>
</PropertyGroup>
</Project>
24 changes: 16 additions & 8 deletions FPT-DB/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4421,19 +4421,19 @@
]
},
"packageFolders": {
"C:\\Users\\jiahn\\.nuget\\packages\\": {}
"C:\\Users\\MY HP\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"projectUniqueName": "D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"projectName": "FPT-DB",
"projectPath": "D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"packagesPath": "C:\\Users\\jiahn\\.nuget\\packages\\",
"outputPath": "D:\\Code\\PRN292-Code\\PRN292-SE1406-WebBanDienThoai\\FPT-store\\FPT-DB\\obj\\",
"projectPath": "D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\FPT-DB.csproj",
"packagesPath": "C:\\Users\\MY HP\\.nuget\\packages\\",
"outputPath": "D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\jiahn\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\MY HP\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
Expand Down Expand Up @@ -4481,8 +4481,16 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.402\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json"
}
}
}
},
"logs": [
{
"code": "Undefined",
"level": "Warning",
"warningLevel": 1,
"message": "Problem reading the cache file D:\\FPT\\CN5\\PRN292\\FPT-store\\FPT-DB\\obj\\project.nuget.cache : Invalid property identifier character: <. Path 'version', line 3, position 0."
}
]
}
Loading