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

Update MechanicAcceptance page in manager. #202

Merged
merged 14 commits into from
Oct 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion CheckDrive.Web/CheckDrive.Web/Views/Accounts/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ViewData["Title"] = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Ishchilar</h2>
<h1>Ishchilar</h1>

<form asp-controller="Accounts" asp-action="Index">
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>Mexanik (Qabul qiluvchi)</h1>

<form asp-controller="MechanicAcceptances" asp-action="Index">
<div class="row">
<div class="d-flex justify-content-between">
Expand Down Expand Up @@ -44,16 +42,12 @@
<div class="col-12">
<ejs-grid id="mechanicAcceptances-list" dataSource="@ViewBag.MechanicAcceptances" gridLines="Vertical" allowSorting="true" dataBound="onDataBound">
<e-grid-columns>
<e-grid-column headerText="Mexanik F.I.SH" field="MechanicName" type="string"></e-grid-column>
<e-grid-column headerText="Haydovchi F.I.SH" field="DriverName" type="string"></e-grid-column>
<e-grid-column headerText="Mashina" field="CarName" template="#template" type="string"></e-grid-column>
<e-grid-column headerText="Qabul qilish masofasi" field="Distance" type="number" width="90"></e-grid-column>
<e-grid-column headerText="Yoqilg`i qoldig`i" field="RemainingFuel" type="number" width="90"></e-grid-column>
<e-grid-column headerText="Ro'yxatdan o'tgan vaqt" field="Date" type="date" format="dd-MM-yyyy | HH:mm"></e-grid-column>
<e-grid-column headerText="Qabul qilish" field="IsAccepted" type="string" width="100"></e-grid-column>
<e-grid-column headerText="Izoh" field="Comments" type="string"></e-grid-column>
<e-grid-column headerText="Status" field="Status" type="string"></e-grid-column>
<e-grid-column width="100" type="text" textAlign="Center" template="#actionTemplate"></e-grid-column>
<e-grid-column headerText="Id" field="Id" template="#templat" type="number" textAlign=Center headerTextAlign=Center width="50"></e-grid-column>
<e-grid-column headerText="Mexanik F.I.SH" field="MechanicName" type="string" textAlign=Center headerTextAlign=Center width="200"></e-grid-column>
<e-grid-column headerText="Haydovchi F.I.SH" field="DriverName" type="string" textAlign=Center headerTextAlign=Center width="200"></e-grid-column>
<e-grid-column headerText="Mashina" field="CarName" template="#template" type="string" textAlign=Center headerTextAlign=Center></e-grid-column>
<e-grid-column headerText="Ro'yxatdan o'tgan vaqt" field="Date" type="date" format="dd-MM-yyyy | HH:mm" textAlign=Center headerTextAlign=Center></e-grid-column>
<e-grid-column headerText="Status" field="Status" template="#statusColumnTemplate" textAlign=Center headerTextAlign=Center width="100"></e-grid-column>
</e-grid-columns>
</ejs-grid>
</div>
Expand Down Expand Up @@ -158,8 +152,20 @@
}
</script>

<script id="statusColumnTemplate" type="text/x-template">
${if(Status == 0)}
<span class="badge bg-warning">Kutilmoqda</span>
${else if(Status == 1)}
<span class="badge bg-success">Yakunlangan</span>
${else if(Status == 2)}
<span class="badge bg-danger">Rad etilgan</span>
${else if(Status == 4)}
<span class="badge bg-danger">Haydovchi tomonidan rad etilgan</span>
${/if}
</script>

<script type="text/x-template" id="actionTemplate">
<button type="button" class="shadow-sm bg-white rounded e-btn e-flat mx-2" title="Tafsilot" onclick="onDetailsClick(${Id})">
<i class="bi bi-card-list text-info" style="font-size: 19px;"></i>
</button>
</script>
</script>
9 changes: 2 additions & 7 deletions CheckDrive.Web/CheckDrive.Web/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,14 @@ body {
border-radius: 10px;
}

.e-grid .e-gridcontent, .e-grid .e-table {
background-color: white;
}

.e-grid .e-gridheader {
border: 5px;
border-radius:50px;
padding: 10px;
background-color: ghostwhite;
}

.e-grid .e-row:hover .e-rowcell {
background-color: rgb(204, 229, 255) !important;
.e-grid .e-gridcontent, .e-grid .e-table {
background-color: #fafafa;
}

.e-grid .e-rowcell.e-selectionbackground {
Expand Down