половина работы
This commit is contained in:
parent
a9a0655c27
commit
a9ba74c492
@ -48,7 +48,7 @@
|
||||
menuStrip1.Location = new Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Padding = new Padding(13, 5, 0, 5);
|
||||
menuStrip1.Size = new Size(915, 48);
|
||||
menuStrip1.Size = new Size(915, 46);
|
||||
menuStrip1.TabIndex = 0;
|
||||
menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
@ -56,7 +56,7 @@
|
||||
//
|
||||
DirectoriesToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { GroupsToolStripMenuItem, StudentsToolStripMenuItem, ProfessorsToolStripMenuItem, SubjectsToolStripMenuItem });
|
||||
DirectoriesToolStripMenuItem.Name = "DirectoriesToolStripMenuItem";
|
||||
DirectoriesToolStripMenuItem.Size = new Size(184, 38);
|
||||
DirectoriesToolStripMenuItem.Size = new Size(184, 36);
|
||||
DirectoriesToolStripMenuItem.Text = "Справочники";
|
||||
//
|
||||
// GroupsToolStripMenuItem
|
||||
@ -91,27 +91,27 @@
|
||||
//
|
||||
OperationsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { GradesToolStripMenuItem, LecturesCountToolStripMenuItem });
|
||||
OperationsToolStripMenuItem.Name = "OperationsToolStripMenuItem";
|
||||
OperationsToolStripMenuItem.Size = new Size(147, 38);
|
||||
OperationsToolStripMenuItem.Size = new Size(147, 36);
|
||||
OperationsToolStripMenuItem.Text = "Операции";
|
||||
//
|
||||
// GradesToolStripMenuItem
|
||||
//
|
||||
GradesToolStripMenuItem.Name = "GradesToolStripMenuItem";
|
||||
GradesToolStripMenuItem.Size = new Size(285, 44);
|
||||
GradesToolStripMenuItem.Size = new Size(359, 44);
|
||||
GradesToolStripMenuItem.Text = "Оценки";
|
||||
GradesToolStripMenuItem.Click += GradeToolStripMenuItem_Click;
|
||||
//
|
||||
// LecturesCountToolStripMenuItem
|
||||
//
|
||||
LecturesCountToolStripMenuItem.Name = "LecturesCountToolStripMenuItem";
|
||||
LecturesCountToolStripMenuItem.Size = new Size(285, 44);
|
||||
LecturesCountToolStripMenuItem.Size = new Size(359, 44);
|
||||
LecturesCountToolStripMenuItem.Text = "Учет лекций";
|
||||
LecturesCountToolStripMenuItem.Click += LecturesCountToolStripMenuItem_Click;
|
||||
//
|
||||
// ReportsToolStripMenuItem
|
||||
//
|
||||
ReportsToolStripMenuItem.Name = "ReportsToolStripMenuItem";
|
||||
ReportsToolStripMenuItem.Size = new Size(116, 38);
|
||||
ReportsToolStripMenuItem.Size = new Size(116, 36);
|
||||
ReportsToolStripMenuItem.Text = "Отчеты";
|
||||
//
|
||||
// FormStudentProgress
|
||||
@ -126,7 +126,7 @@
|
||||
Margin = new Padding(6, 7, 6, 7);
|
||||
Name = "FormStudentProgress";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Учет успеваемости студентов";
|
||||
Text = " ";
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
|
@ -104,7 +104,7 @@ namespace StudentProgress.Forms
|
||||
Margin = new Padding(6, 6, 6, 6);
|
||||
Name = "FormSubjects";
|
||||
Text = "Предметы";
|
||||
Load += FormSubjects__Load;
|
||||
Load += FormSubjects_Load;
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Windows.Forms;
|
||||
using StudentPerformance.Forms;
|
||||
using StudentProgress.Repositories;
|
||||
using StudentProgress.Repositories.Implementations;
|
||||
using Unity;
|
||||
|
||||
namespace StudentProgress.Forms
|
||||
{
|
||||
@ -10,13 +10,14 @@ namespace StudentProgress.Forms
|
||||
{
|
||||
private readonly ISubjectsRepository _subjectsRepository;
|
||||
|
||||
public FormSubjects(ISubjectsRepository subjectsRepository)
|
||||
public FormSubjects()
|
||||
{
|
||||
InitializeComponent();
|
||||
_subjectsRepository = subjectsRepository ?? throw new ArgumentNullException(nameof(subjectsRepository));
|
||||
var container = Program.CreateContainer(); // Получаем контейнер Unity
|
||||
_subjectsRepository = container.Resolve<ISubjectsRepository>();
|
||||
}
|
||||
|
||||
private void FormSubjects__Load(object sender, EventArgs e)
|
||||
private void FormSubjects_Load(object sender, EventArgs e)
|
||||
{
|
||||
// Загрузка данных в DataGridView
|
||||
LoadData();
|
||||
@ -32,7 +33,7 @@ namespace StudentProgress.Forms
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Логика добавления нового предмета
|
||||
using (var form = new FormSubject(new SubjectsRepository()))
|
||||
using (var form = new FormSubject(Program.CreateContainer().Resolve<ISubjectsRepository>()))
|
||||
{
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
|
@ -1,9 +1,17 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog;
|
||||
using Unity;
|
||||
using Unity.Lifetime;
|
||||
using Serilog.Extensions.Logging;
|
||||
using StudentProgress.Forms;
|
||||
using StudentProgress.Repositories;
|
||||
using StudentProgress.Repositories.Implementations;
|
||||
using Unity;
|
||||
using Unity.Microsoft.Logging;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using StudentPerformance.Repositories.Implementations;
|
||||
|
||||
namespace StudentProgress
|
||||
{
|
||||
@ -15,15 +23,28 @@ namespace StudentProgress
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
var container = CreateContainer();
|
||||
|
||||
Application.Run(container.Resolve<FormStudentProgress>());
|
||||
}
|
||||
|
||||
public static UnityContainer CreateContainer()
|
||||
{
|
||||
var container = new UnityContainer();
|
||||
|
||||
// Ðåãèñòðàöèÿ ëîããåðà
|
||||
container.AddExtension(new LoggingExtension(CreateLoggerFactory()));
|
||||
|
||||
// Ðåãèñòðàöèÿ èíòåðôåéñà ñòðîêè ïîäêëþ÷åíèÿ
|
||||
container.RegisterType<IConnectionString, ConnectionString>(new SingletonLifetimeManager());
|
||||
|
||||
// Ðåãèñòðàöèÿ ðåïîçèòîðèåâ
|
||||
container.RegisterType<IGradesRepository, GradesRepository>();
|
||||
container.RegisterType<IGroupRepository, GroupRepository>();
|
||||
container.RegisterType<IProfessorsNameRepository, ProfessorsNameRepository>();
|
||||
container.RegisterType<IStudentRepository, StudentRepository>();
|
||||
container.RegisterType<ISubjectsRepository, SubjectsRepository>();
|
||||
container.RegisterType<ILecturesRepository, LecturesRepository>();
|
||||
container.RegisterType<IGradesRepository, GradesRepository>(new TransientLifetimeManager());
|
||||
container.RegisterType<IGroupRepository, GroupRepository>(new TransientLifetimeManager());
|
||||
container.RegisterType<ILecturesRepository, LecturesRepository>(new TransientLifetimeManager());
|
||||
container.RegisterType<IProfessorsNameRepository, ProfessorsNameRepository>(new TransientLifetimeManager());
|
||||
container.RegisterType<IStudentRepository, StudentRepository>(new TransientLifetimeManager());
|
||||
container.RegisterType<ISubjectsRepository, SubjectsRepository>(new TransientLifetimeManager());
|
||||
|
||||
// Ðåãèñòðàöèÿ ôîðì
|
||||
container.RegisterType<FormGroups>();
|
||||
@ -34,7 +55,19 @@ namespace StudentProgress
|
||||
container.RegisterType<FormRecordLecture>();
|
||||
container.RegisterType<FormLecturesCount>();
|
||||
|
||||
Application.Run(container.Resolve<FormStudentProgress>());
|
||||
return container;
|
||||
}
|
||||
|
||||
private static LoggerFactory CreateLoggerFactory()
|
||||
{
|
||||
var loggerFactory = new LoggerFactory();
|
||||
loggerFactory.AddSerilog(new LoggerConfiguration()
|
||||
.ReadFrom.Configuration(new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json")
|
||||
.Build())
|
||||
.CreateLogger());
|
||||
return loggerFactory;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StudentProgress.Repositories
|
||||
{
|
||||
public interface IConnectionString
|
||||
{
|
||||
string ConnectionString { get; }
|
||||
|
||||
}
|
||||
}
|
@ -4,7 +4,10 @@ namespace StudentProgress.Repositories;
|
||||
|
||||
public interface ISubjectsRepository
|
||||
{
|
||||
IEnumerable<Subjects> ReadSubjects(int? professorsNameId = null);
|
||||
void CreateSubjects_(Subjects subject);
|
||||
void DeleteSubjects(int id);
|
||||
IEnumerable<Subjects> ReadSubjects(int? id = null);
|
||||
Subjects ReadSubjectById(int id);
|
||||
void UpdateSubject(Subjects subject);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
using StudentProgress.Repositories;
|
||||
|
||||
namespace StudentProgress.Repositories.Implementations;
|
||||
|
||||
public class ConnectionString : IConnectionString
|
||||
{
|
||||
string IConnectionString.ConnectionString =>
|
||||
"Host=localhost;Port=5432;Database=studentperformancebd;Username=postgres;Password=Ildan12345;";
|
||||
}
|
@ -1,29 +1,120 @@
|
||||
using StudentProgress.Entities;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using StudentProgress.Entities;
|
||||
using StudentProgress.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace StudentProgress.Repositories.Implementations;
|
||||
|
||||
public class GradesRepository : IGradesRepository
|
||||
namespace StudentProgress.Repositories.Implementations
|
||||
{
|
||||
public class GradesRepository : IGradesRepository
|
||||
{
|
||||
private readonly IConnectionString _connectionString;
|
||||
private readonly ILogger<GradesRepository> _logger;
|
||||
|
||||
public GradesRepository(IConnectionString connectionString, ILogger<GradesRepository> logger)
|
||||
{
|
||||
_connectionString = connectionString;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void CreateGrade(Grades grade)
|
||||
{
|
||||
// Логика создания оценки
|
||||
_logger.LogInformation("Добавление оценки");
|
||||
_logger.LogDebug("Оценка: {json}", JsonConvert.SerializeObject(grade));
|
||||
try
|
||||
{
|
||||
using var connection = new SqlConnection(_connectionString.ConnectionString);
|
||||
var query = @"
|
||||
INSERT INTO Grades (SubjectsId, ProfessorsId, Date)
|
||||
VALUES (@SubjectsId, @ProfessorsId, @Date)";
|
||||
connection.Execute(query, grade);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при добавлении оценки");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteGrade(int id)
|
||||
{
|
||||
// Логика удаления оценки по идентификатору
|
||||
_logger.LogInformation("Удаление оценки");
|
||||
_logger.LogDebug("Оценка: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new SqlConnection(_connectionString.ConnectionString);
|
||||
var query = "DELETE FROM Grades WHERE Id = @Id";
|
||||
connection.Execute(query, new { Id = id });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при удалении оценки");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Grades> ReadGrades(DateTime? dateFrom = null, DateTime? dateTo = null, int? subjectsId = null, int? professorsId = null)
|
||||
{
|
||||
// Логика чтения оценок с возможностью фильтрации по дате, идентификатору предмета и идентификатору преподавателя
|
||||
return new List<Grades>();
|
||||
_logger.LogInformation("Получение оценок");
|
||||
try
|
||||
{
|
||||
using var connection = new SqlConnection(_connectionString.ConnectionString);
|
||||
var query = "SELECT * FROM Grades";
|
||||
var parameters = new DynamicParameters();
|
||||
|
||||
if (dateFrom.HasValue)
|
||||
{
|
||||
query += " WHERE Date >= @DateFrom";
|
||||
parameters.Add("DateFrom", dateFrom.Value);
|
||||
}
|
||||
if (dateTo.HasValue)
|
||||
{
|
||||
query += " AND Date <= @DateTo";
|
||||
parameters.Add("DateTo", dateTo.Value);
|
||||
}
|
||||
if (subjectsId.HasValue)
|
||||
{
|
||||
query += " AND SubjectsId = @SubjectsId";
|
||||
parameters.Add("SubjectsId", subjectsId.Value);
|
||||
}
|
||||
if (professorsId.HasValue)
|
||||
{
|
||||
query += " AND ProfessorsId = @ProfessorsId";
|
||||
parameters.Add("ProfessorsId", professorsId.Value);
|
||||
}
|
||||
|
||||
var grades = connection.Query<Grades>(query, parameters);
|
||||
_logger.LogDebug("Полученные оценки: {json}", JsonConvert.SerializeObject(grades));
|
||||
return grades;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при чтении оценок");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateGrade(Grades grade)
|
||||
{
|
||||
// Логика обновления оценки
|
||||
_logger.LogInformation("Редактирование оценки");
|
||||
_logger.LogDebug("Оценка: {json}", JsonConvert.SerializeObject(grade));
|
||||
try
|
||||
{
|
||||
using var connection = new SqlConnection(_connectionString.ConnectionString);
|
||||
var query = @"
|
||||
UPDATE Grades
|
||||
SET SubjectsId = @SubjectsId, ProfessorsId = @ProfessorsId, Date = @Date
|
||||
WHERE Id = @Id";
|
||||
connection.Execute(query, grade);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при редактировании оценки");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,50 +1,127 @@
|
||||
using StudentProgress.Entities;
|
||||
using System.Collections.Generic;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Npgsql;
|
||||
using StudentProgress.Entities;
|
||||
using StudentProgress.Repositories;
|
||||
|
||||
namespace StudentProgress.Repositories.Implementations
|
||||
namespace StudentPerformance.Repositories.Implementations;
|
||||
|
||||
public class GroupRepository : IGroupRepository
|
||||
{
|
||||
public class GroupRepository : IGroupRepository
|
||||
private readonly IConnectionString _connectionString;
|
||||
private readonly ILogger<GroupRepository> _logger;
|
||||
public GroupRepository(IConnectionString connectionString, ILogger<GroupRepository> logger)
|
||||
{
|
||||
private readonly List<Group> _groups;
|
||||
|
||||
public GroupRepository()
|
||||
{
|
||||
// Инициализация тестовых данных
|
||||
_groups = new List<Group>();
|
||||
_connectionString = connectionString;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void CreateGroup(Group group)
|
||||
{
|
||||
// Логика создания группы
|
||||
_groups.Add(group);
|
||||
_logger.LogInformation("Добавление объекта");
|
||||
_logger.LogDebug("Объект: {json}", JsonConvert.SerializeObject(group));
|
||||
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryInsert = @"INSERT INTO Groups (NameGroup, Course, NameFaculty)
|
||||
VALUES (@NameGroup, @Course, @NameFaculty)";
|
||||
connection.Execute(queryInsert, group);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при добавлении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteGroup(int id)
|
||||
{
|
||||
// Логика удаления группы по идентификатору
|
||||
_groups.RemoveAll(g => g.Id == id);
|
||||
_logger.LogInformation("Удаление объекта");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryDelete = @"
|
||||
DELETE FROM Groups
|
||||
WHERE Id=@id";
|
||||
connection.Execute(queryDelete, new { id });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при удалении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Group> ReadGroup()
|
||||
{
|
||||
// Логика чтения всех групп
|
||||
return _groups;
|
||||
_logger.LogInformation("Получение всех объектов");
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = "SELECT * FROM Groups";
|
||||
var groups = connection.Query<Group>(querySelect);
|
||||
_logger.LogDebug("Полученные объекты: {json}",
|
||||
JsonConvert.SerializeObject(groups));
|
||||
return groups;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при чтении объектов");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public Group ReadGroupById(int id)
|
||||
{
|
||||
// Логика чтения группы по идентификатору
|
||||
return _groups.Find(g => g.Id == id);
|
||||
_logger.LogInformation("Получение объекта по идентификатору");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = @"
|
||||
SELECT * FROM Groups
|
||||
WHERE Id=@id";
|
||||
var group = connection.QueryFirst<Group>(querySelect, new
|
||||
{
|
||||
id
|
||||
});
|
||||
_logger.LogDebug("Найденный объект: {json}",
|
||||
JsonConvert.SerializeObject(group));
|
||||
return group;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при поиске объекта");
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void UpdateGroup(Group group)
|
||||
{
|
||||
// Логика обновления группы
|
||||
var existingGroup = _groups.Find(g => g.Id == group.Id);
|
||||
if (existingGroup != null)
|
||||
_logger.LogInformation("Редактирование объекта");
|
||||
_logger.LogDebug("Объект: {json}",
|
||||
JsonConvert.SerializeObject(group));
|
||||
try
|
||||
{
|
||||
existingGroup.NameGroup = group.NameGroup;
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryUpdate = @"
|
||||
UPDATE Groups
|
||||
SET
|
||||
NameGroup=@NameGroup,
|
||||
Course=@Course,
|
||||
NameFaculty=@NameFaculty
|
||||
WHERE Id=@Id";
|
||||
connection.Execute(queryUpdate, group);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при редактировании объекта");
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,31 +1,76 @@
|
||||
using StudentProgress.Entities;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using StudentProgress.Entities;
|
||||
using StudentProgress.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace StudentProgress.Repositories.Implementations
|
||||
{
|
||||
public class LecturesRepository : ILecturesRepository
|
||||
{
|
||||
private readonly List<Lectures> _lectures = new List<Lectures>();
|
||||
private readonly IConnectionString _connectionString;
|
||||
private readonly ILogger<LecturesRepository> _logger;
|
||||
|
||||
public LecturesRepository(IConnectionString connectionString, ILogger<LecturesRepository> logger)
|
||||
{
|
||||
_connectionString = connectionString;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public IEnumerable<Lectures> ReadLectures()
|
||||
{
|
||||
return _lectures;
|
||||
_logger.LogInformation("Получение лекций");
|
||||
try
|
||||
{
|
||||
using var connection = new SqlConnection(_connectionString.ConnectionString);
|
||||
var query = "SELECT * FROM Lectures";
|
||||
var lectures = connection.Query<Lectures>(query);
|
||||
_logger.LogDebug("Полученные лекции: {json}", JsonConvert.SerializeObject(lectures));
|
||||
return lectures;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при чтении лекций");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateLecture(Lectures lecture)
|
||||
{
|
||||
int newLectureId = _lectures.Count > 0 ? _lectures.Max(l => l.LectureId) + 1 : 1;
|
||||
lecture.SetLectureId(newLectureId);
|
||||
_lectures.Add(lecture);
|
||||
_logger.LogInformation("Добавление лекции");
|
||||
_logger.LogDebug("Лекция: {json}", JsonConvert.SerializeObject(lecture));
|
||||
try
|
||||
{
|
||||
using var connection = new SqlConnection(_connectionString.ConnectionString);
|
||||
var query = @"
|
||||
INSERT INTO Lectures (ProfessorId, Date, Auditorium)
|
||||
VALUES (@ProfessorsId, @Date, @Auditorium)";
|
||||
connection.Execute(query, lecture);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при добавлении лекции");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteLecture(int lectureId)
|
||||
{
|
||||
var lectureToRemove = _lectures.FirstOrDefault(l => l.LectureId == lectureId);
|
||||
if (lectureToRemove != null)
|
||||
_logger.LogInformation("Удаление лекции");
|
||||
_logger.LogDebug("Лекция: {id}", lectureId);
|
||||
try
|
||||
{
|
||||
_lectures.Remove(lectureToRemove);
|
||||
using var connection = new SqlConnection(_connectionString.ConnectionString);
|
||||
var query = "DELETE FROM Lectures WHERE LectureId = @LectureId";
|
||||
connection.Execute(query, new { LectureId = lectureId });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при удалении лекции");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,126 @@
|
||||
using StudentProgress.Entities;
|
||||
using System.Collections.Generic;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Npgsql;
|
||||
using StudentProgress.Entities;
|
||||
using StudentProgress.Repositories;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace StudentProgress.Repositories.Implementations;
|
||||
|
||||
public class ProfessorsNameRepository : IProfessorsNameRepository
|
||||
{
|
||||
private readonly IConnectionString _connectionString;
|
||||
private readonly ILogger<ProfessorsNameRepository> _logger;
|
||||
|
||||
public ProfessorsNameRepository(IConnectionString connectionString, ILogger<ProfessorsNameRepository> logger)
|
||||
{
|
||||
_connectionString = connectionString;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void CreateProfessorsName(Professors professorsName)
|
||||
{
|
||||
// Логика создания преподавателя
|
||||
_logger.LogInformation("Добавление объекта");
|
||||
_logger.LogDebug("Объект: {json}", JsonConvert.SerializeObject(professorsName));
|
||||
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryInsert = @"INSERT INTO ProfessorsName (FirstName, LastName, MiddleName, Classes)
|
||||
VALUES (@FirstName, @LastName, @MiddleName, @Classes)";
|
||||
connection.Execute(queryInsert, professorsName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при добавлении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteProfessorsName(int id)
|
||||
{
|
||||
// Логика удаления преподавателя по идентификатору
|
||||
_logger.LogInformation("Удаление объекта");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryDelete = @"
|
||||
DELETE FROM ProfessorsName
|
||||
WHERE Id=@id";
|
||||
connection.Execute(queryDelete, new { id });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при удалении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Professors> ReadProfessorsName()
|
||||
{
|
||||
// Логика чтения всех преподавателей
|
||||
return new List<Professors>();
|
||||
_logger.LogInformation("Получение всех объектов");
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = "SELECT * FROM ProfessorsName";
|
||||
var professorsNames = connection.Query<Professors>(querySelect);
|
||||
_logger.LogDebug("Полученные объекты: {json}",
|
||||
JsonConvert.SerializeObject(professorsNames));
|
||||
return professorsNames;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при чтении объектов");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public Professors ReadProfessorsNameById(int id)
|
||||
{
|
||||
// Логика чтения преподавателя по идентификатору
|
||||
return Professors.CreateEntity(id, "Unknown", "Unknown");
|
||||
_logger.LogInformation("Получение объекта по идентификатору");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = @"
|
||||
SELECT * FROM ProfessorsName
|
||||
WHERE Id=@id";
|
||||
var professorsName = connection.QueryFirst<Professors>(querySelect, new { id });
|
||||
|
||||
_logger.LogDebug("Найденный объект: {json}",
|
||||
JsonConvert.SerializeObject(professorsName));
|
||||
return professorsName;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при поиске объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateProfessorsName(Professors professorsName)
|
||||
{
|
||||
// Логика обновления преподавателя
|
||||
_logger.LogInformation("Редактирование объекта");
|
||||
_logger.LogDebug("Объект: {json}",
|
||||
JsonConvert.SerializeObject(professorsName));
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryUpdate = @"
|
||||
UPDATE ProfessorsName
|
||||
SET
|
||||
FirstName=@FirstName,
|
||||
LastName=@LastName,
|
||||
MiddleName=@MiddleName,
|
||||
Classes=@Classes
|
||||
WHERE Id=@Id";
|
||||
connection.Execute(queryUpdate, professorsName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при редактировании объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,56 +1,130 @@
|
||||
using StudentProgress.Entities;
|
||||
using System.Collections.Generic;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Npgsql;
|
||||
using StudentProgress.Entities;
|
||||
using StudentProgress.Repositories;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace StudentProgress.Repositories.Implementations
|
||||
namespace StudentPerformance.Repositories.Implementations;
|
||||
|
||||
public class StudentRepository : IStudentRepository
|
||||
{
|
||||
public class StudentRepository : IStudentRepository
|
||||
{
|
||||
private readonly List<Student> _students;
|
||||
private readonly IConnectionString _connectionString;
|
||||
private readonly ILogger<StudentRepository> _logger;
|
||||
|
||||
public StudentRepository()
|
||||
public StudentRepository(IConnectionString connectionString, ILogger<StudentRepository> logger)
|
||||
{
|
||||
// Инициализация пустого списка студентов
|
||||
_students = new List<Student>();
|
||||
_connectionString = connectionString;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void CreateStudent(Student student)
|
||||
{
|
||||
// Логика создания студента
|
||||
_students.Add(student);
|
||||
_logger.LogInformation("Добавление объекта");
|
||||
_logger.LogDebug("Объект: {json}",
|
||||
JsonConvert.SerializeObject(student));
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryInsert = @"
|
||||
INSERT INTO Student (FirstName, LastName, MiddleName, Phone, GroupID)
|
||||
VALUES (@FirstName, @LastName, @MiddleName, @Phone, @GroupID)";
|
||||
connection.Execute(queryInsert, student);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при добавлении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteStudent(int id)
|
||||
{
|
||||
// Логика удаления студента по идентификатору
|
||||
_students.RemoveAll(s => s.Id == id);
|
||||
_logger.LogInformation("Удаление объекта");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryDelete = @"
|
||||
DELETE FROM Student
|
||||
WHERE Id=@id";
|
||||
connection.Execute(queryDelete, new { id });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при удалении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public Student ReadStudentById(int id)
|
||||
{
|
||||
// Логика чтения студента по идентификатору
|
||||
return _students.Find(s => s.Id == id);
|
||||
_logger.LogInformation("Получение объекта по идентификатору");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = @"
|
||||
SELECT * FROM Student
|
||||
WHERE Id=@id";
|
||||
var student = connection.QueryFirst<Student>(querySelect, new
|
||||
{
|
||||
id
|
||||
});
|
||||
_logger.LogDebug("Найденный объект: {json}",
|
||||
JsonConvert.SerializeObject(student));
|
||||
return student;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при поиске объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Student> ReadStudents(int? groupID = null)
|
||||
{
|
||||
// Логика чтения всех студентов с возможностью фильтрации по идентификатору группы
|
||||
if (groupID.HasValue)
|
||||
_logger.LogInformation("Получение всех объектов");
|
||||
try
|
||||
{
|
||||
return _students.FindAll(s => s.GroupId == groupID.Value);
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = "SELECT * FROM Student";
|
||||
var student = connection.Query<Student>(querySelect);
|
||||
_logger.LogDebug("Полученные объекты: {json}",
|
||||
JsonConvert.SerializeObject(student));
|
||||
return student;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при чтении объектов");
|
||||
throw;
|
||||
}
|
||||
return _students;
|
||||
}
|
||||
|
||||
public void UpdateStudent(Student student)
|
||||
{
|
||||
// Логика обновления студента
|
||||
var existingStudent = _students.Find(s => s.Id == student.Id);
|
||||
if (existingStudent != null)
|
||||
_logger.LogInformation("Редактирование объекта");
|
||||
_logger.LogDebug("Объект: {json}",
|
||||
JsonConvert.SerializeObject(student));
|
||||
try
|
||||
{
|
||||
existingStudent.Name = student.Name;
|
||||
existingStudent.Surname = student.Surname;
|
||||
existingStudent.GroupId = student.GroupId;
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryUpdate = @"
|
||||
UPDATE Student
|
||||
SET
|
||||
FirstName=@FirstName,
|
||||
LastName=@LastName,
|
||||
MiddleName=@MiddleName,
|
||||
Phone=@Phone,
|
||||
GroupID=@GroupID
|
||||
WHERE Id=@Id";
|
||||
connection.Execute(queryUpdate, student);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при редактировании объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +1,186 @@
|
||||
using StudentProgress.Entities;
|
||||
using System.Collections.Generic;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Npgsql;
|
||||
using StudentProgress.Entities;
|
||||
|
||||
namespace StudentProgress.Repositories.Implementations;
|
||||
|
||||
public class SubjectsRepository : ISubjectsRepository
|
||||
namespace StudentProgress.Repositories.Implementations
|
||||
{
|
||||
public void CreateSubjects(Subjects subject)
|
||||
public class SubjectsRepository : ISubjectsRepository
|
||||
{
|
||||
// Логика создания предмета
|
||||
private readonly IConnectionString _connectionString;
|
||||
private readonly ILogger<SubjectsRepository> _logger;
|
||||
|
||||
public SubjectsRepository(IConnectionString connectionString, ILogger<SubjectsRepository> logger)
|
||||
{
|
||||
_connectionString = connectionString;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// Добавление нового предмета
|
||||
public void CreateSubjects_(Subjects subject)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
_logger.LogInformation("Добавление объекта");
|
||||
_logger.LogDebug("Объект: {json}", JsonConvert.SerializeObject(subject));
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
connection.Open();
|
||||
using var transaction = connection.BeginTransaction();
|
||||
|
||||
var queryInsert = @"
|
||||
INSERT INTO Subject (NameSubject)
|
||||
VALUES (@NameSubject);
|
||||
SELECT MAX(Id) FROM Subject";
|
||||
|
||||
// Выполняем запрос и получаем ID созданного предмета
|
||||
var subjectId = connection.QueryFirst<int>(queryInsert, subject, transaction);
|
||||
|
||||
transaction.Commit();
|
||||
|
||||
_logger.LogInformation("Успешно добавлен объект с Id: {id}", subjectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при добавлении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// Удаление предмета по идентификатору
|
||||
public void DeleteSubjects(int id)
|
||||
{
|
||||
// Логика удаления предмета по идентификатору
|
||||
_logger.LogInformation("Удаление объекта");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryDelete = @"
|
||||
DELETE FROM Subject
|
||||
WHERE Id=@Id";
|
||||
|
||||
var rowsAffected = connection.Execute(queryDelete, new { Id = id });
|
||||
|
||||
if (rowsAffected == 0)
|
||||
{
|
||||
_logger.LogWarning("Объект с Id: {id} не найден для удаления", id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogInformation("Объект с Id: {id} успешно удалён", id);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при удалении объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Subjects> ReadSubjects(int? lecturerNameId = null)
|
||||
// Получение всех предметов
|
||||
public IEnumerable<Subjects> ReadSubjects(int? id = null)
|
||||
{
|
||||
// Логика чтения предметов с возможностью фильтрации по идентификатору преподавателя
|
||||
return new List<Subjects>();
|
||||
_logger.LogInformation("Получение объектов");
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
|
||||
if (id.HasValue)
|
||||
{
|
||||
// Если указан ID, возвращаем конкретный предмет
|
||||
var querySelectById = @"
|
||||
SELECT * FROM Subject
|
||||
WHERE Id = @Id";
|
||||
|
||||
var subject = connection.Query<Subjects>(querySelectById, new { Id = id.Value }).ToList();
|
||||
|
||||
if (!subject.Any())
|
||||
{
|
||||
_logger.LogWarning("Объект с Id: {id} не найден", id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogDebug("Найденный объект: {json}", JsonConvert.SerializeObject(subject));
|
||||
}
|
||||
|
||||
return subject;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Если ID не указан, возвращаем все предметы
|
||||
var querySelectAll = @"SELECT * FROM Subject";
|
||||
|
||||
var subjects = connection.Query<Subjects>(querySelectAll).ToList();
|
||||
_logger.LogDebug("Полученные объекты: {json}", JsonConvert.SerializeObject(subjects));
|
||||
|
||||
return subjects;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при чтении объектов");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// Получение предмета по идентификатору
|
||||
public Subjects ReadSubjectById(int id)
|
||||
{
|
||||
_logger.LogInformation("Получение объекта по идентификатору");
|
||||
_logger.LogDebug("Объект: {id}", id);
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = @"
|
||||
SELECT * FROM Subject
|
||||
WHERE Id = @Id";
|
||||
|
||||
var subject = connection.QueryFirstOrDefault<Subjects>(querySelect, new { Id = id });
|
||||
|
||||
if (subject == null)
|
||||
{
|
||||
_logger.LogWarning("Объект с Id: {id} не найден", id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogDebug("Найденный объект: {json}", JsonConvert.SerializeObject(subject));
|
||||
}
|
||||
|
||||
return subject;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при поиске объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// Обновление данных предмета
|
||||
public void UpdateSubject(Subjects subject)
|
||||
{
|
||||
_logger.LogInformation("Редактирование объекта");
|
||||
_logger.LogDebug("Объект: {json}", JsonConvert.SerializeObject(subject));
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
connection.Open();
|
||||
using var transaction = connection.BeginTransaction();
|
||||
|
||||
var queryUpdate = @"
|
||||
UPDATE Subject
|
||||
SET NameSubject = @NameSubject
|
||||
WHERE Id = @Id";
|
||||
|
||||
connection.Execute(queryUpdate, subject, transaction);
|
||||
transaction.Commit();
|
||||
|
||||
_logger.LogInformation("Объект с Id: {id} успешно обновлен", subject.Id);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка при редактировании объекта");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -9,7 +9,20 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Npgsql" Version="9.0.1" />
|
||||
<PackageReference Include="Serilog" Version="4.1.0" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
|
||||
<PackageReference Include="Unity" Version="5.11.10" />
|
||||
<PackageReference Include="Unity.Container" Version="5.11.11" />
|
||||
<PackageReference Include="Unity.Microsoft.Logging" Version="5.11.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
15
StudentProgress/StudentProgress/appsettings.json
Normal file
15
StudentProgress/StudentProgress/appsettings.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"Serilog": {
|
||||
"Using": [ "Serilog.Sinks.File" ],
|
||||
"MinimumLevel": "Debug",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "C:\\отп\\StudentProgress\\StudentProgress\\appsettings.json",
|
||||
"rollingInterval": "Day"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
125
StudentProgress/StudentProgress/appsettings20241204.com
Normal file
125
StudentProgress/StudentProgress/appsettings20241204.com
Normal file
@ -0,0 +1,125 @@
|
||||
2024-12-04 18:12:04.577 +04:00 [INF] Получение групп
|
||||
2024-12-04 18:12:05.492 +04:00 [ERR] Ошибка при чтении групп
|
||||
System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
|
||||
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 64
|
||||
2024-12-04 18:12:33.740 +04:00 [INF] Добавление группы
|
||||
2024-12-04 18:12:34.889 +04:00 [DBG] Группа: {"Id":0,"NameGroup":"vhghg"}
|
||||
2024-12-04 18:12:35.068 +04:00 [ERR] Ошибка при добавлении группы
|
||||
System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
|
||||
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GroupRepository.CreateGroup(Group group) in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 29
|
||||
2024-12-04 18:12:41.544 +04:00 [INF] Получение групп
|
||||
2024-12-04 18:12:41.590 +04:00 [ERR] Ошибка при чтении групп
|
||||
System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
|
||||
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 64
|
||||
2024-12-04 18:14:45.539 +04:00 [INF] Получение групп
|
||||
2024-12-04 18:14:45.623 +04:00 [ERR] Ошибка при чтении групп
|
||||
System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
|
||||
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 64
|
||||
2024-12-04 18:27:30.144 +04:00 [INF] Получение групп
|
||||
2024-12-04 18:27:30.580 +04:00 [ERR] Ошибка при чтении групп
|
||||
System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
|
||||
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 64
|
||||
2024-12-04 18:40:36.369 +04:00 [INF] Получение групп
|
||||
2024-12-04 18:40:37.721 +04:00 [ERR] Ошибка при чтении групп
|
||||
System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
|
||||
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 64
|
||||
2024-12-04 19:09:36.613 +04:00 [INF] Получение всех объектов
|
||||
2024-12-04 19:09:37.378 +04:00 [ERR] Ошибка при чтении объектов
|
||||
Npgsql.PostgresException (0x80004005): 3D000: database "studentperformancebd" does not exist
|
||||
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
|
||||
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
|
||||
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|214_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.<Get>g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.Open()
|
||||
at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1183
|
||||
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
|
||||
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
||||
at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 815
|
||||
at StudentPerformance.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 65
|
||||
Exception data:
|
||||
Severity: FATAL
|
||||
SqlState: 3D000
|
||||
MessageText: database "studentperformancebd" does not exist
|
||||
File: postinit.c
|
||||
Line: 1050
|
||||
Routine: InitPostgres
|
||||
2024-12-04 19:48:23.173 +04:00 [INF] Получение всех объектов
|
||||
2024-12-04 19:48:26.525 +04:00 [ERR] Ошибка при чтении объектов
|
||||
Npgsql.PostgresException (0x80004005): 3D000: database "studentperformancebd" does not exist
|
||||
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
|
||||
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
|
||||
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|214_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.<Get>g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.Open()
|
||||
at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1183
|
||||
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
|
||||
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
||||
at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 815
|
||||
at StudentPerformance.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 65
|
||||
Exception data:
|
||||
Severity: FATAL
|
||||
SqlState: 3D000
|
||||
MessageText: database "studentperformancebd" does not exist
|
||||
File: postinit.c
|
||||
Line: 1050
|
||||
Routine: InitPostgres
|
105
StudentProgress/StudentProgress/appsettings20241205.com
Normal file
105
StudentProgress/StudentProgress/appsettings20241205.com
Normal file
@ -0,0 +1,105 @@
|
||||
2024-12-05 03:52:19.883 +04:00 [INF] Получение всех объектов
|
||||
2024-12-05 03:52:20.333 +04:00 [ERR] Ошибка при чтении объектов
|
||||
Npgsql.PostgresException (0x80004005): 3D000: database "studentperformancebd" does not exist
|
||||
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
|
||||
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
|
||||
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|214_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.<Get>g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.Open()
|
||||
at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1183
|
||||
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
|
||||
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
||||
at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 815
|
||||
at StudentPerformance.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 65
|
||||
Exception data:
|
||||
Severity: FATAL
|
||||
SqlState: 3D000
|
||||
MessageText: database "studentperformancebd" does not exist
|
||||
File: postinit.c
|
||||
Line: 1050
|
||||
Routine: InitPostgres
|
||||
2024-12-05 03:52:31.028 +04:00 [INF] Получение оценок
|
||||
2024-12-05 03:52:31.056 +04:00 [ERR] Ошибка при чтении оценок
|
||||
System.ArgumentException: Keyword not supported: 'host'.
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GradesRepository.ReadGrades(Nullable`1 dateFrom, Nullable`1 dateTo, Nullable`1 subjectsId, Nullable`1 professorsId) in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GradesRepository.cs:line 64
|
||||
2024-12-05 03:52:40.306 +04:00 [INF] Получение оценок
|
||||
2024-12-05 03:52:40.306 +04:00 [ERR] Ошибка при чтении оценок
|
||||
System.ArgumentException: Keyword not supported: 'host'.
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.GradesRepository.ReadGrades(Nullable`1 dateFrom, Nullable`1 dateTo, Nullable`1 subjectsId, Nullable`1 professorsId) in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GradesRepository.cs:line 64
|
||||
2024-12-05 03:52:50.012 +04:00 [INF] Получение преподавателей
|
||||
2024-12-05 03:52:50.013 +04:00 [ERR] Ошибка при чтении преподавателей
|
||||
System.ArgumentException: Keyword not supported: 'host'.
|
||||
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
|
||||
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
|
||||
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
|
||||
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
|
||||
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
|
||||
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
|
||||
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
|
||||
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
|
||||
at StudentProgress.Repositories.Implementations.ProfessorsNameRepository.ReadProfessorsName() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\ProfessorsNameRepository.cs:line 64
|
||||
2024-12-05 08:57:04.261 +04:00 [INF] Получение объектов
|
||||
2024-12-05 08:57:05.030 +04:00 [ERR] Ошибка при чтении объектов
|
||||
Npgsql.PostgresException (0x80004005): 3D000: database "studentperformancebd" does not exist
|
||||
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
|
||||
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
|
||||
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|214_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.<Get>g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.Open()
|
||||
at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1183
|
||||
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
|
||||
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
||||
at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 815
|
||||
at StudentProgress.Repositories.Implementations.SubjectsRepository.ReadSubjects(Nullable`1 id) in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\SubjectsRepository.cs:line 113
|
||||
Exception data:
|
||||
Severity: FATAL
|
||||
SqlState: 3D000
|
||||
MessageText: database "studentperformancebd" does not exist
|
||||
File: postinit.c
|
||||
Line: 1050
|
||||
Routine: InitPostgres
|
||||
2024-12-05 12:31:25.485 +04:00 [INF] Получение всех объектов
|
||||
2024-12-05 12:31:26.556 +04:00 [ERR] Ошибка при чтении объектов
|
||||
Npgsql.PostgresException (0x80004005): 3D000: database "studentperformancebd" does not exist
|
||||
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
|
||||
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
|
||||
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|214_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.PoolingDataSource.<Get>g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
|
||||
at Npgsql.NpgsqlConnection.Open()
|
||||
at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1183
|
||||
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
|
||||
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
||||
at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 815
|
||||
at StudentPerformance.Repositories.Implementations.GroupRepository.ReadGroup() in C:\отп\StudentProgress\StudentProgress\Repositories\Implementations\GroupRepository.cs:line 65
|
||||
Exception data:
|
||||
Severity: FATAL
|
||||
SqlState: 3D000
|
||||
MessageText: database "studentperformancebd" does not exist
|
||||
File: postinit.c
|
||||
Line: 1050
|
||||
Routine: InitPostgres
|
Loading…
x
Reference in New Issue
Block a user