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

Integration #207

Merged
merged 190 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
988c630
add font awesome files
jamshidbek-choriyev Sep 26, 2024
b265429
I updated the license version of syncfusion
jamshidbek-choriyev Sep 26, 2024
a5356b9
some changes in the index
jamshidbek-choriyev Sep 26, 2024
f4c2c24
I updated the syncfusion key
jamshidbek-choriyev Sep 26, 2024
2e301f9
Sidebar changes
Boburm1rzo Sep 27, 2024
5056d34
Sidebar
Boburm1rzo Sep 29, 2024
53c2d19
Merge pull request #184 from DiyorMarket/177-update-sidebar-icons-and…
Mirazyzz Sep 30, 2024
e5d2ac4
I changed OilMark's Create to Pop-up output
jamshidbek-choriyev Oct 1, 2024
dda93c3
changed and added the modal companet
jamshidbek-choriyev Oct 1, 2024
0f40f2c
I made a pop-up when creating
jamshidbek-choriyev Oct 1, 2024
92ddd27
I changed the RenderSection to sync
jamshidbek-choriyev Oct 7, 2024
3c141b2
I have added additions and changes
jamshidbek-choriyev Oct 7, 2024
b40bfcd
I made a pop-up to create a car
jamshidbek-choriyev Oct 7, 2024
ac728d5
I created a pop-up to create a Doctor Review
jamshidbek-choriyev Oct 7, 2024
f01075c
I created a popup to create Mechanic Acceptances
jamshidbek-choriyev Oct 7, 2024
6f94b35
I created a popup to create Mechanic Handover
jamshidbek-choriyev Oct 7, 2024
18d2fe0
I created a popup to create Operator Review
jamshidbek-choriyev Oct 7, 2024
2c644d4
Update Create.cshtml
jamshidbek-choriyev Oct 7, 2024
d58893a
Update Index.cshtml
jamshidbek-choriyev Oct 7, 2024
c18b7ba
Update CreateByButton.cshtml
jamshidbek-choriyev Oct 7, 2024
80eec22
Update Create.cshtml
jamshidbek-choriyev Oct 7, 2024
c23b4b9
Update Create.cshtml
jamshidbek-choriyev Oct 7, 2024
de931b2
Merge branch 'integration' into master
Ramadan1011 Oct 7, 2024
5624c7f
Update PersonalIndex.cshtml
jamshidbek-choriyev Oct 8, 2024
92ab9de
deleted empty line
Boburm1rzo Oct 8, 2024
3bb8529
dashboard controller changes
Boburm1rzo Oct 8, 2024
d1cf035
Dashboard ViewModel changes
Boburm1rzo Oct 8, 2024
8763bac
dahsboard index page
Boburm1rzo Oct 8, 2024
045f55e
added navbar in layout
Boburm1rzo Oct 8, 2024
9a1e9f3
update sidebar
Boburm1rzo Oct 8, 2024
e5138c2
css files
Boburm1rzo Oct 8, 2024
46e59c0
dropdown function in js
Boburm1rzo Oct 8, 2024
d41ecba
update css
Boburm1rzo Oct 8, 2024
6134b6a
errors have been corrected
jamshidbek-choriyev Oct 8, 2024
639c40e
I created a new employee popup
jamshidbek-choriyev Oct 8, 2024
c4cfaa3
renamed from PetrolCount to OilCount
Boburm1rzo Oct 8, 2024
d9e7b37
errors have been corrected
jamshidbek-choriyev Oct 8, 2024
131ce02
changed
jamshidbek-choriyev Oct 8, 2024
87e3429
add and changed
jamshidbek-choriyev Oct 8, 2024
b86ffa2
errors have been corrected
jamshidbek-choriyev Oct 8, 2024
c6271e3
edit page, a pop-up appeared
jamshidbek-choriyev Oct 11, 2024
59673fb
dashboard index
Boburm1rzo Oct 11, 2024
ad0aba2
I placed the LoginViewModel in a separate Login folder
Boburm1rzo Oct 11, 2024
3261ef2
DashboardViewModel moved to Dashboard folder
Boburm1rzo Oct 11, 2024
51eefb5
ViewModels
Boburm1rzo Oct 11, 2024
284d67f
removed unused usings
Boburm1rzo Oct 11, 2024
ae543e7
enums
Boburm1rzo Oct 11, 2024
259b42d
Update "Ishchilar" text size
diyorzz Oct 13, 2024
017286d
Update MechanicAcceptance page in manager.
diyorzz Oct 13, 2024
e4af552
Css file
Boburm1rzo Oct 13, 2024
f2ca5b8
dashboard view page
Boburm1rzo Oct 13, 2024
45ec083
OilCount->OilMarkViewModel
Boburm1rzo Oct 13, 2024
21dd58e
I moved the creation of models to MockStore
Boburm1rzo Oct 13, 2024
7874dac
MockDashboardStore
Boburm1rzo Oct 13, 2024
7ed4a3a
OilMark->Name
Boburm1rzo Oct 13, 2024
8dceb95
add IMockDashboardStore to services
Boburm1rzo Oct 13, 2024
21f28fa
changes in Dashboard Controller
Boburm1rzo Oct 13, 2024
c5aea58
Update background color
diyorzz Oct 15, 2024
d12a48f
delete the unnecessary columns
diyorzz Oct 15, 2024
d81ef4f
delete the unnecessary codes
diyorzz Oct 15, 2024
6c8666a
Update DoctorReview page in manager
diyorzz Oct 15, 2024
4d52afa
Delete text
diyorzz Oct 15, 2024
ade85d2
delete "Mexanik (Qabul qiluvchi) text
diyorzz Oct 15, 2024
7a506f7
Update MechanicHandover in manager.
diyorzz Oct 15, 2024
dd371c9
Update OperatorReview page in manager.
diyorzz Oct 15, 2024
982a144
Udpate DispatcherReview in manager.
diyorzz Oct 15, 2024
6751455
I changed the type of the Amount property in OilMarkViewModel from in…
Boburm1rzo Oct 15, 2024
b686095
Merge pull request #199 from DiyorMarket/178-redesign-dashboard-with-…
Mirazyzz Oct 15, 2024
af0ba5a
Merge pull request #206 from DiyorMarket/Update-DispatcherReview-page…
Mirazyzz Oct 15, 2024
f5f9543
Merge pull request #205 from DiyorMarket/Update-OperatorReviews-page-…
Mirazyzz Oct 15, 2024
87f40a4
Merge pull request #204 from DiyorMarket/Update-MechanicHandover-in-m…
Mirazyzz Oct 15, 2024
5531fd1
Merge pull request #203 from DiyorMarket/Update-DoctorReview-page-in-…
Mirazyzz Oct 15, 2024
4cc06b0
Update "Ishchilar" text size
diyorzz Oct 13, 2024
406a647
Update MechanicAcceptance page in manager.
diyorzz Oct 13, 2024
3162619
changed
jamshidbek-choriyev Oct 16, 2024
1792d4f
changed
jamshidbek-choriyev Oct 16, 2024
1f5941a
add form-select to classes
jamshidbek-choriyev Oct 16, 2024
a69081e
changed
jamshidbek-choriyev Oct 16, 2024
655f089
added form-select to classes
jamshidbek-choriyev Oct 16, 2024
74f2e6b
changed
jamshidbek-choriyev Oct 16, 2024
59268f2
changed
jamshidbek-choriyev Oct 16, 2024
ebef5a5
Update background color
diyorzz Oct 15, 2024
5fdb878
delete the unnecessary columns
diyorzz Oct 15, 2024
25a322f
delete the unnecessary codes
diyorzz Oct 15, 2024
f4febca
delete "Mexanik (Qabul qiluvchi) text
diyorzz Oct 15, 2024
02f8df6
Merge branch 'Update-MechanicAcceptance-page-in-manager-' of https://…
diyorzz Oct 17, 2024
af4a4f8
Update Edit.cshtml
jamshidbek-choriyev Oct 18, 2024
80a0998
Update Index.cshtml
jamshidbek-choriyev Oct 18, 2024
e588f46
Merge branch 'integration' into master
jamshidbek-choriyev Oct 18, 2024
09a562b
site js
Boburm1rzo Oct 19, 2024
8e09b87
error layout for error pages
Boburm1rzo Oct 19, 2024
be3e8e5
update authController
Boburm1rzo Oct 19, 2024
e4a6140
configuration services
Boburm1rzo Oct 19, 2024
f24facc
Update DoctorReviewDataStore
Boburm1rzo Oct 19, 2024
5ac807f
added Menu Service and CurrentUser service
Boburm1rzo Oct 19, 2024
3904c54
DispatcherReviews PersonalIndex and History pages updated
Boburm1rzo Oct 19, 2024
5517da6
DoctorReview PersonalIndex and History pages updated
Boburm1rzo Oct 19, 2024
8de9579
Mechanic Personal Index and History pages updated
Boburm1rzo Oct 19, 2024
c343a96
OperatorReview Personal Index and History pages updated
Boburm1rzo Oct 19, 2024
3916217
Personal Layout changes
Boburm1rzo Oct 19, 2024
f5c9b75
Update SideBar Layout
Boburm1rzo Oct 19, 2024
010d067
An icon was added to change grids and display details
jamshidbek-choriyev Oct 19, 2024
7634149
fixed
Boburm1rzo Oct 19, 2024
4f9aace
Merge pull request #211 from DiyorMarket/An-icon-was-added-to-change-…
Mirazyzz Oct 19, 2024
5cae0cc
Merge pull request #210 from DiyorMarket/The-sidebar-should-be-separa…
Mirazyzz Oct 19, 2024
c1c16f2
Merge branch 'integration' into master
jamshidbek-choriyev Oct 19, 2024
3e2b917
Merge branch 'integration' into Update-MechanicAcceptance-page-in-man…
diyorzz Oct 20, 2024
aeb380e
Update Edit.cshtml
jamshidbek-choriyev Oct 20, 2024
939c028
Merge pull request #202 from DiyorMarket/Update-MechanicAcceptance-pa…
diyorzz Oct 20, 2024
416b6f6
Update Index.cshtml
jamshidbek-choriyev Oct 20, 2024
f9d1e15
Merge pull request #198 from jamshidbek7375/master
Mirazyzz Oct 20, 2024
38e89c7
created popup for account details
Ramadan1011 Oct 26, 2024
ba31cfa
created popup for car details
Ramadan1011 Oct 26, 2024
44ab05a
created popup for dispatcher-reviews details
Ramadan1011 Oct 26, 2024
6f35a56
ccreae popup for doctor-reviews details
Ramadan1011 Oct 26, 2024
f529f4d
ccreae popup for mechanic-acceptances-reviews details
Ramadan1011 Oct 26, 2024
81483f3
ccreae popup for mechanic-handovers-reviews details
Ramadan1011 Oct 26, 2024
5bf8321
deleted unnecessary view page
Ramadan1011 Oct 26, 2024
08945c5
create popup for operator-reviews details
Ramadan1011 Oct 26, 2024
fdb14e2
ccreae popup for mechanic-handover-reviews details
Ramadan1011 Oct 26, 2024
029e468
added some styling for improving popup appearence
Ramadan1011 Oct 26, 2024
ee53e99
changed layout to null all reviews
Ramadan1011 Oct 28, 2024
8a2af53
Merge pull request #212 from DiyorMarket/open-details-pages-in-a-moda…
Ramadan1011 Oct 30, 2024
a986fb4
bugs fixed
jamshidbek-choriyev Nov 1, 2024
7ed4cdc
bugs fixed, and edit and delete popup
jamshidbek-choriyev Nov 1, 2024
93f0708
Update _ModalForLayout.cshtml
jamshidbek-choriyev Nov 1, 2024
17dc481
GETRoles replase GetRolesAsync
jamshidbek-choriyev Nov 2, 2024
4bf34ce
changed and bugs fixed
jamshidbek-choriyev Nov 2, 2024
35b92c5
Update Delete.cshtml
jamshidbek-choriyev Nov 3, 2024
c80f4c4
fixed bugs in sidebar
Boburm1rzo Nov 4, 2024
4b7d3db
Merge branch 'integration' into 213-the-sidebar-element-should-be-cha…
Boburm1rzo Nov 4, 2024
2c99963
Merge pull request #217 from DiyorMarket/213-the-sidebar-element-shou…
Boburm1rzo Nov 5, 2024
7255713
Merge pull request #215 from DiyorMarket/pop-up-output-when-clicking-…
jamshidbek-choriyev Nov 6, 2024
9629005
Debts stores
Boburm1rzo Nov 16, 2024
d019939
css and js
Boburm1rzo Nov 16, 2024
608be63
debts page and grid
Boburm1rzo Nov 16, 2024
b48642f
debts viewModels and mock debts store
Boburm1rzo Nov 16, 2024
8c5e2e6
added debts url in sidebar
Boburm1rzo Nov 16, 2024
f4eb3f6
DI
Boburm1rzo Nov 16, 2024
ebe8617
dashboard controller
Boburm1rzo Nov 16, 2024
a59e00d
bugs fixed
jamshidbek-choriyev Nov 17, 2024
4c3af55
js and css files
Boburm1rzo Nov 20, 2024
9376587
debts page changes
Boburm1rzo Nov 20, 2024
5967166
debts grid in dashboard
Boburm1rzo Nov 20, 2024
b0f9aaa
debts viewModel
Boburm1rzo Nov 20, 2024
31f53ed
DebtsStore
Boburm1rzo Nov 20, 2024
101a185
Debts Controller fixed bugs
Boburm1rzo Nov 20, 2024
24c25ee
Merge pull request #226 from DiyorMarket/224-create-debts-page
Boburm1rzo Nov 21, 2024
01ecdff
removed header text from debts
Boburm1rzo Nov 23, 2024
2044a73
Employees page changes
Boburm1rzo Nov 23, 2024
d734ead
trash bin icon color
Boburm1rzo Nov 23, 2024
3ec0d24
Cars page
Boburm1rzo Nov 24, 2024
a69d4e2
DoctorReviews page
Boburm1rzo Nov 24, 2024
45bf0d0
defects corrected
Boburm1rzo Nov 26, 2024
b189def
changes in OilMarks page
Boburm1rzo Nov 26, 2024
21c0db8
mechanic handover page
Boburm1rzo Nov 26, 2024
7869eb9
Mechanic Acceptance page
Boburm1rzo Nov 26, 2024
951d53f
operatorReview page
Boburm1rzo Nov 26, 2024
961b8ae
fix bug in download button
Boburm1rzo Nov 26, 2024
9b3adc7
fix bug in download button
Boburm1rzo Nov 26, 2024
06f9223
Dispatcher review page
Boburm1rzo Nov 26, 2024
90d2ae0
Update Index.cshtml
Boburm1rzo Nov 26, 2024
9ba141f
filter and search using javascript
Ramadan1011 Dec 2, 2024
03f96be
search using javascript
Ramadan1011 Dec 3, 2024
1cdfb6a
update dispatcher page
Boburm1rzo Dec 3, 2024
bd282e6
update mechanic handovers grids headers
Boburm1rzo Dec 3, 2024
5e94d38
update mechanic acceptance headers in grid
Boburm1rzo Dec 3, 2024
51946d0
Update grid headers
Boburm1rzo Dec 3, 2024
66a53e8
update grid headers
Boburm1rzo Dec 3, 2024
c990bef
CheckPoint
aXayitov Dec 4, 2024
2f3f30e
Added CheckPointDetails page
aXayitov Dec 5, 2024
e713997
changed and fixed
aXayitov Dec 6, 2024
e4bbb0e
Merge pull request #244 from DiyorMarket/239-update-dispatcherreview-…
Mirazyzz Dec 8, 2024
9563f49
Merge pull request #243 from DiyorMarket/update-operatorreview-page
Mirazyzz Dec 8, 2024
c39a427
Merge pull request #242 from DiyorMarket/237-update-mechanicaccepenta…
Mirazyzz Dec 8, 2024
d66e366
Merge pull request #241 from DiyorMarket/update-mechanichandover-page
Mirazyzz Dec 8, 2024
191bff2
Merge pull request #240 from DiyorMarket/update-oilmarks-page
Mirazyzz Dec 8, 2024
081fff5
Merge pull request #234 from DiyorMarket/Update-doctorsreview-page
Mirazyzz Dec 8, 2024
cc69ea0
Merge pull request #233 from DiyorMarket/update-cars-page
Mirazyzz Dec 8, 2024
ca6b4ac
Merge pull request #231 from DiyorMarket/Update-employee-page
Mirazyzz Dec 8, 2024
4a8c225
Merge pull request #228 from DiyorMarket/jamshid's-branch
Mirazyzz Dec 8, 2024
a74ceab
.
aXayitov Dec 11, 2024
2b562ee
.
aXayitov Dec 11, 2024
888daf5
search and filter using javascript
Ramadan1011 Dec 22, 2024
07105fb
Merge pull request #247 from DiyorMarket/search-and-filter-using-java…
Mirazyzz Dec 22, 2024
cbf4a5a
Merge branch 'integration' into CheckPoint
Boburm1rzo Dec 23, 2024
179f700
update checkpoints grid
Boburm1rzo Dec 23, 2024
ea6ded6
Merge branch 'CheckPoint' of https://github.com/DiyorMarket/CheckDriv…
Boburm1rzo Dec 23, 2024
af95f49
Update Index.cshtml
Boburm1rzo Dec 23, 2024
a59c926
Merge pull request #246 from DiyorMarket/CheckPoint
Mirazyzz Dec 23, 2024
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
27 changes: 25 additions & 2 deletions CheckDrive.Web/CheckDrive.Web/CheckDrive.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<Compile Include="Controllers\AccountsController.cs" />
<Compile Include="Controllers\AuthController.cs" />
<Compile Include="Controllers\CarsController.cs" />
<Compile Include="Controllers\CheckPointController.cs" />
<Compile Include="Controllers\DashboardController.cs" />
<Compile Include="Controllers\DebtsController.cs" />
<Compile Include="Controllers\DispatcherReviewsController.cs" />
<Compile Include="Controllers\DoctorReviewsController.cs" />
<Compile Include="Controllers\DoctorsController.cs" />
Expand All @@ -31,12 +33,33 @@
<Compile Include="Controllers\OperatorsController.cs" />
<Compile Include="Controllers\TechniciansController.cs" />
<None Include="wwwroot\css\LogOutButtun.css" />
<None Include="wwwroot\font-awesome\js\all.js" />
<None Include="wwwroot\font-awesome\js\all.min.js" />
<None Include="wwwroot\font-awesome\js\brands.js" />
<None Include="wwwroot\font-awesome\js\brands.min.js" />
<None Include="wwwroot\font-awesome\js\conflict-detection.js" />
<None Include="wwwroot\font-awesome\js\conflict-detection.min.js" />
<None Include="wwwroot\font-awesome\js\fontawesome.js" />
<None Include="wwwroot\font-awesome\js\fontawesome.min.js" />
<None Include="wwwroot\font-awesome\js\regular.js" />
<None Include="wwwroot\font-awesome\js\regular.min.js" />
<None Include="wwwroot\font-awesome\js\solid.js" />
<None Include="wwwroot\font-awesome\js\solid.min.js" />
<None Include="wwwroot\font-awesome\js\v4-shims.js" />
<None Include="wwwroot\font-awesome\js\v4-shims.min.js" />
<None Include="wwwroot\font-awesome\sprites\brands.svg" />
<None Include="wwwroot\font-awesome\sprites\regular.svg" />
<None Include="wwwroot\font-awesome\sprites\solid.svg" />
<None Include="wwwroot\font-awesome\webfonts\fa-brands-400.woff2" />
<None Include="wwwroot\font-awesome\webfonts\fa-regular-400.woff2" />
<None Include="wwwroot\font-awesome\webfonts\fa-solid-900.woff2" />
<None Include="wwwroot\font-awesome\webfonts\fa-v4compatibility.woff2" />
<PackageReference Include="CheckDrive.ApiContracts" Version="1.4.9" />
<PackageReference Include="CheckDrive.DTOs" Version="1.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.3" />
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="25.1.42" />
<PackageReference Include="Syncfusion.Licensing" Version="25.2.3" />
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="27.1.50" />
<PackageReference Include="Syncfusion.Licensing" Version="27.1.50" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.0" />
<PackageReference Include="System.Security.Claims" Version="4.3.0" />

