diff --git a/UniversityBusinessLogic/BusinessLogics/ReportProviderLogic.cs b/UniversityBusinessLogic/BusinessLogics/ReportProviderLogic.cs
index 667ea89..8365723 100644
--- a/UniversityBusinessLogic/BusinessLogics/ReportProviderLogic.cs
+++ b/UniversityBusinessLogic/BusinessLogics/ReportProviderLogic.cs
@@ -79,7 +79,7 @@ namespace UniversityBusinessLogic.BusinessLogics
ReportStreamStudentEdStatPeriodViewModel reportData = new ReportStreamStudentEdStatPeriodViewModel();
reportData.StreamName = stream.Name;
- var students = _streamStorage.GetStreamStudents(new() { Id = stream.Id })
+ var students = _streamStorage.GetStreamStudents(new() { Id = stream.Id, DateFrom = model.DateFrom, DateTo = model.DateTo })
.Select(s => new StudentStatusViewModel()
{
StudentName = s.Name + " " + s.Surname,
@@ -131,7 +131,7 @@ namespace UniversityBusinessLogic.BusinessLogics
_mailSender.SendMailAsync(new ()
{
MailAddress = reportModel.UserEmail,
- Subject = "Отчет по комплектациям",
+ Subject = "Отчет по статусам обучения",
Text = $"За период с {reportModel.DateFrom.ToShortDateString()} " +
$"по {reportModel.DateTo.ToShortDateString()}.",
File = file
diff --git a/UniversityContracts/SearchModels/StreamSearchModel.cs b/UniversityContracts/SearchModels/StreamSearchModel.cs
index 08999eb..cfcfb52 100644
--- a/UniversityContracts/SearchModels/StreamSearchModel.cs
+++ b/UniversityContracts/SearchModels/StreamSearchModel.cs
@@ -12,5 +12,7 @@ namespace UniversityContracts.SearchModels
public int? UserId { get; set; }
public string? Name { get; set; }
public int? Course { get; set; }
+ public DateTime? DateFrom { get; set; }
+ public DateTime? DateTo { get; set; }
}
}
diff --git a/UniversityDataBaseImplemet/Implements/StreamStorage.cs b/UniversityDataBaseImplemet/Implements/StreamStorage.cs
index aa5daf6..d80c9f8 100644
--- a/UniversityDataBaseImplemet/Implements/StreamStorage.cs
+++ b/UniversityDataBaseImplemet/Implements/StreamStorage.cs
@@ -135,6 +135,7 @@ namespace UniversityDataBaseImplemet.Implements
using var context = new Database();
var students = context.StudentStreams
.Where(x => x.StreamId == model.Id)
+ .Where(x => x.Student.DateOfAddmission < model.DateTo && x.Student.DateOfAddmission >= model.DateFrom)
.Select(x => x.Student.GetViewModel)
.ToList();
return students;
diff --git a/UniversityProvider/Controllers/HomeController.cs b/UniversityProvider/Controllers/HomeController.cs
index 2289ac3..a877c41 100644
--- a/UniversityProvider/Controllers/HomeController.cs
+++ b/UniversityProvider/Controllers/HomeController.cs
@@ -164,6 +164,11 @@ namespace UniversityProvider.Controllers
APIClient.PostRequest("api/reportprovider/sendbymailstatusreport", reportModel);
}
+ public IActionResult Diagram()
+ {
+ return View();
+ }
+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
diff --git a/UniversityProvider/Views/Home/Diagram.cshtml b/UniversityProvider/Views/Home/Diagram.cshtml
new file mode 100644
index 0000000..414da93
--- /dev/null
+++ b/UniversityProvider/Views/Home/Diagram.cshtml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
diff --git a/UniversityProvider/Views/Shared/_Layout.cshtml b/UniversityProvider/Views/Shared/_Layout.cshtml
index e2c9ea3..308c6c7 100644
--- a/UniversityProvider/Views/Shared/_Layout.cshtml
+++ b/UniversityProvider/Views/Shared/_Layout.cshtml
@@ -34,6 +34,9 @@
Отчет
+
+ График
+
diff --git a/UniversityProvider/wwwroot/js/document/document-create.js b/UniversityProvider/wwwroot/js/document/document-create.js
index 374f818..d7a625c 100644
--- a/UniversityProvider/wwwroot/js/document/document-create.js
+++ b/UniversityProvider/wwwroot/js/document/document-create.js
@@ -4,6 +4,16 @@ const nameInput = document.getElementById("name-input")
var students = []
var dataArray = [];
+const correctData = () => {
+
+ return true;
+};
+
+const validate = () => {
+
+ return true;
+};
+
window.addEventListener('load', () => {
$.ajax({
url: "/student/getallbyuser",
@@ -16,6 +26,12 @@ window.addEventListener('load', () => {
})
createBtn.addEventListener('click', () => {
+ if (!correctData()) {
+ return;
+ }
+ if (!validate()) {
+ return;
+ }
var document = {
"Name": nameInput.value,
"Date": new Date(),
diff --git a/UniversityProvider/wwwroot/js/document/document-update.js b/UniversityProvider/wwwroot/js/document/document-update.js
index be3a20c..bd1a609 100644
--- a/UniversityProvider/wwwroot/js/document/document-update.js
+++ b/UniversityProvider/wwwroot/js/document/document-update.js
@@ -6,6 +6,16 @@ var students = [];
var dataArray = [];
var currentDocument = null;
+const correctData = () => {
+
+ return true;
+};
+
+const validate = () => {
+
+ return true;
+};
+
window.addEventListener('load', async () => {
await $.ajax({
url: "/student/getallbyuser",
@@ -25,6 +35,12 @@ window.addEventListener('load', async () => {
})
createBtn.addEventListener('click', () => {
+ if (!correctData()) {
+ return;
+ }
+ if (!validate()) {
+ return;
+ }
var documentGroupsUpdate = {
"Id": currentDocument.id,
"Name": nameInput.value,
diff --git a/UniversityProvider/wwwroot/js/educationstatus/educationstatus-create.js b/UniversityProvider/wwwroot/js/educationstatus/educationstatus-create.js
index f82b746..61e452d 100644
--- a/UniversityProvider/wwwroot/js/educationstatus/educationstatus-create.js
+++ b/UniversityProvider/wwwroot/js/educationstatus/educationstatus-create.js
@@ -1,6 +1,16 @@
const createBtn = document.getElementById("create-button");
const nameInput = document.getElementById("name-input");
+const correctData = () => {
+
+ return true;
+};
+
+const validate = () => {
+
+ return true;
+};
+
createBtn.addEventListener("click", () => {
if (!correctData()) {
return;
@@ -8,19 +18,6 @@ createBtn.addEventListener("click", () => {
if (!validate()) {
return;
}
-});
-
-const correctData = function () {
-
- return true;
-};
-
-const validate = function () {
-
- return true;
-};
-
-createBtn.addEventListener("click", () => {
let educationstatus = {
"Name": nameInput.value,
};
diff --git a/UniversityProvider/wwwroot/js/educationstatus/educationstatus-update.js b/UniversityProvider/wwwroot/js/educationstatus/educationstatus-update.js
index 64cc0ec..59057fc 100644
--- a/UniversityProvider/wwwroot/js/educationstatus/educationstatus-update.js
+++ b/UniversityProvider/wwwroot/js/educationstatus/educationstatus-update.js
@@ -2,6 +2,16 @@
const nameInput = document.getElementById("name-input")
const studId = document.getElementById("vb-id").dataset.id
+const correctData = () => {
+
+ return true;
+};
+
+const validate = () => {
+
+ return true;
+};
+
updateBtn.addEventListener("click", () => {
if (!correctData()) {
return;
@@ -9,19 +19,6 @@ updateBtn.addEventListener("click", () => {
if (!validate()) {
return;
}
-});
-
-const correctData = function () {
-
- return true;
-};
-
-const validate = function () {
-
- return true;
-};
-
-updateBtn.addEventListener("click", () => {
let educationstatus = {
"Id": parseInt(studId),
"Name": nameInput.value,
diff --git a/UniversityProvider/wwwroot/js/report/reportpdf.js b/UniversityProvider/wwwroot/js/report/reportpdf.js
index 07704e0..3a831cf 100644
--- a/UniversityProvider/wwwroot/js/report/reportpdf.js
+++ b/UniversityProvider/wwwroot/js/report/reportpdf.js
@@ -21,39 +21,7 @@ generateButton.addEventListener("click", () => {
}).done((data) => {
dateFromSpan.innerHTML = reportModel["DateFrom"].toLocaleDateString();
dateToSpan.innerHTML = reportModel["DateTo"].toLocaleDateString();
- /*renderTable(reportData);*/
-
- // Добавление данных
- for (var i = 0; i < data.length; i++) {
- var streamData = data[i];
- var streamName = streamData.streamName;
-
- // Добавление строки для каждого студента в потоке
- for (var j = 0; j < streamData.studentStatus.length; j++) {
- var student = streamData.studentStatus[j];
-
- if (j === 0) {
- var row = tbody.insertRow();
- var streamNameCell = row.insertCell()
- streamNameCell.textContent = streamName;
- var studentNameCell = row.insertCell();
- var dateOfAdmissionCell = row.insertCell();
- var studentStatusCell = row.insertCell();
- tbody.appendChild(row)
- }
-
- var row = tbody.insertRow();
- var streamNameCell = row.insertCell()
- var studentNameCell = row.insertCell();
- studentNameCell.textContent = student.studentName;
- var dateOfAdmissionCell = row.insertCell();
- dateOfAdmissionCell.textContent = formatDate(student.dateOfAddmission);
- var studentStatusCell = row.insertCell();
- studentStatusCell.textContent = student.educationStatus;
-
- tbody.appendChild(row);
- }
- }
+ renderTable(data);
});
});
@@ -82,40 +50,40 @@ sendByMailButton.addEventListener("click", () => {
});
});
-tbody.innerHTML = "";
-/*reportData.forEach((record) => {
- const cars = record.cars;
- const works = record.works;
- const recordHeight = Math.max(cars.length + 1, works.length + 1);
- for (let i = 0; i < recordHeight; i++) {
- let cellsData = ["", "", "", ""];
- if (i === 0) {
- cellsData[0] = record.equipmentName;
- cellsData[1] = getDate(record.equipmentDateCreate);
- createTableRow(cellsData);
- continue;
- }
- let k = i - 1;
- if (k < cars.length) {
- cellsData[2] = cars[k];
- }
- if (k < works.length) {
- cellsData[3] = works[k];
- }
- createTableRow(cellsData);
- }
-});*/
-const renderTable = (reportData) => {
- console.log(reportData)
- reportData.forEach((item) => {
- var streamName = item.streamName;
- var students = []
- item.studentStatus.forEach((stud) => {
- students.push({ studentName: stud.studentName, educationStatus: stud.educationName });
- })
- createTableSection(streamName, students);
- })
+
+const renderTable = (data) => {
+ tbody.innerHTML = "";
+
+ for (var i = 0; i < data.length; i++) {
+ var streamData = data[i];
+ var streamName = streamData.streamName;
+
+ for (var j = 0; j < streamData.studentStatus.length; j++) {
+ var student = streamData.studentStatus[j];
+
+ if (j === 0) {
+ var row = tbody.insertRow();
+ var streamNameCell = row.insertCell()
+ streamNameCell.textContent = streamName;
+ var studentNameCell = row.insertCell();
+ var dateOfAdmissionCell = row.insertCell();
+ var studentStatusCell = row.insertCell();
+ tbody.appendChild(row)
+ }
+
+ var row = tbody.insertRow();
+ var streamNameCell = row.insertCell()
+ var studentNameCell = row.insertCell();
+ studentNameCell.textContent = student.studentName;
+ var dateOfAdmissionCell = row.insertCell();
+ dateOfAdmissionCell.textContent = formatDate(student.dateOfAddmission);
+ var studentStatusCell = row.insertCell();
+ studentStatusCell.textContent = student.educationStatus;
+
+ tbody.appendChild(row);
+ }
+ }
}
const createTableSection = (streamName, students) => {
diff --git a/UniversityProvider/wwwroot/js/student/student-create.js b/UniversityProvider/wwwroot/js/student/student-create.js
index 91cbf63..0600fd0 100644
--- a/UniversityProvider/wwwroot/js/student/student-create.js
+++ b/UniversityProvider/wwwroot/js/student/student-create.js
@@ -4,6 +4,16 @@ const surnameInput = document.getElementById("surname-input")
const dateInput = document.getElementById("date-input")
const studCardInput = document.getElementById("studcard-input")
+const correctData = () => {
+
+ return true;
+};
+
+const validate = () => {
+
+ return true;
+};
+
createBtn.addEventListener("click", () => {
if (!correctData()) {
return;
@@ -11,19 +21,6 @@ createBtn.addEventListener("click", () => {
if (!validate()) {
return;
}
-});
-
-const correctData = function () {
-
- return true;
-};
-
-const validate = function () {
-
- return true;
-};
-
-createBtn.addEventListener("click", () => {
let student = {
"Name": nameInput.value,
"Surname": surnameInput.value,
diff --git a/UniversityProvider/wwwroot/js/student/student-update.js b/UniversityProvider/wwwroot/js/student/student-update.js
index 10f83f4..da3c60f 100644
--- a/UniversityProvider/wwwroot/js/student/student-update.js
+++ b/UniversityProvider/wwwroot/js/student/student-update.js
@@ -5,6 +5,16 @@ const dateInput = document.getElementById("date-input")
const studCardInput = document.getElementById("studcard-input")
const studId = document.getElementById("vb-id").dataset.id
+const correctData = () => {
+
+ return true;
+};
+
+const validate = () => {
+
+ return true;
+};
+
updateBtn.addEventListener("click", () => {
if (!correctData()) {
return;
@@ -12,19 +22,6 @@ updateBtn.addEventListener("click", () => {
if (!validate()) {
return;
}
-});
-
-const correctData = function () {
-
- return true;
-};
-
-const validate = function () {
-
- return true;
-};
-
-updateBtn.addEventListener("click", () => {
let student = {
"Id": parseInt(studId),
"Name": nameInput.value,