точно готово 2

This commit is contained in:
Garifullin-Farid 2024-11-28 12:21:20 +04:00
parent f73fd04201
commit 08c9f68699
8 changed files with 35 additions and 9 deletions

View File

@ -47,7 +47,7 @@ namespace ProjectSession.Forms
{ {
try try
{ {
if (string.IsNullOrWhiteSpace(textBoxName.Text) || comboBoxType.SelectedIndex < 1) if (string.IsNullOrWhiteSpace(textBoxName.Text) || comboBoxType.SelectedIndex < 0)
{ {
throw new Exception("Имеются незаполненныеполя"); throw new Exception("Имеются незаполненныеполя");
} }

View File

@ -47,7 +47,7 @@ namespace ProjectSession.Forms
{ {
try try
{ {
if (string.IsNullOrWhiteSpace(textBoxName.Text) || comboBoxType.SelectedIndex<1) if (string.IsNullOrWhiteSpace(textBoxName.Text) || comboBoxType.SelectedIndex<0)
{ {
throw new Exception("Имеются незаполненныеполя"); throw new Exception("Имеются незаполненныеполя");
} }

View File

@ -66,7 +66,7 @@ namespace ProjectSession.Forms
{ {
try try
{ {
if (string.IsNullOrWhiteSpace(textBoxStudentFirstName.Text) || string.IsNullOrWhiteSpace(textBoxStudentLastName.Text) || comboBoxStudentGroup.SelectedIndex < 0) if (string.IsNullOrWhiteSpace(textBoxStudentFirstName.Text) || string.IsNullOrWhiteSpace(textBoxStudentLastName.Text) || comboBoxStudentGroup.SelectedIndex < 0 || checkedListBoxStudentStatus.SelectedIndex<0)
{ {
throw new Exception("Имеются незаполненныеполя"); throw new Exception("Имеются незаполненныеполя");
} }

View File

@ -55,7 +55,7 @@ namespace ProjectSession.Forms
try try
{ {
if (string.IsNullOrWhiteSpace(textBoxTeacherFirstName.Text) || string.IsNullOrWhiteSpace(textBoxTeacherLastName.Text) if (string.IsNullOrWhiteSpace(textBoxTeacherFirstName.Text) || string.IsNullOrWhiteSpace(textBoxTeacherLastName.Text)
|| comboBoxTeacherPost.SelectedIndex < 1|| dataGridViewDisciplines.RowCount < 1 ) || comboBoxTeacherPost.SelectedIndex < 0|| dataGridViewDisciplines.RowCount < 1 )
{ {
throw new Exception("Имеются незаполненныеполя"); throw new Exception("Имеются незаполненныеполя");
} }

View File

@ -0,0 +1,7 @@
namespace ProjectSession.Repositories
{
public interface IConnectionString
{
public string ConnectionString { get;}
}
}

View File

@ -0,0 +1,8 @@

namespace ProjectSession.Repositories
{
public class ConnectionString : IConnectionString
{
string IConnectionString.ConnectionString => "Host=localhost;Port=5432;Username=postgres;Password=postgres;Database=otp";
}
}

View File

@ -1,9 +1,5 @@
using ProjectSession.Entities; using ProjectSession.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Repositories.Implementations namespace ProjectSession.Repositories.Implementations
{ {

View File

@ -0,0 +1,15 @@
{
"Serilog": {
"Using": [ "Serilog.Sinks.File" ],
"MinimumLevel": "Debug",
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs/Session_log.txt",
"rollingInterval": "Day"
}
}
]
}
}