Expand Down
2 changes: 1 addition & 1 deletion CheckDrive.Web/CheckDrive.Web/Constants/Configurations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public static class Configurations
{
public const string JwtToken = "JwtToken";
public const string SynfusionLicenseKey = "Mgo+DSMBMAY9C3t2UFhhQlJBfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTX5UdERiXX1ZcHNXRGFa";
public const string SynfusionLicenseKey = "Mgo+DSMBPh8sVXJzS0d+WFlPd11dXmJWd1p/THNYflR1fV9DaUwxOX1dQl9nSXdRc0VkW3pfdX1WQ2E=";
}
}
14 changes: 8 additions & 6 deletions CheckDrive.Web/CheckDrive.Web/Controllers/AccountsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task<IActionResult> Index(string? searchString, int? roleId, DateTi
{
var accounts = await _accountDataStore.GetAccountsAsync(searchString, roleId, birthDate, pageNumber);

var roles = await GETRoles();
var roles = await GetRolesAsync();

roles.Insert(0, new RoleDto
{
Expand Down Expand Up @@ -88,7 +88,7 @@ public async Task<IActionResult> Details(int id)
}
public async Task<IActionResult> Create()
{
var roles = await GETRoles();
var roles = await GetRolesAsync();
ViewBag.Roles = new SelectList(roles, "Id", "Name");
return View();
}
Expand All @@ -102,15 +102,17 @@ public async Task<IActionResult> Create([Bind("Login,Password,PhoneNumber,FirstN
var newAccount = await _accountDataStore.CreateAccountAsync(account);
return RedirectToAction("Details", new {id = newAccount.Id});
}
var roles = await GETRoles();
var roles = await GetRolesAsync();
ViewBag.Roles = new SelectList(roles, "Id", "Name");
return View(account);
}

public async Task<IActionResult> Edit(int id)
{
var account = await _accountDataStore.GetAccountAsync(id);

var roles = await GetRolesAsync();
ViewBag.Roles = new SelectList(roles, "Id", "Name");

return View(account);
}

Expand All @@ -122,7 +124,7 @@ public async Task<IActionResult> Edit(int id, [Bind("Id,Login,Password,PhoneNumb
if (ModelState.IsValid)
{
var newAccount = await _accountDataStore.UpdateAccountAsync(id, account);
return RedirectToAction("Details", new { id = newAccount.Id });
return RedirectToAction(nameof(Index));
}
return View(account);
}
Expand All @@ -145,7 +147,7 @@ public async Task<IActionResult> DeleteConfirmed(int id)
return RedirectToAction(nameof(Index));
}

private async Task<List<RoleDto>> GETRoles()
private async Task<List<RoleDto>> GetRolesAsync()
{
var roleResponse = await _roleStore.GetRoles();
var roles = roleResponse.Data.ToList();
Expand Down
23 changes: 11 additions & 12 deletions CheckDrive.Web/CheckDrive.Web/Controllers/AuthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,23 @@
{
if (HttpContext.Request.Cookies.TryGetValue("tasty-cookies", out _))
{
string token = HttpContext.Request.Cookies["tasty-cookies"];
var tokenHandler = new JwtSecurityTokenHandler();
var jwtToken = tokenHandler.ReadToken(token) as JwtSecurityToken;
if (jwtToken == null)
{
return RedirectToAction("Login", "Account");
}
var roleId = jwtToken.Claims.First(claim => claim.Type == ClaimTypes.Role).Value;
var accountId = jwtToken.Claims.First(claim => claim.Type == ClaimTypes.NameIdentifier).Value;
string token = HttpContext.Request.Cookies["tasty-cookies"];

Check warning on line 28 in CheckDrive.Web/CheckDrive.Web/Controllers/AuthController.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.
var tokenHandler = new JwtSecurityTokenHandler();
var jwtToken = tokenHandler.ReadToken(token) as JwtSecurityToken;
if (jwtToken == null)
{
return RedirectToAction("Login", "Account");
}
var roleId = jwtToken.Claims.First(claim => claim.Type == ClaimTypes.Role).Value;
var accountId = jwtToken.Claims.First(claim => claim.Type == ClaimTypes.NameIdentifier).Value;
int accountIds = Int32.Parse(accountId);

switch (roleId)
{
case "1":

TempData["UserName"] = _accountDataStore.GetAccountAsync(accountIds)
.Result.FirstName;
TempData.Keep("UserName");
TempData.Keep("UserName");
return RedirectToAction("Index", "Dashboard");
case "3":
TempData["AccountId"] = accountId;
Expand Down
4 changes: 2 additions & 2 deletions CheckDrive.Web/CheckDrive.Web/Controllers/CarsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public async Task<IActionResult> Create([Bind("Model,Color,Number,RemainingFuel,
if (ModelState.IsValid)
{
var newCar = await _carDataStore.CreateCarAsync(car);
return RedirectToAction("Details", new { id = newCar.Id });
return RedirectToAction(nameof(Index));
}
return View(car);
}
Expand All @@ -131,7 +131,7 @@ public async Task<IActionResult> Edit(int id, [Bind("Id,Model,Color,Number,Remai
if (ModelState.IsValid)
{
var newCar = await _carDataStore.UpdateCarAsync(id, car);
return RedirectToAction("Details", new { id = newCar.Id });
return RedirectToAction(nameof(Index));
}
return View(car);
}
Expand Down
20 changes: 20 additions & 0 deletions CheckDrive.Web/CheckDrive.Web/Controllers/CheckPointController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using CheckDrive.Web.Stores.SplineCharts;
using Microsoft.AspNetCore.Mvc;

namespace CheckDrive.Web.Controllers
{
public class CheckPointController : Controller
{
private readonly ICheckPointStore _checkPointStore;
public CheckPointController(ICheckPointStore checkPointStore)
{
_checkPointStore = checkPointStore ?? throw new ArgumentNullException(nameof(checkPointStore));
}
public ActionResult Index(int id)
{
var checkPoint = _checkPointStore.GetCheckPointById(id);

return View(checkPoint);
}
}
}
31 changes: 27 additions & 4 deletions CheckDrive.Web/CheckDrive.Web/Controllers/DashboardController.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using CheckDrive.Web.Stores.Accounts;
using CheckDrive.Web.Stores.Dashbord;
using CheckDrive.Web.ViewModels;
using CheckDrive.Web.Stores.Debts;
using CheckDrive.Web.Stores.MockDashboard;
using CheckDrive.Web.Stores.SplineCharts;
using CheckDrive.Web.ViewModels.Dashboard;
using Microsoft.AspNetCore.Mvc;
using NuGet.Common;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;

Expand All @@ -12,47 +14,68 @@ public class DashboardController : Controller
{
private readonly IDashboardStore _store;
private readonly IAccountDataStore _accountDataStore;
public DashboardController(IDashboardStore store, IAccountDataStore accountDataStore)
private readonly IMockDashboardStore _mockDashboardStore;
private readonly ICheckPointStore _checkPointStore;
public DashboardController(IDashboardStore store,
IAccountDataStore accountDataStore,
IMockDashboardStore mockDashboardStore,
ICheckPointStore checkPointStore)
{
_store = store;
_accountDataStore = accountDataStore;
_mockDashboardStore = mockDashboardStore;
_checkPointStore = checkPointStore;
}

public async Task<IActionResult> Index()
{
string token = HttpContext.Request.Cookies["tasty-cookies"];

var tokenHandler = new JwtSecurityTokenHandler();
var jwtToken = tokenHandler.ReadToken(token) as JwtSecurityToken;

if (jwtToken == null)
{
return RedirectToAction("Login", "Account");
}

var accountId = jwtToken.Claims.First(claim => claim.Type == ClaimTypes.NameIdentifier).Value;
int accountIds = Int32.Parse(accountId);

TempData["UserName"] = _accountDataStore.GetAccountAsync(accountIds)
.Result.FirstName;
TempData.Keep("UserName");

var dashboard = await _store.GetDashboard();
var mockDashboard = await _mockDashboardStore.GetDashboard();
var checkPoints = _checkPointStore.GetAll("");


dashboard.CheckPoints = checkPoints;
dashboard.OilAmount=mockDashboard.OilAmount;

if (dashboard is null)
{
return BadRequest();
}

SetViewBagProperties(dashboard);

return View();
}

private void SetViewBagProperties(DashboardViewModel dashboard)
{
var summary = dashboard.Summary;

ViewBag.MonthlyFuelConsumption = summary.MonthlyFuelConsumption.ToString("0.00");
ViewBag.CarsCount = summary.CarsCount;
ViewBag.DriversCount = summary.DriversCount;

ViewBag.EmployeesCountByRole = dashboard.EmployeesCountByRoles;
ViewBag.SplineChartData = dashboard.SplineCharts;
ViewBag.OilAmount=dashboard.OilAmount;
ViewBag.CheckPoint = dashboard.CheckPoints;
}
}
}
22 changes: 22 additions & 0 deletions CheckDrive.Web/CheckDrive.Web/Controllers/DebtsController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using CheckDrive.Web.Stores.Debts;
using Microsoft.AspNetCore.Mvc;

namespace CheckDrive.Web.Controllers;

public class DebtsController : Controller
{
private readonly IDebtsStore _store;
public DebtsController(IDebtsStore debtsStore)
{
_store = debtsStore ?? throw new ArgumentNullException(nameof(debtsStore));
}
public ActionResult Index(string? searchText, string? status)
{
var debts = _store.GetAll(searchText,status);

ViewBag.Status = _store.GetEnum();
ViewBag.SearchText = searchText;
ViewBag.SelectedStatus = status;
return View(debts);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async Task<IActionResult> Index(int? pageNumber, string? searchString, Da
r.DriverName,
r.DoctorName,
r.Date,
IsHealthy = (bool)r.IsHealthy ? "Sog`lom" : "Kasal",
IsHealthy = (bool)r.IsHealthy ? 1 : 0,
r.Comments
}).ToList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,7 @@ public async Task<IActionResult> Index(int? pageNumber, string? searchString, Da
ViewBag.HasPreviousPage = response.HasPreviousPage;
ViewBag.HasNextPage = response.HasNextPage;

var mechanicAcceptances = response.Data.Select(r => new
{
r.Id,
IsAccepted = (bool)r.IsAccepted ? "Qabul qilindi" : "Rad etildi",
r.Comments,
Status = ((StatusForDto)r.Status) switch
{
StatusForDto.Pending => "Kutilmoqda",
StatusForDto.Completed => "Yakunlangan",
StatusForDto.Rejected => "Rad etilgan",
StatusForDto.Unassigned => "Tayinlanmagan",
StatusForDto.RejectedByDriver => "Haydovchi tomonidan rad etilgan",
_ => "No`malum holat"
},
r.Date,
r.Distance,
r.DriverName,
r.MechanicName,
r.RemainingFuel,
r.CarName,
r.CarId
}).ToList();

ViewBag.MechanicAcceptances = mechanicAcceptances;
ViewBag.MechanicAcceptances = response.Data;

return View();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,7 @@ public async Task<IActionResult> Index(int? pageNumber, string? searchString, Da
ViewBag.HasPreviousPage = response.HasPreviousPage;
ViewBag.HasNextPage = response.HasNextPage;

var mechanicHandovers = response.Data.Select(r => new
{
r.Id,
IsHanded = (bool)r.IsHanded ? "Topshirildi" : "Topshirilmadi",
r.Comments,
Status = ((StatusForDto)r.Status) switch
{
StatusForDto.Pending => "Kutilmoqda",
StatusForDto.Completed => "Yakunlangan",
StatusForDto.Rejected => "Rad etilgan",
StatusForDto.Unassigned => "Tayinlanmagan",
StatusForDto.RejectedByDriver => "Haydovchi tomonidan rad etilgan",
_ => "No`malum holat"
},
r.Date,
r.Distance,
r.DriverName,
r.MechanicName,
r.RemainingFuel,
r.CarName,
r.CarId
}).ToList();

ViewBag.MechanicHandovers = mechanicHandovers;
ViewBag.MechanicHandovers = response.Data;

return View();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,16 @@
ViewBag.HasPreviousPage = operatorReviews.HasPreviousPage;
ViewBag.HasNextPage = operatorReviews.HasNextPage;

var operatorReviewss = operatorReviews.Data.Select(r => new
{
r.Id,
r.OperatorName,
r.DriverName,
r.OilAmount,
r.OilMarks,
CarModel = $"{r.CarModel} ({r.CarNumber})",
r.Date,
IsGiven = (bool)r.IsGiven ? "Quyildi" : "Quyilmadi",
r.Comments,
Status = ((StatusForDto)r.Status) switch
{
StatusForDto.Pending => "Kutilmoqda",
StatusForDto.Completed => "Yakunlangan",
StatusForDto.Rejected => "Rad etilgan",
StatusForDto.Unassigned => "Tayinlanmagan",
StatusForDto.RejectedByDriver => "Haydovchi tomonidan rad etilgan",
_ => "No`malum holat"
}
}).ToList();
ViewBag.OperatorsReview = operatorReviews.Data;

ViewBag.OperatorsReview = operatorReviewss;
return View();

}

public async Task<IActionResult> HistoryIndexForPersonalPage(int? pageNumber, string? searchString, DateTime? date)
{
var accountIdStr = TempData["AccountId"] as string;
TempData.Keep("AccountId");
int accountId = int.Parse(accountIdStr);

Check warning on line 56 in CheckDrive.Web/CheckDrive.Web/Controllers/OperatorReviewsController.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 's' in 'int int.Parse(string s)'.

var response = await _operatorReviewDataStore.GetOperatorReviews(pageNumber, searchString, date, null, null, accountId);

Expand Down Expand Up @@ -129,7 +107,7 @@
if (int.TryParse(accountIdStr, out int accountId))
{
var operatorResponse = await _operatorDataStore.GetOperators(accountId);
operatorr = operatorResponse.Data.First();

Check warning on line 110 in CheckDrive.Web/CheckDrive.Web/Controllers/OperatorReviewsController.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'source' in 'OperatorDto Enumerable.First<OperatorDto>(IEnumerable<OperatorDto> source)'.
}
ViewBag.OperatorId = operatorr.Id;

Expand All @@ -140,7 +118,7 @@
ViewBag.SelectedCarId = carId;
ViewBag.FuelTankCapacity = fuelTankCapacity ?? null;
ViewBag.RemainingFuel = remainingFuel ?? null;
ViewBag.OilMarks = oilMarks.Data.Select(o => new SelectListItem

Check warning on line 121 in CheckDrive.Web/CheckDrive.Web/Controllers/OperatorReviewsController.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'source' in 'IEnumerable<SelectListItem> Enumerable.Select<OilMarkDto, SelectListItem>(IEnumerable<OilMarkDto> source, Func<OilMarkDto, SelectListItem> selector)'.
{
Value = o.Id.ToString(),
Text = o.OilMark
Expand All @@ -148,7 +126,7 @@

var response = await _operatorReviewDataStore.GetOperatorReviews(null, null, null, null, 4, null);

ViewBag.Drivers = response.Data

Check warning on line 129 in CheckDrive.Web/CheckDrive.Web/Controllers/OperatorReviewsController.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'source' in 'IEnumerable<SelectListItem> Enumerable.Select<OperatorReviewDto, SelectListItem>(IEnumerable<OperatorReviewDto> source, Func<OperatorReviewDto, SelectListItem> selector)'.
.Select(d => new SelectListItem
{
Value = d.DriverId.ToString(),
Expand Down Expand Up @@ -176,7 +154,7 @@
public async Task<IActionResult> GetCarByDriverId(int driverId)
{
var response = await _operatorReviewDataStore.GetOperatorReviews(null, null, null, null, 4, null);
var handover = response.Data.FirstOrDefault(m => m.DriverId == driverId);

Check warning on line 157 in CheckDrive.Web/CheckDrive.Web/Controllers/OperatorReviewsController.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'source' in 'OperatorReviewDto? Enumerable.FirstOrDefault<OperatorReviewDto>(IEnumerable<OperatorReviewDto> source, Func<OperatorReviewDto, bool> predicate)'.

if (handover != null)
{
Expand Down Expand Up @@ -229,7 +207,7 @@
var cars = await _carDataStore.GetCarsAsync(1, null);
var oilMarks = await _oilMarkDataStore.GetOilMarksAsync();

ViewBag.DriverSelectList = new SelectList(drivers.Data.Select(driver => new

Check warning on line 210 in CheckDrive.Web/CheckDrive.Web/Controllers/OperatorReviewsController.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'source' in 'IEnumerable<<anonymous type: int Id, string DisplayText>> Enumerable.Select<DriverDto, <anonymous type: int Id, string DisplayText>>(IEnumerable<DriverDto> source, Func<DriverDto, <anonymous type: int Id, string DisplayText>> selector)'.
{
Id = driver.Id,
DisplayText = $"{driver.FirstName} {driver.LastName}"
Expand Down
Loading
Loading