158 lines
6.7 KiB
Plaintext
158 lines
6.7 KiB
Plaintext
@page
|
|
@model ServiceHost.Areas.AdminNew.Pages.Company.ExcelUpload.IndexModel
|
|
@{
|
|
ViewData["Title"] = "بارگذاری فایل اکسل";
|
|
}
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">بارگذاری و بررسی فایل اکسل</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="post" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<label for="ExcelFile">انتخاب فایل اکسل (ستون B و C از ردیف 2 به بعد خوانده میشود):</label>
|
|
<input type="file" class="form-control" id="ExcelFile" name="ExcelFile" accept=".xlsx,.xls" required />
|
|
</div>
|
|
<button type="submit" asp-page-handler="UploadExcel" class="btn btn-primary">بارگذاری و پردازش</button>
|
|
</form>
|
|
|
|
@if (!string.IsNullOrEmpty(Model.Message))
|
|
{
|
|
<div class="alert alert-info mt-3" role="alert">
|
|
@Model.Message
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if (Model.HasProcessed)
|
|
{
|
|
<div class="row mt-4">
|
|
<!-- دسته اول: فایلهایی که در اکسل هستند -->
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<div class="card-header bg-success text-white">
|
|
<h4 class="card-title mb-0">فایلهای موجود در اکسل (@Model.FoundInExcel.Count مورد)</h4>
|
|
</div>
|
|
<div class="card-body" style="max-height: 600px; overflow-y: auto;">
|
|
@if (Model.FoundInExcel.Any())
|
|
{
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>ردیف</th>
|
|
<th>شناسه</th>
|
|
<th>شماره بایگانی</th>
|
|
<th>رده پرونده</th>
|
|
<th>وضعیت</th>
|
|
<th>عملیات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@{
|
|
int index = 1;
|
|
}
|
|
@foreach (var item in Model.FoundInExcel)
|
|
{
|
|
<tr>
|
|
<td>@index</td>
|
|
<td>@item.ArchiveNo</td>
|
|
<td>@item.FileClass</td>
|
|
<td>@(item.Status == 2 ? "فعال" : "غیرفعال")</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-primary">ویرایش</button>
|
|
</td>
|
|
</tr>
|
|
index++;
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
else
|
|
{
|
|
<p class="text-muted">هیچ موردی یافت نشد.</p>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- دسته دوم: فایلهایی که در اکسل نیستند -->
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<div class="card-header bg-warning text-dark">
|
|
<h4 class="card-title mb-0">فایلهای غیرموجود در اکسل (@Model.NotFoundInExcel.Count مورد)</h4>
|
|
</div>
|
|
<div class="card-body" style="max-height: 600px; overflow-y: auto;">
|
|
@if (Model.NotFoundInExcel.Any())
|
|
{
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>ردیف</th>
|
|
<th>شناسه</th>
|
|
<th>شماره بایگانی</th>
|
|
<th>رده پرونده</th>
|
|
<th>وضعیت</th>
|
|
<th>عملیات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@{
|
|
int index2 = 1;
|
|
}
|
|
@foreach (var item in Model.NotFoundInExcel)
|
|
{
|
|
<tr>
|
|
<td>@index2</td>
|
|
<td>@item.ArchiveNo</td>
|
|
<td>@item.FileClass</td>
|
|
<td>@(item.Status == 2 ? "فعال" : "غیرفعال")</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-primary">ویرایش</button>
|
|
</td>
|
|
</tr>
|
|
index2++;
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
else
|
|
{
|
|
<p class="text-muted">هیچ موردی یافت نشد.</p>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
|
|
<style>
|
|
.card {
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.card-header {
|
|
border-radius: 8px 8px 0 0;
|
|
}
|
|
|
|
.table {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.table thead th {
|
|
position: sticky;
|
|
top: 0;
|
|
background-color: #f8f9fa;
|
|
z-index: 10;
|
|
}
|
|
</style>
|
|
|