diff --git a/ProjectSession/ProjectSession/Entities/Discipline.cs b/ProjectSession/ProjectSession/Entities/Discipline.cs
new file mode 100644
index 0000000..f1760b9
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Discipline.cs
@@ -0,0 +1,24 @@
+using ProjectSession.Entities.Enum;
+
+namespace ProjectSession.Entities
+{
+ public class Discipline
+ {
+ public int Id { get; private set; }
+
+ public string Name { get; private set; } = string.Empty;
+
+ public TypeAttestation TypeAttestation { get; private set; }
+
+ public static Discipline CreateEntity(int id, string name, TypeAttestation typeAttestation) {
+
+ return new Discipline
+ {
+ Id = id,
+ Name = name,
+ TypeAttestation = typeAttestation,
+ };
+
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/DisciplineTeachersDistribution.cs b/ProjectSession/ProjectSession/Entities/DisciplineTeachersDistribution.cs
new file mode 100644
index 0000000..14841eb
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/DisciplineTeachersDistribution.cs
@@ -0,0 +1,20 @@
+namespace ProjectSession.Entities
+{
+ public class DisciplineTeachersDistribution
+ {
+ public int Id { get; private set; }
+ public int DisciplineId { get; private set; }
+ public int NumberHours { get; private set; }
+ public static DisciplineTeachersDistribution CreateElement(int id, int disciplineId, int numberHours)
+ {
+ return new DisciplineTeachersDistribution
+ {
+ Id = id,
+ DisciplineId = disciplineId,
+ NumberHours = numberHours
+
+ };
+ }
+
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Enum/GroupType.cs b/ProjectSession/ProjectSession/Entities/Enum/GroupType.cs
new file mode 100644
index 0000000..682f374
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Enum/GroupType.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectSession.Entities.Enum
+{
+ public enum GroupType
+ {
+ fullTime = 0,
+ distance =1,
+ evening =2,
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Enum/StudentStatus.cs b/ProjectSession/ProjectSession/Entities/Enum/StudentStatus.cs
new file mode 100644
index 0000000..a97f9c3
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Enum/StudentStatus.cs
@@ -0,0 +1,12 @@
+
+
+namespace ProjectSession.Entities.Enum;
+ [Flags]
+public enum StudentStatus
+{
+ None = 0,
+ Dormintory = 2,
+ FamiliStatus = 4,
+ Activist = 8,
+}
+
diff --git a/ProjectSession/ProjectSession/Entities/Enum/TeacherDispline.cs b/ProjectSession/ProjectSession/Entities/Enum/TeacherDispline.cs
new file mode 100644
index 0000000..8411941
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Enum/TeacherDispline.cs
@@ -0,0 +1,21 @@
+namespace ProjectSession.Entities.Enum
+{
+ public class TeacherDispline
+ {
+ public int Id { get; private set; }
+ public int TeacherId { get; private set; }
+ public int DisciplineId { get; private set; }
+ public int Mark { get; private set; }
+ public static TeacherDispline CreateElement(int id, int disciplineId, int teacherId, int mark)
+ {
+ return new TeacherDispline
+ {
+ Id = id,
+ TeacherId = teacherId,
+ DisciplineId = disciplineId,
+ Mark = mark
+
+ };
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Enum/TeacherPost.cs b/ProjectSession/ProjectSession/Entities/Enum/TeacherPost.cs
new file mode 100644
index 0000000..0ef66a2
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Enum/TeacherPost.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectSession.Entities.Enum
+{
+ ///
+ /// вид должности преподавателя
+ ///
+ public enum TeacherPost
+ {
+ ///
+ /// асистент
+ ///
+ Assistant = 0,
+
+ ///
+ /// преподаватель
+ ///
+ Teacher = 1,
+
+ ///
+ /// старший преподаватель
+ ///
+ SeniorLecturer = 2,
+
+ ///
+ /// доцент
+ ///
+ Docent = 3,
+
+ ///
+ /// профессор
+ ///
+ Professor= 4,
+
+ ///
+ /// заведующий кафедрой
+ ///
+ HeadDepartment = 5,
+
+ ///
+ /// декан факультета
+ ///
+ DeanFaculty = 6
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Enum/TypeAttestation.cs b/ProjectSession/ProjectSession/Entities/Enum/TypeAttestation.cs
new file mode 100644
index 0000000..a93a177
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Enum/TypeAttestation.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectSession.Entities.Enum
+{
+ public enum TypeAttestation
+ {
+ ///
+ /// зачет
+ ///
+ Credit = 0,
+
+ ///
+ /// дифференцированный зачет
+ ///
+ DifferentiatedCredit = 0,
+
+ ///
+ /// экзамен
+ ///
+ Exam = 1,
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Exam.cs b/ProjectSession/ProjectSession/Entities/Exam.cs
new file mode 100644
index 0000000..247f830
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Exam.cs
@@ -0,0 +1,31 @@
+
+namespace ProjectSession.Entities
+{
+
+ public class Exam
+ {
+
+ public int Id { get; private set; }
+
+
+ public int TeacherId { get; private set; }
+
+ public int DisciplineId { get; private set; }
+
+
+ public DateTime DateTime { get; private set; }
+
+
+ public static Exam CreateOpeartion(int id,int teacherId,int disciplineId, DateTime dateTime)
+ {
+ return new Exam
+ {
+ Id = id,
+ TeacherId = teacherId,
+ DisciplineId = disciplineId,
+ DateTime = dateTime
+ };
+ }
+
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/ExamGradeBook.cs b/ProjectSession/ProjectSession/Entities/ExamGradeBook.cs
new file mode 100644
index 0000000..df388e0
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/ExamGradeBook.cs
@@ -0,0 +1,25 @@
+
+
+namespace ProjectSession.Entities
+{
+ public class ExamGradeBook
+ {
+ public int Id { get; private set; }
+
+ public int ExamId { get; private set; }
+
+ public int Mark { get; private set; }
+
+ public static ExamGradeBook CreateElement(int id, int examId, int mark)
+ {
+ return new ExamGradeBook
+ {
+ Id = id,
+ ExamId = examId,
+ Mark = mark
+
+ };
+ }
+
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Group.cs b/ProjectSession/ProjectSession/Entities/Group.cs
new file mode 100644
index 0000000..3891db0
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Group.cs
@@ -0,0 +1,26 @@
+using ProjectSession.Entities.Enum;
+
+namespace ProjectSession.Entities
+{
+ public class Group
+ {
+
+ public int Id { get; private set; }
+
+
+ public string Name { get; private set; } = string.Empty;
+
+
+ public GroupType GroupType { get; private set; }
+
+ public static Group CreateEntity(int Id, string Name, GroupType groupType)
+ {
+ return new Group
+ {
+ Id = Id,
+ Name = Name,
+ GroupType = groupType
+ };
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Student.cs b/ProjectSession/ProjectSession/Entities/Student.cs
new file mode 100644
index 0000000..a633165
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Student.cs
@@ -0,0 +1,35 @@
+
+
+using ProjectSession.Entities.Enum;
+
+namespace ProjectSession.Entities
+{
+
+ public class Student
+ {
+
+ public int Id { get; private set; }
+
+
+ public string FirstName { get; private set; } = string.Empty;
+
+
+ public string LastName { get; private set; } = string.Empty;
+
+ public int GroupID { get; private set; }
+
+ public StudentStatus Status { get; private set; }
+
+ public static Student CreateEntity(int id,string firstName,string lastName,int groupId, StudentStatus studentStatus)
+ {
+ return new Student
+ {
+ Id = id,
+ FirstName = firstName,
+ LastName = lastName,
+ GroupID = groupId,
+ Status = studentStatus
+ };
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/StudentGradeBook.cs b/ProjectSession/ProjectSession/Entities/StudentGradeBook.cs
new file mode 100644
index 0000000..d57a507
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/StudentGradeBook.cs
@@ -0,0 +1,25 @@
+
+namespace ProjectSession.Entities
+{
+ public class StudentGradeBook
+ {
+ public int Id { get; private set; }
+
+ public int StudentId { get; private set; }
+
+ public IEnumerable ExamGradeBook{ get; private set;} = [];
+
+ public static StudentGradeBook CreateOpeartion(int id, int studentId,
+
+ IEnumerable examGradeBook)
+ {
+ return new StudentGradeBook
+ {
+ Id = id,
+ StudentId = studentId,
+ ExamGradeBook = examGradeBook
+ };
+ }
+
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/Teacher.cs b/ProjectSession/ProjectSession/Entities/Teacher.cs
new file mode 100644
index 0000000..a0ab7ab
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/Teacher.cs
@@ -0,0 +1,32 @@
+using ProjectSession.Entities.Enum;
+
+
+namespace ProjectSession.Entities
+{
+
+ public class Teacher
+ {
+
+ public int Id { get; set; }
+
+
+ public string FirstName { get; private set; } = string.Empty;
+
+
+ public string LastName { get; private set; } = string.Empty;
+
+
+ public TeacherPost TeacherPost { get; private set; }
+
+ public static Teacher CreateEntity(int id, string firstName, string LastName, TeacherPost teacherPost)
+ {
+ return new Teacher
+ {
+ Id = id,
+ FirstName = firstName,
+ LastName = LastName,
+ TeacherPost = teacherPost
+ };
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Entities/TeachersDistribution.cs b/ProjectSession/ProjectSession/Entities/TeachersDistribution.cs
new file mode 100644
index 0000000..98655ca
--- /dev/null
+++ b/ProjectSession/ProjectSession/Entities/TeachersDistribution.cs
@@ -0,0 +1,21 @@
+namespace ProjectSession.Entities
+{
+ public class TeachersDistribution
+ {
+ public int Id { get; private set; }
+
+ public int TeacherId { get; private set; }
+
+ public IEnumerable DisciplineTeachersDistribution { get; private set;} = [];
+
+ public static TeachersDistribution CreateOpeartion(int id, int teacherId, IEnumerable disciplineTeachersDistribution)
+ {
+ return new TeachersDistribution
+ {
+ Id = id,
+ TeacherId = teacherId,
+ DisciplineTeachersDistribution = disciplineTeachersDistribution
+ };
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Form1.Designer.cs b/ProjectSession/ProjectSession/Form1.Designer.cs
deleted file mode 100644
index 9d22587..0000000
--- a/ProjectSession/ProjectSession/Form1.Designer.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-namespace ProjectSession
-{
- partial class Form1
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(800, 450);
- this.Text = "Form1";
- }
-
- #endregion
- }
-}
diff --git a/ProjectSession/ProjectSession/Form1.cs b/ProjectSession/ProjectSession/Form1.cs
deleted file mode 100644
index 62dd550..0000000
--- a/ProjectSession/ProjectSession/Form1.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace ProjectSession
-{
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/ProjectSession/ProjectSession/FormSession.Designer.cs b/ProjectSession/ProjectSession/FormSession.Designer.cs
new file mode 100644
index 0000000..3cfe9e0
--- /dev/null
+++ b/ProjectSession/ProjectSession/FormSession.Designer.cs
@@ -0,0 +1,155 @@
+namespace ProjectSession
+{
+ partial class FormSession
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ menuStrip = new MenuStrip();
+ справочникиToolStripMenuItem = new ToolStripMenuItem();
+ StudentsToolStripMenuItem = new ToolStripMenuItem();
+ TeachersToolStripMenuItem = new ToolStripMenuItem();
+ GroupsToolStripMenuItem = new ToolStripMenuItem();
+ DisciplinesToolStripMenuItem = new ToolStripMenuItem();
+ операцииToolStripMenuItem = new ToolStripMenuItem();
+ ExamToolStripMenuItem = new ToolStripMenuItem();
+ отчетыToolStripMenuItem = new ToolStripMenuItem();
+ TeachersDistributionToolStripMenuItem = new ToolStripMenuItem();
+ GradeBookToolStripMenuItem = new ToolStripMenuItem();
+ menuStrip.SuspendLayout();
+ SuspendLayout();
+ //
+ // menuStrip
+ //
+ menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem });
+ menuStrip.Location = new Point(0, 0);
+ menuStrip.Name = "menuStrip";
+ menuStrip.Size = new Size(784, 24);
+ menuStrip.TabIndex = 0;
+ menuStrip.Text = "menuStrip1";
+ //
+ // справочникиToolStripMenuItem
+ //
+ справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { StudentsToolStripMenuItem, TeachersToolStripMenuItem, GroupsToolStripMenuItem, DisciplinesToolStripMenuItem });
+ справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
+ справочникиToolStripMenuItem.Size = new Size(94, 20);
+ справочникиToolStripMenuItem.Text = "Справочники";
+ //
+ // StudentsToolStripMenuItem
+ //
+ StudentsToolStripMenuItem.Name = "StudentsToolStripMenuItem";
+ StudentsToolStripMenuItem.Size = new Size(180, 22);
+ StudentsToolStripMenuItem.Text = "Студенты";
+ StudentsToolStripMenuItem.Click += studentsToolStripMenuItem_Click;
+ //
+ // TeachersToolStripMenuItem
+ //
+ TeachersToolStripMenuItem.Name = "TeachersToolStripMenuItem";
+ TeachersToolStripMenuItem.Size = new Size(180, 22);
+ TeachersToolStripMenuItem.Text = "Учителя";
+ TeachersToolStripMenuItem.Click += TeachersToolStripMenuItem_Click;
+ //
+ // GroupsToolStripMenuItem
+ //
+ GroupsToolStripMenuItem.Name = "GroupsToolStripMenuItem";
+ GroupsToolStripMenuItem.Size = new Size(180, 22);
+ GroupsToolStripMenuItem.Text = "Группы";
+ GroupsToolStripMenuItem.Click += GroupsToolStripMenuItem_Click;
+ //
+ // DisciplinesToolStripMenuItem
+ //
+ DisciplinesToolStripMenuItem.Name = "DisciplinesToolStripMenuItem";
+ DisciplinesToolStripMenuItem.Size = new Size(180, 22);
+ DisciplinesToolStripMenuItem.Text = "Дисциплины";
+ DisciplinesToolStripMenuItem.Click += DisciplinesToolStripMenuItem_Click;
+ //
+ // операцииToolStripMenuItem
+ //
+ операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ExamToolStripMenuItem, TeachersDistributionToolStripMenuItem, GradeBookToolStripMenuItem });
+ операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
+ операцииToolStripMenuItem.Size = new Size(75, 20);
+ операцииToolStripMenuItem.Text = "Операции";
+ //
+ // ExamToolStripMenuItem
+ //
+ ExamToolStripMenuItem.Name = "ExamToolStripMenuItem";
+ ExamToolStripMenuItem.Size = new Size(250, 22);
+ ExamToolStripMenuItem.Text = "Экзамен";
+ ExamToolStripMenuItem.Click += ExamToolStripMenuItem_Click;
+ //
+ // отчетыToolStripMenuItem
+ //
+ отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
+ отчетыToolStripMenuItem.Size = new Size(60, 20);
+ отчетыToolStripMenuItem.Text = "Отчеты";
+ //
+ // TeachersDistributionToolStripMenuItem
+ //
+ TeachersDistributionToolStripMenuItem.Name = "TeachersDistributionToolStripMenuItem";
+ TeachersDistributionToolStripMenuItem.Size = new Size(250, 22);
+ TeachersDistributionToolStripMenuItem.Text = "Распределение преподавателей";
+ TeachersDistributionToolStripMenuItem.Click += TeachersDistributionToolStripMenuItem_Click;
+ //
+ // GradeBookToolStripMenuItem
+ //
+ GradeBookToolStripMenuItem.Name = "GradeBookToolStripMenuItem";
+ GradeBookToolStripMenuItem.Size = new Size(250, 22);
+ GradeBookToolStripMenuItem.Text = "Зачетная книжка";
+ GradeBookToolStripMenuItem.Click += GradeBookToolStripMenuItem_Click;
+ //
+ // FormSession
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ BackgroundImage = Properties.Resources.img_sessia;
+ BackgroundImageLayout = ImageLayout.Stretch;
+ ClientSize = new Size(784, 411);
+ Controls.Add(menuStrip);
+ MainMenuStrip = menuStrip;
+ Name = "FormSession";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "Учет результатов сессии";
+ menuStrip.ResumeLayout(false);
+ menuStrip.PerformLayout();
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private MenuStrip menuStrip;
+ private ToolStripMenuItem справочникиToolStripMenuItem;
+ private ToolStripMenuItem StudentsToolStripMenuItem;
+ private ToolStripMenuItem TeachersToolStripMenuItem;
+ private ToolStripMenuItem операцииToolStripMenuItem;
+ private ToolStripMenuItem ExamToolStripMenuItem;
+ private ToolStripMenuItem отчетыToolStripMenuItem;
+ private ToolStripMenuItem GroupsToolStripMenuItem;
+ private ToolStripMenuItem DisciplinesToolStripMenuItem;
+ private ToolStripMenuItem TeachersDistributionToolStripMenuItem;
+ private ToolStripMenuItem GradeBookToolStripMenuItem;
+ }
+}
diff --git a/ProjectSession/ProjectSession/FormSession.cs b/ProjectSession/ProjectSession/FormSession.cs
new file mode 100644
index 0000000..0690122
--- /dev/null
+++ b/ProjectSession/ProjectSession/FormSession.cs
@@ -0,0 +1,102 @@
+using ProjectSession.Entities;
+using ProjectSession.Forms;
+using System.ComponentModel;
+using Unity;
+
+namespace ProjectSession
+{
+ public partial class FormSession : Form
+ {
+ private readonly IUnityContainer _container;
+ public FormSession(IUnityContainer container)
+ {
+ InitializeComponent();
+ _container = container ??
+ throw new ArgumentNullException(nameof(container));
+ }
+
+ private void studentsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void TeachersToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void GroupsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void DisciplinesToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ExamToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void TeachersDistributionToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void GradeBookToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/FormSession.resx b/ProjectSession/ProjectSession/FormSession.resx
new file mode 100644
index 0000000..6c82d08
--- /dev/null
+++ b/ProjectSession/ProjectSession/FormSession.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormDiscipline.Designer.cs b/ProjectSession/ProjectSession/Forms/FormDiscipline.Designer.cs
new file mode 100644
index 0000000..89b286a
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormDiscipline.Designer.cs
@@ -0,0 +1,120 @@
+namespace ProjectSession.Forms
+{
+ partial class FormDiscipline
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ buttonCancel = new Button();
+ buttonSave = new Button();
+ comboBoxType = new ComboBox();
+ textBoxName = new TextBox();
+ label2 = new Label();
+ label1 = new Label();
+ SuspendLayout();
+ //
+ // buttonCancel
+ //
+ buttonCancel.Location = new Point(166, 235);
+ buttonCancel.Name = "buttonCancel";
+ buttonCancel.Size = new Size(100, 48);
+ buttonCancel.TabIndex = 15;
+ buttonCancel.Text = "Отменить";
+ buttonCancel.UseVisualStyleBackColor = true;
+ buttonCancel.Click += buttonCancel_Click;
+ //
+ // buttonSave
+ //
+ buttonSave.Location = new Point(42, 235);
+ buttonSave.Name = "buttonSave";
+ buttonSave.Size = new Size(100, 48);
+ buttonSave.TabIndex = 14;
+ buttonSave.Text = "Сохранить";
+ buttonSave.UseVisualStyleBackColor = true;
+ buttonSave.Click += buttonSave_Click;
+ //
+ // comboBoxType
+ //
+ comboBoxType.FormattingEnabled = true;
+ comboBoxType.Location = new Point(33, 99);
+ comboBoxType.Name = "comboBoxType";
+ comboBoxType.Size = new Size(100, 23);
+ comboBoxType.TabIndex = 13;
+ //
+ // textBoxName
+ //
+ textBoxName.Location = new Point(33, 53);
+ textBoxName.Name = "textBoxName";
+ textBoxName.Size = new Size(100, 23);
+ textBoxName.TabIndex = 12;
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.Location = new Point(180, 102);
+ label2.Name = "label2";
+ label2.Size = new Size(89, 15);
+ label2.TabIndex = 11;
+ label2.Text = "тип аттестации";
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(180, 53);
+ label1.Name = "label1";
+ label1.Size = new Size(60, 15);
+ label1.TabIndex = 10;
+ label1.Text = "название ";
+ //
+ // FormDiscipline
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ AutoValidate = AutoValidate.EnablePreventFocusChange;
+ ClientSize = new Size(288, 343);
+ Controls.Add(buttonCancel);
+ Controls.Add(buttonSave);
+ Controls.Add(comboBoxType);
+ Controls.Add(textBoxName);
+ Controls.Add(label2);
+ Controls.Add(label1);
+ Name = "FormDiscipline";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "дисциплина";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private Button buttonCancel;
+ private Button buttonSave;
+ private ComboBox comboBoxType;
+ private TextBox textBoxName;
+ private Label label2;
+ private Label label1;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormDiscipline.cs b/ProjectSession/ProjectSession/Forms/FormDiscipline.cs
new file mode 100644
index 0000000..b6d5822
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormDiscipline.cs
@@ -0,0 +1,76 @@
+using ProjectSession.Entities;
+using ProjectSession.Entities.Enum;
+using ProjectSession.Repositories;
+
+
+namespace ProjectSession.Forms
+{
+ public partial class FormDiscipline : Form
+ {
+ private readonly IDisciplineRepository _disciplineRepository;
+ private int? _disciplineId;
+
+ public int Id
+ {
+ set
+ {
+ try
+ {
+ var discipline = _disciplineRepository.ReadDisciplineById(value);
+ if (discipline == null)
+ {
+ throw new InvalidDataException(nameof(discipline));
+ }
+ textBoxName.Text = discipline.Name;
+ comboBoxType.SelectedItem = discipline.TypeAttestation;
+ _disciplineId = value;
+
+
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+
+ }
+
+ }
+ }
+ public FormDiscipline(IDisciplineRepository disciplineRepository)
+ {
+ InitializeComponent();
+ _disciplineRepository = disciplineRepository ?? throw new ArgumentNullException(nameof(disciplineRepository));
+ comboBoxType.DataSource = Enum.GetValues(typeof(TypeAttestation));
+ }
+
+ private void buttonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(textBoxName.Text) || comboBoxType.SelectedIndex < 1)
+ {
+ throw new Exception("Имеются незаполненныеполя");
+ }
+ if (_disciplineId.HasValue)
+ {
+ _disciplineRepository.UpdateDiscipline(CreateDiscipline(_disciplineId.Value));
+ }
+ else
+ {
+ _disciplineRepository.CreateDiscipline(CreateDiscipline(0));
+ }
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void buttonCancel_Click(object sender, EventArgs e) => Close();
+
+
+ private Discipline CreateDiscipline(int id) => Discipline.CreateEntity(id,textBoxName.Text,(TypeAttestation)comboBoxType.SelectedItem!);
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Form1.resx b/ProjectSession/ProjectSession/Forms/FormDiscipline.resx
similarity index 93%
rename from ProjectSession/ProjectSession/Form1.resx
rename to ProjectSession/ProjectSession/Forms/FormDiscipline.resx
index 1af7de1..af32865 100644
--- a/ProjectSession/ProjectSession/Form1.resx
+++ b/ProjectSession/ProjectSession/Forms/FormDiscipline.resx
@@ -1,17 +1,17 @@
-
diff --git a/ProjectSession/ProjectSession/Forms/FormDisciplines.Designer.cs b/ProjectSession/ProjectSession/Forms/FormDisciplines.Designer.cs
new file mode 100644
index 0000000..58c94fe
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormDisciplines.Designer.cs
@@ -0,0 +1,125 @@
+namespace ProjectSession.Forms
+{
+ partial class FormDisciplines
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ dataGridView = new DataGridView();
+ panel1 = new Panel();
+ buttonUpd = new Button();
+ buttonDell = new Button();
+ buttonAdd = new Button();
+ ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
+ panel1.SuspendLayout();
+ SuspendLayout();
+ //
+ // dataGridView
+ //
+ dataGridView.AllowUserToAddRows = false;
+ dataGridView.AllowUserToDeleteRows = false;
+ dataGridView.AllowUserToResizeColumns = false;
+ dataGridView.AllowUserToResizeRows = false;
+ dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridView.Dock = DockStyle.Fill;
+ dataGridView.Location = new Point(0, 0);
+ dataGridView.MultiSelect = false;
+ dataGridView.Name = "dataGridView";
+ dataGridView.ReadOnly = true;
+ dataGridView.RowHeadersVisible = false;
+ dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridView.Size = new Size(664, 450);
+ dataGridView.TabIndex = 5;
+ //
+ // panel1
+ //
+ panel1.Controls.Add(buttonUpd);
+ panel1.Controls.Add(buttonDell);
+ panel1.Controls.Add(buttonAdd);
+ panel1.Dock = DockStyle.Right;
+ panel1.Location = new Point(664, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(136, 450);
+ panel1.TabIndex = 4;
+ //
+ // buttonUpd
+ //
+ buttonUpd.BackgroundImage = Properties.Resources.Upd;
+ buttonUpd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonUpd.Location = new Point(34, 210);
+ buttonUpd.Name = "buttonUpd";
+ buttonUpd.Size = new Size(75, 70);
+ buttonUpd.TabIndex = 2;
+ buttonUpd.UseVisualStyleBackColor = true;
+ buttonUpd.Click += ButtonUpd_Click;
+ //
+ // buttonDell
+ //
+ buttonDell.BackgroundImage = Properties.Resources.Del;
+ buttonDell.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDell.Location = new Point(34, 121);
+ buttonDell.Name = "buttonDell";
+ buttonDell.Size = new Size(75, 70);
+ buttonDell.TabIndex = 1;
+ buttonDell.UseVisualStyleBackColor = true;
+ buttonDell.Click += ButtonDel_Click;
+ //
+ // buttonAdd
+ //
+ buttonAdd.BackgroundImage = Properties.Resources.Add;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonAdd.Location = new Point(34, 35);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(75, 70);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
+ buttonAdd.Click += ButtonAdd_Click;
+ //
+ // FormDisciplines
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(800, 450);
+ Controls.Add(dataGridView);
+ Controls.Add(panel1);
+ Name = "FormDisciplines";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "дисциплины";
+ ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
+ panel1.ResumeLayout(false);
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private DataGridView dataGridView;
+ private Panel panel1;
+ private Button buttonUpd;
+ private Button buttonDell;
+ private Button buttonAdd;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormDisciplines.cs b/ProjectSession/ProjectSession/Forms/FormDisciplines.cs
new file mode 100644
index 0000000..21f28c6
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormDisciplines.cs
@@ -0,0 +1,97 @@
+
+using ProjectSession.Repositories;
+using Unity;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormDisciplines : Form
+ {
+ private readonly IUnityContainer _container;
+
+ private readonly IDisciplineRepository _disciplineRepository;
+ public FormDisciplines(IUnityContainer container, IDisciplineRepository disciplineRepository)
+ {
+ InitializeComponent();
+ _container = container ?? throw new ArgumentNullException(nameof(container));
+ _disciplineRepository = disciplineRepository ?? throw new ArgumentNullException(nameof(disciplineRepository));
+ }
+ private void FormGroups_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonAdd_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonUpd_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ try
+ {
+ var form = _container.Resolve();
+ form.Id = findId;
+ form.ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ButtonDel_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
+ {
+ return;
+ }
+ try
+ {
+ _disciplineRepository.DelitDiscipline(findId);
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void LoadList() => dataGridView.DataSource = _disciplineRepository.ReadDiscipline();
+
+ private bool TryGetIdentifierFromSelectedRow(out int id)
+ {
+ id = 0;
+ if (dataGridView.SelectedRows.Count < 1)
+ {
+ MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return false;
+ }
+ id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
+ return true;
+ }
+
+
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormDisciplines.resx b/ProjectSession/ProjectSession/Forms/FormDisciplines.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormDisciplines.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormExam.Designer.cs b/ProjectSession/ProjectSession/Forms/FormExam.Designer.cs
new file mode 100644
index 0000000..e2b8ef2
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormExam.Designer.cs
@@ -0,0 +1,141 @@
+namespace ProjectSession.Forms
+{
+ partial class FormExam
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ comboBoxTeacher = new ComboBox();
+ comboBoxDiscipline = new ComboBox();
+ dateTimePickerExam = new DateTimePicker();
+ label1 = new Label();
+ label2 = new Label();
+ label3 = new Label();
+ buttonCancel = new Button();
+ buttonSave = new Button();
+ SuspendLayout();
+ //
+ // comboBoxTeacher
+ //
+ comboBoxTeacher.FormattingEnabled = true;
+ comboBoxTeacher.Location = new Point(125, 83);
+ comboBoxTeacher.Name = "comboBoxTeacher";
+ comboBoxTeacher.Size = new Size(175, 23);
+ comboBoxTeacher.TabIndex = 0;
+ //
+ // comboBoxDiscipline
+ //
+ comboBoxDiscipline.FormattingEnabled = true;
+ comboBoxDiscipline.Location = new Point(125, 130);
+ comboBoxDiscipline.Name = "comboBoxDiscipline";
+ comboBoxDiscipline.Size = new Size(175, 23);
+ comboBoxDiscipline.TabIndex = 1;
+ //
+ // dateTimePickerExam
+ //
+ dateTimePickerExam.Location = new Point(125, 181);
+ dateTimePickerExam.Name = "dateTimePickerExam";
+ dateTimePickerExam.Size = new Size(175, 23);
+ dateTimePickerExam.TabIndex = 2;
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(24, 86);
+ label1.Name = "label1";
+ label1.Size = new Size(89, 15);
+ label1.TabIndex = 3;
+ label1.Text = "преподаватель";
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.Location = new Point(24, 133);
+ label2.Name = "label2";
+ label2.Size = new Size(74, 15);
+ label2.TabIndex = 4;
+ label2.Text = "дисциплина";
+ //
+ // label3
+ //
+ label3.AutoSize = true;
+ label3.Location = new Point(24, 181);
+ label3.Name = "label3";
+ label3.Size = new Size(77, 15);
+ label3.TabIndex = 5;
+ label3.Text = "дата и время";
+ //
+ // buttonCancel
+ //
+ buttonCancel.Location = new Point(166, 261);
+ buttonCancel.Name = "buttonCancel";
+ buttonCancel.Size = new Size(100, 48);
+ buttonCancel.TabIndex = 11;
+ buttonCancel.Text = "Отменить";
+ buttonCancel.UseVisualStyleBackColor = true;
+ //
+ // buttonSave
+ //
+ buttonSave.Location = new Point(42, 261);
+ buttonSave.Name = "buttonSave";
+ buttonSave.Size = new Size(100, 48);
+ buttonSave.TabIndex = 10;
+ buttonSave.Text = "Сохранить";
+ buttonSave.UseVisualStyleBackColor = true;
+ //
+ // FormExam
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(312, 362);
+ Controls.Add(buttonCancel);
+ Controls.Add(buttonSave);
+ Controls.Add(label3);
+ Controls.Add(label2);
+ Controls.Add(label1);
+ Controls.Add(dateTimePickerExam);
+ Controls.Add(comboBoxDiscipline);
+ Controls.Add(comboBoxTeacher);
+ KeyPreview = true;
+ Name = "FormExam";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "экзамен";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private ComboBox comboBoxTeacher;
+ private ComboBox comboBoxDiscipline;
+ private DateTimePicker dateTimePickerExam;
+ private Label label1;
+ private Label label2;
+ private Label label3;
+ private Button buttonCancel;
+ private Button buttonSave;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormExam.cs b/ProjectSession/ProjectSession/Forms/FormExam.cs
new file mode 100644
index 0000000..5da0f26
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormExam.cs
@@ -0,0 +1,42 @@
+using ProjectSession.Entities;
+using ProjectSession.Repositories;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormExam : Form
+ {
+ private readonly IExamRepository _examRepository;
+
+ public FormExam( IExamRepository ExamRepository, ITeacherRepository teacherRepository, IDisciplineRepository disciplineRepository)
+ {
+ InitializeComponent();
+ _examRepository = ExamRepository ?? throw new ArgumentNullException(nameof(ExamRepository));
+ comboBoxDiscipline.DataSource = disciplineRepository.ReadDiscipline();
+ comboBoxDiscipline.DisplayMember = "Name";
+ comboBoxDiscipline.ValueMember = "Id";
+ comboBoxTeacher.DataSource = teacherRepository.ReadTeacher();
+ comboBoxTeacher.DisplayMember = "FirstName";
+ comboBoxTeacher.DisplayMember = "LastName";
+ comboBoxTeacher.ValueMember = "Id";
+
+ }
+ private void ButtonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (comboBoxDiscipline.SelectedIndex < 0 ||comboBoxTeacher.SelectedIndex < 0)
+ {
+ throw new Exception("Имеются незаполненные поля");
+ }
+ _examRepository.CreateExam(Exam.CreateOpeartion(0,(int)comboBoxTeacher.SelectedValue!,
+ (int)comboBoxDiscipline.SelectedValue!,dateTimePickerExam.Value));
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonCancel_Click(object sender, EventArgs e) => Close();
+ }
+}
diff --git a/ProjectSession/ProjectSession/Forms/FormExam.resx b/ProjectSession/ProjectSession/Forms/FormExam.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormExam.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormExams.Designer.cs b/ProjectSession/ProjectSession/Forms/FormExams.Designer.cs
new file mode 100644
index 0000000..543d127
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormExams.Designer.cs
@@ -0,0 +1,97 @@
+namespace ProjectSession.Forms
+{
+ partial class FormExams
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ dataGridViewData = new DataGridView();
+ panel1 = new Panel();
+ buttonAdd = new Button();
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
+ panel1.SuspendLayout();
+ SuspendLayout();
+ //
+ // dataGridViewData
+ //
+ dataGridViewData.AllowUserToAddRows = false;
+ dataGridViewData.AllowUserToDeleteRows = false;
+ dataGridViewData.AllowUserToResizeColumns = false;
+ dataGridViewData.AllowUserToResizeRows = false;
+ dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridViewData.Dock = DockStyle.Fill;
+ dataGridViewData.Location = new Point(0, 0);
+ dataGridViewData.MultiSelect = false;
+ dataGridViewData.Name = "dataGridViewData";
+ dataGridViewData.ReadOnly = true;
+ dataGridViewData.RowHeadersVisible = false;
+ dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridViewData.Size = new Size(664, 450);
+ dataGridViewData.TabIndex = 7;
+ //
+ // panel1
+ //
+ panel1.Controls.Add(buttonAdd);
+ panel1.Dock = DockStyle.Right;
+ panel1.Location = new Point(664, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(136, 450);
+ panel1.TabIndex = 6;
+ //
+ // buttonAdd
+ //
+ buttonAdd.BackgroundImage = Properties.Resources.Add;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonAdd.Location = new Point(34, 35);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(75, 70);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
+ buttonAdd.Click += ButtonAdd_Click;
+ //
+ // FormExams
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(800, 450);
+ Controls.Add(dataGridViewData);
+ Controls.Add(panel1);
+ Name = "FormExams";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "экзамены";
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
+ panel1.ResumeLayout(false);
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private DataGridView dataGridViewData;
+ private Panel panel1;
+ private Button buttonAdd;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormExams.cs b/ProjectSession/ProjectSession/Forms/FormExams.cs
new file mode 100644
index 0000000..e17642a
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormExams.cs
@@ -0,0 +1,48 @@
+using Unity;
+using ProjectSession.Repositories;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormExams : Form
+ {
+
+ private readonly IUnityContainer _container;
+ private readonly IExamRepository _examRepository;
+ public FormExams(IUnityContainer container, IExamRepository examRepository)
+ {
+ InitializeComponent();
+ _container = container ??
+ throw new ArgumentNullException(nameof(container));
+ _examRepository = examRepository ??
+ throw new
+ ArgumentNullException(nameof(examRepository));
+ }
+ private void FormExam_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonAdd_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+
+ MessageBox.Show(ex.Message, "Ошибка при добавлении",MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void LoadList() => dataGridViewData.DataSource =
+ _examRepository.ReadExam();
+ }
+
+}
diff --git a/ProjectSession/ProjectSession/Forms/FormExams.resx b/ProjectSession/ProjectSession/Forms/FormExams.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormExams.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormGroup.Designer.cs b/ProjectSession/ProjectSession/Forms/FormGroup.Designer.cs
new file mode 100644
index 0000000..c9efc18
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormGroup.Designer.cs
@@ -0,0 +1,119 @@
+namespace ProjectSession.Forms
+{
+ partial class FormGroup
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ label1 = new Label();
+ label2 = new Label();
+ textBoxName = new TextBox();
+ comboBoxType = new ComboBox();
+ buttonCancel = new Button();
+ buttonSave = new Button();
+ SuspendLayout();
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(173, 65);
+ label1.Name = "label1";
+ label1.Size = new Size(60, 15);
+ label1.TabIndex = 0;
+ label1.Text = "название ";
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.Location = new Point(173, 114);
+ label2.Name = "label2";
+ label2.Size = new Size(82, 15);
+ label2.TabIndex = 1;
+ label2.Text = "вид обучения";
+ //
+ // textBoxName
+ //
+ textBoxName.Location = new Point(26, 65);
+ textBoxName.Name = "textBoxName";
+ textBoxName.Size = new Size(100, 23);
+ textBoxName.TabIndex = 2;
+ //
+ // comboBoxType
+ //
+ comboBoxType.FormattingEnabled = true;
+ comboBoxType.Location = new Point(26, 111);
+ comboBoxType.Name = "comboBoxType";
+ comboBoxType.Size = new Size(100, 23);
+ comboBoxType.TabIndex = 3;
+ //
+ // buttonCancel
+ //
+ buttonCancel.Location = new Point(159, 247);
+ buttonCancel.Name = "buttonCancel";
+ buttonCancel.Size = new Size(100, 48);
+ buttonCancel.TabIndex = 9;
+ buttonCancel.Text = "Отменить";
+ buttonCancel.UseVisualStyleBackColor = true;
+ buttonCancel.Click += buttonCancel_Click;
+ //
+ // buttonSave
+ //
+ buttonSave.Location = new Point(35, 247);
+ buttonSave.Name = "buttonSave";
+ buttonSave.Size = new Size(100, 48);
+ buttonSave.TabIndex = 8;
+ buttonSave.Text = "Сохранить";
+ buttonSave.UseVisualStyleBackColor = true;
+ buttonSave.Click += buttonSave_Click;
+ //
+ // FormGroup
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(294, 345);
+ Controls.Add(buttonCancel);
+ Controls.Add(buttonSave);
+ Controls.Add(comboBoxType);
+ Controls.Add(textBoxName);
+ Controls.Add(label2);
+ Controls.Add(label1);
+ Name = "FormGroup";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "Группы";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private Label label1;
+ private Label label2;
+ private TextBox textBoxName;
+ private ComboBox comboBoxType;
+ private Button buttonCancel;
+ private Button buttonSave;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormGroup.cs b/ProjectSession/ProjectSession/Forms/FormGroup.cs
new file mode 100644
index 0000000..37b18bc
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormGroup.cs
@@ -0,0 +1,78 @@
+using ProjectSession.Entities;
+using ProjectSession.Entities.Enum;
+using ProjectSession.Repositories;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormGroup : Form
+ {
+ private readonly IGroupRepository _groupRepository;
+ private int? _groupId;
+
+ public int Id
+ {
+ set
+ {
+ try
+ {
+ var group = _groupRepository.ReadGroupById(value);
+ if (group == null)
+ {
+ throw new
+ InvalidDataException(nameof(group));
+ }
+ textBoxName.Text = group.Name;
+ comboBoxType.SelectedItem = group;
+ _groupId = value;
+
+
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+
+ }
+
+ }
+ }
+ public FormGroup(IGroupRepository groupRepository)
+ {
+ InitializeComponent();
+ _groupRepository = groupRepository ??throw new ArgumentNullException(nameof(groupRepository));
+ comboBoxType.DataSource = Enum.GetValues(typeof(GroupType));
+ }
+
+ private void buttonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(textBoxName.Text) || comboBoxType.SelectedIndex<1)
+ {
+ throw new Exception("Имеются незаполненныеполя");
+ }
+ if (_groupId.HasValue)
+ {
+ _groupRepository.UpdateGroup(CreateGroup(_groupId.Value));
+ }
+ else
+ {
+ _groupRepository.CreateGroup(CreateGroup(0));
+ }
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void buttonCancel_Click(object sender, EventArgs e) => Close();
+
+
+ private Group CreateGroup(int id) => Group.CreateEntity(id, textBoxName.Text, (GroupType)comboBoxType.SelectedItem!);
+ }
+
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormGroup.resx b/ProjectSession/ProjectSession/Forms/FormGroup.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormGroup.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormGroups.Designer.cs b/ProjectSession/ProjectSession/Forms/FormGroups.Designer.cs
new file mode 100644
index 0000000..0a1bd94
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormGroups.Designer.cs
@@ -0,0 +1,125 @@
+namespace ProjectSession.Forms
+{
+ partial class FormGroups
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ dataGridView = new DataGridView();
+ panel1 = new Panel();
+ buttonUpd = new Button();
+ buttonDell = new Button();
+ buttonAdd = new Button();
+ ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
+ panel1.SuspendLayout();
+ SuspendLayout();
+ //
+ // dataGridView
+ //
+ dataGridView.AllowUserToAddRows = false;
+ dataGridView.AllowUserToDeleteRows = false;
+ dataGridView.AllowUserToResizeColumns = false;
+ dataGridView.AllowUserToResizeRows = false;
+ dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridView.Dock = DockStyle.Fill;
+ dataGridView.Location = new Point(0, 0);
+ dataGridView.MultiSelect = false;
+ dataGridView.Name = "dataGridView";
+ dataGridView.ReadOnly = true;
+ dataGridView.RowHeadersVisible = false;
+ dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridView.Size = new Size(664, 450);
+ dataGridView.TabIndex = 3;
+ //
+ // panel1
+ //
+ panel1.Controls.Add(buttonUpd);
+ panel1.Controls.Add(buttonDell);
+ panel1.Controls.Add(buttonAdd);
+ panel1.Dock = DockStyle.Right;
+ panel1.Location = new Point(664, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(136, 450);
+ panel1.TabIndex = 2;
+ //
+ // buttonUpd
+ //
+ buttonUpd.BackgroundImage = Properties.Resources.Upd;
+ buttonUpd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonUpd.Location = new Point(34, 210);
+ buttonUpd.Name = "buttonUpd";
+ buttonUpd.Size = new Size(75, 70);
+ buttonUpd.TabIndex = 2;
+ buttonUpd.UseVisualStyleBackColor = true;
+ buttonUpd.Click += ButtonUpd_Click;
+ //
+ // buttonDell
+ //
+ buttonDell.BackgroundImage = Properties.Resources.Del;
+ buttonDell.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDell.Location = new Point(34, 121);
+ buttonDell.Name = "buttonDell";
+ buttonDell.Size = new Size(75, 70);
+ buttonDell.TabIndex = 1;
+ buttonDell.UseVisualStyleBackColor = true;
+ buttonDell.Click += ButtonDel_Click;
+ //
+ // buttonAdd
+ //
+ buttonAdd.BackgroundImage = Properties.Resources.Add;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonAdd.Location = new Point(34, 35);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(75, 70);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
+ buttonAdd.Click += ButtonAdd_Click;
+ //
+ // FormGroups
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(800, 450);
+ Controls.Add(dataGridView);
+ Controls.Add(panel1);
+ Name = "FormGroups";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "Группы";
+ ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
+ panel1.ResumeLayout(false);
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private DataGridView dataGridView;
+ private Panel panel1;
+ private Button buttonUpd;
+ private Button buttonDell;
+ private Button buttonAdd;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormGroups.cs b/ProjectSession/ProjectSession/Forms/FormGroups.cs
new file mode 100644
index 0000000..4a426e4
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormGroups.cs
@@ -0,0 +1,95 @@
+using ProjectSession.Repositories;
+using Unity;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormGroups : Form
+ {
+ private readonly IUnityContainer _container;
+
+ private readonly IGroupRepository _groupRepository;
+ public FormGroups(IUnityContainer container, IGroupRepository groupRepository)
+ {
+ InitializeComponent();
+ _container = container ?? throw new ArgumentNullException(nameof(container));
+ _groupRepository = groupRepository ?? throw new ArgumentNullException(nameof(groupRepository));
+ }
+ private void FormGroups_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonAdd_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonUpd_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ try
+ {
+ var form = _container.Resolve();
+ form.Id = findId;
+ form.ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ButtonDel_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
+ {
+ return;
+ }
+ try
+ {
+ _groupRepository.DelitGroup(findId);
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void LoadList() => dataGridView.DataSource = _groupRepository.ReadGroup();
+ private bool TryGetIdentifierFromSelectedRow(out int id)
+ {
+ id = 0;
+ if (dataGridView.SelectedRows.Count < 1)
+ {
+ MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return false;
+ }
+ id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
+ return true;
+ }
+
+
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormGroups.resx b/ProjectSession/ProjectSession/Forms/FormGroups.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormGroups.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudent.Designer.cs b/ProjectSession/ProjectSession/Forms/FormStudent.Designer.cs
new file mode 100644
index 0000000..d8958a6
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudent.Designer.cs
@@ -0,0 +1,165 @@
+namespace ProjectSession.Forms
+{
+ partial class FormStudent
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ label1 = new Label();
+ label2 = new Label();
+ textBoxStudentLastName = new TextBox();
+ textBoxStudentFirstName = new TextBox();
+ buttonSave = new Button();
+ buttonCancel = new Button();
+ checkedListBoxStudentStatus = new CheckedListBox();
+ label3 = new Label();
+ comboBoxStudentGroup = new ComboBox();
+ label4 = new Label();
+ SuspendLayout();
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(6, 82);
+ label1.Name = "label1";
+ label1.Size = new Size(31, 15);
+ label1.TabIndex = 0;
+ label1.Text = "Имя";
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.Location = new Point(6, 41);
+ label2.Name = "label2";
+ label2.Size = new Size(58, 15);
+ label2.TabIndex = 1;
+ label2.Text = "Фамилия";
+ //
+ // textBoxStudentLastName
+ //
+ textBoxStudentLastName.Location = new Point(109, 41);
+ textBoxStudentLastName.Name = "textBoxStudentLastName";
+ textBoxStudentLastName.Size = new Size(150, 23);
+ textBoxStudentLastName.TabIndex = 2;
+ //
+ // textBoxStudentFirstName
+ //
+ textBoxStudentFirstName.Location = new Point(109, 82);
+ textBoxStudentFirstName.Name = "textBoxStudentFirstName";
+ textBoxStudentFirstName.Size = new Size(150, 23);
+ textBoxStudentFirstName.TabIndex = 3;
+ //
+ // buttonSave
+ //
+ buttonSave.Location = new Point(35, 263);
+ buttonSave.Name = "buttonSave";
+ buttonSave.Size = new Size(100, 48);
+ buttonSave.TabIndex = 6;
+ buttonSave.Text = "Сохранить";
+ buttonSave.UseVisualStyleBackColor = true;
+ buttonSave.Click += buttonSave_Click;
+ //
+ // buttonCancel
+ //
+ buttonCancel.Location = new Point(159, 263);
+ buttonCancel.Name = "buttonCancel";
+ buttonCancel.Size = new Size(100, 48);
+ buttonCancel.TabIndex = 7;
+ buttonCancel.Text = "Отменить";
+ buttonCancel.UseVisualStyleBackColor = true;
+ buttonCancel.Click += buttonCancel_Click;
+ //
+ // checkedListBoxStudentStatus
+ //
+ checkedListBoxStudentStatus.FormattingEnabled = true;
+ checkedListBoxStudentStatus.Location = new Point(103, 163);
+ checkedListBoxStudentStatus.Name = "checkedListBoxStudentStatus";
+ checkedListBoxStudentStatus.Size = new Size(150, 94);
+ checkedListBoxStudentStatus.TabIndex = 8;
+ //
+ // label3
+ //
+ label3.AutoSize = true;
+ label3.Location = new Point(6, 193);
+ label3.Name = "label3";
+ label3.Size = new Size(91, 15);
+ label3.TabIndex = 9;
+ label3.Text = "статус студента";
+ //
+ // comboBoxStudentGroup
+ //
+ comboBoxStudentGroup.FormattingEnabled = true;
+ comboBoxStudentGroup.Location = new Point(109, 123);
+ comboBoxStudentGroup.Name = "comboBoxStudentGroup";
+ comboBoxStudentGroup.Size = new Size(150, 23);
+ comboBoxStudentGroup.TabIndex = 11;
+ //
+ // label4
+ //
+ label4.AutoSize = true;
+ label4.Location = new Point(6, 123);
+ label4.Name = "label4";
+ label4.Size = new Size(45, 15);
+ label4.TabIndex = 12;
+ label4.Text = "группа";
+ //
+ // FormStudent
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ AutoValidate = AutoValidate.EnableAllowFocusChange;
+ ClientSize = new Size(306, 335);
+ Controls.Add(label4);
+ Controls.Add(comboBoxStudentGroup);
+ Controls.Add(label3);
+ Controls.Add(checkedListBoxStudentStatus);
+ Controls.Add(buttonCancel);
+ Controls.Add(buttonSave);
+ Controls.Add(textBoxStudentFirstName);
+ Controls.Add(textBoxStudentLastName);
+ Controls.Add(label2);
+ Controls.Add(label1);
+ Name = "FormStudent";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "Студент";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private Label label1;
+ private Label label2;
+ private TextBox textBoxStudentLastName;
+ private TextBox textBoxStudentFirstName;
+ private Button buttonSave;
+ private Button buttonCancel;
+ private CheckedListBox checkedListBoxStudentStatus;
+ private Label label3;
+ private ComboBox comboBoxStudentGroup;
+ private Label label4;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudent.cs b/ProjectSession/ProjectSession/Forms/FormStudent.cs
new file mode 100644
index 0000000..05f6d60
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudent.cs
@@ -0,0 +1,104 @@
+using Microsoft.VisualBasic.FileIO;
+using ProjectSession.Entities;
+using ProjectSession.Entities.Enum;
+using ProjectSession.Repositories;
+using ProjectSession.Repositories.Implementations;
+using System.Windows.Forms;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormStudent : Form
+ {
+ private readonly IStudentRepository _studentRepository;
+ private int? _studentId;
+
+ public int Id
+ {
+ set
+ {
+ try
+ {
+ var student = _studentRepository.ReadStudentById(value);
+ if (student == null)
+ {
+ throw new
+ InvalidDataException(nameof(student));
+ }
+ foreach (StudentStatus elem in Enum.GetValues(typeof(StudentStatus)))
+ {
+ if ((elem & student.Status) != 0)
+ {
+ checkedListBoxStudentStatus.SetItemChecked(checkedListBoxStudentStatus.Items.IndexOf( elem), true);
+ }
+ }
+
+ textBoxStudentLastName.Text = student.LastName;
+ textBoxStudentFirstName.Text = student.FirstName;
+ _studentId = value;
+
+
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+
+ }
+
+ }
+ }
+ public FormStudent(IStudentRepository studentRepository, IGroupRepository groupRepository)
+ {
+ InitializeComponent();
+ _studentRepository = studentRepository ?? throw new ArgumentNullException(nameof(studentRepository));
+ comboBoxStudentGroup.DataSource = groupRepository.ReadGroup();
+ comboBoxStudentGroup.DisplayMember = "Name";
+ comboBoxStudentGroup.ValueMember = "Id";
+ foreach (var elem in Enum.GetValues(typeof(StudentStatus)))
+ {
+ checkedListBoxStudentStatus.Items.Add(elem);
+ }
+
+ }
+
+ private void buttonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(textBoxStudentFirstName.Text) || string.IsNullOrWhiteSpace(textBoxStudentLastName.Text) || comboBoxStudentGroup.SelectedIndex < 0)
+ {
+ throw new Exception("Имеются незаполненныеполя");
+ }
+ if (_studentId.HasValue)
+ {
+ _studentRepository.UpdateStudent(CreateStudent(_studentId.Value));
+ }
+ else
+ {
+ _studentRepository.CreateStudent(CreateStudent(0));
+ }
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void buttonCancel_Click(object sender, EventArgs e) => Close();
+
+
+ private Student CreateStudent(int id)
+ {
+ StudentStatus studentStatus = StudentStatus.None;
+ foreach (var elem in checkedListBoxStudentStatus.CheckedItems)
+ {
+ studentStatus |= (StudentStatus)elem;
+ }
+ return Student.CreateEntity(id, textBoxStudentFirstName.Text, textBoxStudentLastName.Text, (int)comboBoxStudentGroup.SelectedValue!, studentStatus);
+ }
+
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormStudent.resx b/ProjectSession/ProjectSession/Forms/FormStudent.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudent.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.Designer.cs b/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.Designer.cs
new file mode 100644
index 0000000..3b7bbb3
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.Designer.cs
@@ -0,0 +1,149 @@
+namespace ProjectSession.Forms
+{
+ partial class FormStudentGradeBook
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ label1 = new Label();
+ buttonCancel = new Button();
+ buttonSave = new Button();
+ comboBoxStudent = new ComboBox();
+ dataGridViewExams = new DataGridView();
+ ColumnExam = new DataGridViewComboBoxColumn();
+ ColumnMark = new DataGridViewTextBoxColumn();
+ groupBoxExam = new GroupBox();
+ ((System.ComponentModel.ISupportInitialize)dataGridViewExams).BeginInit();
+ groupBoxExam.SuspendLayout();
+ SuspendLayout();
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(74, 63);
+ label1.Name = "label1";
+ label1.Size = new Size(48, 15);
+ label1.TabIndex = 0;
+ label1.Text = "студент";
+ //
+ // buttonCancel
+ //
+ buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonCancel.Location = new Point(229, 489);
+ buttonCancel.Name = "buttonCancel";
+ buttonCancel.Size = new Size(100, 48);
+ buttonCancel.TabIndex = 9;
+ buttonCancel.Text = "Отменить";
+ buttonCancel.UseVisualStyleBackColor = true;
+ buttonCancel.Click += ButtonCancel_Click;
+ //
+ // buttonSave
+ //
+ buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ buttonSave.Location = new Point(33, 489);
+ buttonSave.Name = "buttonSave";
+ buttonSave.Size = new Size(100, 48);
+ buttonSave.TabIndex = 8;
+ buttonSave.Text = "Сохранить";
+ buttonSave.UseVisualStyleBackColor = true;
+ buttonSave.Click += ButtonSave_Click;
+ //
+ // comboBoxStudent
+ //
+ comboBoxStudent.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ comboBoxStudent.FormattingEnabled = true;
+ comboBoxStudent.Location = new Point(140, 60);
+ comboBoxStudent.Name = "comboBoxStudent";
+ comboBoxStudent.Size = new Size(136, 23);
+ comboBoxStudent.TabIndex = 10;
+ //
+ // dataGridViewExams
+ //
+ dataGridViewExams.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ dataGridViewExams.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridViewExams.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridViewExams.Columns.AddRange(new DataGridViewColumn[] { ColumnExam, ColumnMark });
+ dataGridViewExams.Location = new Point(3, 19);
+ dataGridViewExams.Margin = new Padding(3, 4, 3, 4);
+ dataGridViewExams.MultiSelect = false;
+ dataGridViewExams.Name = "dataGridViewExams";
+ dataGridViewExams.RowHeadersWidth = 51;
+ dataGridViewExams.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridViewExams.Size = new Size(293, 268);
+ dataGridViewExams.TabIndex = 0;
+ //
+ // ColumnExam
+ //
+ ColumnExam.HeaderText = "экзамен";
+ ColumnExam.Name = "ColumnExam";
+ //
+ // ColumnMark
+ //
+ ColumnMark.HeaderText = "Оценка";
+ ColumnMark.Name = "ColumnMark";
+ //
+ // groupBoxExam
+ //
+ groupBoxExam.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ groupBoxExam.Controls.Add(dataGridViewExams);
+ groupBoxExam.Location = new Point(30, 130);
+ groupBoxExam.Name = "groupBoxExam";
+ groupBoxExam.Size = new Size(299, 290);
+ groupBoxExam.TabIndex = 12;
+ groupBoxExam.TabStop = false;
+ groupBoxExam.Text = "экзамены";
+ //
+ // FormStudentGradeBook
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(353, 587);
+ Controls.Add(groupBoxExam);
+ Controls.Add(comboBoxStudent);
+ Controls.Add(buttonCancel);
+ Controls.Add(buttonSave);
+ Controls.Add(label1);
+ Name = "FormStudentGradeBook";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "зачтная книжка";
+ ((System.ComponentModel.ISupportInitialize)dataGridViewExams).EndInit();
+ groupBoxExam.ResumeLayout(false);
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private Label label1;
+ private Button buttonCancel;
+ private Button buttonSave;
+ private ComboBox comboBoxStudent;
+ private DataGridView dataGridViewExams;
+ private GroupBox groupBoxExam;
+ private DataGridViewComboBoxColumn ColumnExam;
+ private DataGridViewTextBoxColumn ColumnMark;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.cs b/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.cs
new file mode 100644
index 0000000..cb28aca
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.cs
@@ -0,0 +1,62 @@
+
+using ProjectSession.Entities;
+using ProjectSession.Repositories;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormStudentGradeBook : Form
+ {
+ private readonly IStudentGradeBookRepository _studentGradeBookRepository;
+ public FormStudentGradeBook(IStudentGradeBookRepository StudentGradeBookRepository, IStudentRepository studentRepository,IExamRepository examRepository)
+ {
+ InitializeComponent();
+ _studentGradeBookRepository = StudentGradeBookRepository ?? throw new ArgumentNullException(nameof(StudentGradeBookRepository));
+ comboBoxStudent.DataSource = studentRepository.ReadStudent();
+ comboBoxStudent.DisplayMember = "FirstName";
+ comboBoxStudent.ValueMember = "Id";
+ ColumnExam.DataSource = examRepository.ReadExam();
+ ColumnExam.DisplayMember = "Name";
+ ColumnExam.ValueMember = "Id";
+
+ }
+ private void ButtonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (dataGridViewExams.RowCount < 1 || comboBoxStudent.SelectedIndex < 0)
+ {
+ throw new Exception("Имеются незаполненные поля");
+ }
+ _studentGradeBookRepository.CreateStudentGradeBook(StudentGradeBook.CreateOpeartion(0, (int)comboBoxStudent.SelectedValue!,
+ CreateListExamGradeBookFromDataGrid()));
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonCancel_Click(object sender, EventArgs e) => Close();
+
+ private List
+
+ CreateListExamGradeBookFromDataGrid()
+ {
+ var list = new List();
+ foreach (DataGridViewRow row in dataGridViewExams.Rows)
+ {
+ if (row.Cells["ColumnExam"].Value == null ||row.Cells["ColumnMark"].Value == null)
+ {
+ continue;
+ }
+ list.Add(ExamGradeBook.CreateElement(0,
+ Convert.ToInt32(row.Cells["ColumnExam"].Value),
+ Convert.ToInt32(row.Cells["ColumnMark"].Value)));
+ }
+ return list;
+ }
+
+ }
+}
+
+
diff --git a/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.resx b/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.resx
new file mode 100644
index 0000000..31dce92
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudentGradeBook.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ True
+
+
+ True
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.Designer.cs b/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.Designer.cs
new file mode 100644
index 0000000..660b321
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.Designer.cs
@@ -0,0 +1,111 @@
+namespace ProjectSession.Forms
+{
+ partial class FormStudentGradeBooks
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ dataGridViewData = new DataGridView();
+ panel1 = new Panel();
+ buttonDell = new Button();
+ buttonAdd = new Button();
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
+ panel1.SuspendLayout();
+ SuspendLayout();
+ //
+ // dataGridViewData
+ //
+ dataGridViewData.AllowUserToAddRows = false;
+ dataGridViewData.AllowUserToDeleteRows = false;
+ dataGridViewData.AllowUserToResizeColumns = false;
+ dataGridViewData.AllowUserToResizeRows = false;
+ dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridViewData.Dock = DockStyle.Fill;
+ dataGridViewData.Location = new Point(0, 0);
+ dataGridViewData.MultiSelect = false;
+ dataGridViewData.Name = "dataGridViewData";
+ dataGridViewData.ReadOnly = true;
+ dataGridViewData.RowHeadersVisible = false;
+ dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridViewData.Size = new Size(664, 450);
+ dataGridViewData.TabIndex = 5;
+ //
+ // panel1
+ //
+ panel1.Controls.Add(buttonDell);
+ panel1.Controls.Add(buttonAdd);
+ panel1.Dock = DockStyle.Right;
+ panel1.Location = new Point(664, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(136, 450);
+ panel1.TabIndex = 4;
+ //
+ // buttonDell
+ //
+ buttonDell.BackgroundImage = Properties.Resources.Del;
+ buttonDell.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDell.Location = new Point(34, 121);
+ buttonDell.Name = "buttonDell";
+ buttonDell.Size = new Size(75, 70);
+ buttonDell.TabIndex = 1;
+ buttonDell.UseVisualStyleBackColor = true;
+ buttonDell.Click += ButtonDel_Click;
+ //
+ // buttonAdd
+ //
+ buttonAdd.BackgroundImage = Properties.Resources.Add;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonAdd.Location = new Point(34, 35);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(75, 70);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
+ buttonAdd.Click += ButtonAdd_Click;
+ //
+ // FormStudentGradeBooks
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(800, 450);
+ Controls.Add(dataGridViewData);
+ Controls.Add(panel1);
+ Name = "FormStudentGradeBooks";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "зачетные книжки";
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
+ panel1.ResumeLayout(false);
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private DataGridView dataGridViewData;
+ private Panel panel1;
+ private Button buttonDell;
+ private Button buttonAdd;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.cs b/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.cs
new file mode 100644
index 0000000..31bb584
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.cs
@@ -0,0 +1,76 @@
+using ProjectSession.Repositories;
+using Unity;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormStudentGradeBooks : Form
+ {
+
+ private readonly IUnityContainer _container;
+ private readonly IStudentGradeBookRepository _studentGradeBookRepository;
+ public FormStudentGradeBooks(IUnityContainer container, IStudentGradeBookRepository StudentGradeBookRepository)
+ {
+ InitializeComponent();
+ _container = container ?? throw new ArgumentNullException(nameof(container));
+ _studentGradeBookRepository = StudentGradeBookRepository ?? throw new ArgumentNullException(nameof(StudentGradeBookRepository));
+ }
+ private void FormFeedReplenishments_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonAdd_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonDel_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
+ {
+ return;
+ }
+ try
+ {
+ _studentGradeBookRepository.DeleteStudentGradeBook(findId);
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void LoadList() => dataGridViewData.DataSource = _studentGradeBookRepository.ReadStudentGradeBook;
+
+ private bool TryGetIdentifierFromSelectedRow(out int id)
+ {
+ id = 0;
+ if (dataGridViewData.SelectedRows.Count < 1)
+ {
+ MessageBox.Show("Нет выбранной записи", "Ошибка",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return false;
+ }
+ id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
+ return true;
+ }
+
+ }
+}
diff --git a/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.resx b/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudentGradeBooks.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudents.Designer.cs b/ProjectSession/ProjectSession/Forms/FormStudents.Designer.cs
new file mode 100644
index 0000000..b965995
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudents.Designer.cs
@@ -0,0 +1,125 @@
+namespace ProjectSession.Forms
+{
+ partial class FormStudents
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ panel1 = new Panel();
+ buttonUpd = new Button();
+ buttonDell = new Button();
+ buttonAdd = new Button();
+ dataGridView = new DataGridView();
+ panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
+ SuspendLayout();
+ //
+ // panel1
+ //
+ panel1.Controls.Add(buttonUpd);
+ panel1.Controls.Add(buttonDell);
+ panel1.Controls.Add(buttonAdd);
+ panel1.Dock = DockStyle.Right;
+ panel1.Location = new Point(681, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(136, 459);
+ panel1.TabIndex = 0;
+ //
+ // buttonUpd
+ //
+ buttonUpd.BackgroundImage = Properties.Resources.Upd;
+ buttonUpd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonUpd.Location = new Point(34, 210);
+ buttonUpd.Name = "buttonUpd";
+ buttonUpd.Size = new Size(75, 70);
+ buttonUpd.TabIndex = 2;
+ buttonUpd.UseVisualStyleBackColor = true;
+ buttonUpd.Click += ButtonUpd_Click;
+ //
+ // buttonDell
+ //
+ buttonDell.BackgroundImage = Properties.Resources.Del;
+ buttonDell.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDell.Location = new Point(34, 121);
+ buttonDell.Name = "buttonDell";
+ buttonDell.Size = new Size(75, 70);
+ buttonDell.TabIndex = 1;
+ buttonDell.UseVisualStyleBackColor = true;
+ buttonDell.Click += ButtonDel_Click;
+ //
+ // buttonAdd
+ //
+ buttonAdd.BackgroundImage = Properties.Resources.Add;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonAdd.Location = new Point(34, 35);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(75, 70);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
+ buttonAdd.Click += ButtonAdd_Click;
+ //
+ // dataGridView
+ //
+ dataGridView.AllowUserToAddRows = false;
+ dataGridView.AllowUserToDeleteRows = false;
+ dataGridView.AllowUserToResizeColumns = false;
+ dataGridView.AllowUserToResizeRows = false;
+ dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridView.Dock = DockStyle.Fill;
+ dataGridView.Location = new Point(0, 0);
+ dataGridView.MultiSelect = false;
+ dataGridView.Name = "dataGridView";
+ dataGridView.ReadOnly = true;
+ dataGridView.RowHeadersVisible = false;
+ dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridView.Size = new Size(681, 459);
+ dataGridView.TabIndex = 1;
+ //
+ // FormStudents
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(817, 459);
+ Controls.Add(dataGridView);
+ Controls.Add(panel1);
+ Name = "FormStudents";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "Студенты";
+ panel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private Panel panel1;
+ private Button buttonUpd;
+ private Button buttonDell;
+ private Button buttonAdd;
+ private DataGridView dataGridView;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormStudents.cs b/ProjectSession/ProjectSession/Forms/FormStudents.cs
new file mode 100644
index 0000000..08e01a2
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudents.cs
@@ -0,0 +1,94 @@
+
+using ProjectSession.Repositories;
+using Unity;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormStudents : Form
+ {
+ private readonly IUnityContainer _container;
+
+ private readonly IStudentRepository _studentRepository;
+ public FormStudents(IUnityContainer container, IStudentRepository studentRepository)
+ {
+ InitializeComponent();
+ _container = container ?? throw new ArgumentNullException(nameof(container));
+ _studentRepository = studentRepository ?? throw new ArgumentNullException(nameof(studentRepository));
+ }
+ private void FormStudent_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при загрузке",MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonAdd_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonUpd_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ try
+ {
+ var form = _container.Resolve();
+ form.Id = findId;
+ form.ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ButtonDel_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
+ {
+ return;
+ }
+ try
+ {
+ _studentRepository.DelitStudent(findId);
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void LoadList() => dataGridView.DataSource = _studentRepository.ReadStudent();
+ private bool TryGetIdentifierFromSelectedRow(out int id)
+ {
+ id = 0;
+ if (dataGridView.SelectedRows.Count < 1)
+ {
+ MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return false;
+ }
+ id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
+ return true;
+ }
+ }
+
+}
diff --git a/ProjectSession/ProjectSession/Forms/FormStudents.resx b/ProjectSession/ProjectSession/Forms/FormStudents.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormStudents.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeacher.Designer.cs b/ProjectSession/ProjectSession/Forms/FormTeacher.Designer.cs
new file mode 100644
index 0000000..ec4cc5f
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeacher.Designer.cs
@@ -0,0 +1,141 @@
+namespace ProjectSession.Forms
+{
+ partial class FormTeacher
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ label1 = new Label();
+ label2 = new Label();
+ comboBoxTeacherPost = new ComboBox();
+ label3 = new Label();
+ textBoxTeacherFirstName = new TextBox();
+ textBoxTeacherLastName = new TextBox();
+ buttonCancel = new Button();
+ buttonSave = new Button();
+ SuspendLayout();
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(2, 69);
+ label1.Name = "label1";
+ label1.Size = new Size(116, 15);
+ label1.TabIndex = 0;
+ label1.Text = "Имя преподавателя";
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.Location = new Point(2, 98);
+ label2.Name = "label2";
+ label2.Size = new Size(143, 15);
+ label2.TabIndex = 1;
+ label2.Text = "Фамилия преподавателя";
+ //
+ // comboBoxTeacherPost
+ //
+ comboBoxTeacherPost.FormattingEnabled = true;
+ comboBoxTeacherPost.Location = new Point(162, 131);
+ comboBoxTeacherPost.Name = "comboBoxTeacherPost";
+ comboBoxTeacherPost.Size = new Size(121, 23);
+ comboBoxTeacherPost.TabIndex = 2;
+ //
+ // label3
+ //
+ label3.AutoSize = true;
+ label3.Location = new Point(2, 134);
+ label3.Name = "label3";
+ label3.Size = new Size(154, 15);
+ label3.TabIndex = 3;
+ label3.Text = "Должность преподавателя";
+ //
+ // textBoxTeacherFirstName
+ //
+ textBoxTeacherFirstName.Location = new Point(163, 61);
+ textBoxTeacherFirstName.Name = "textBoxTeacherFirstName";
+ textBoxTeacherFirstName.Size = new Size(120, 23);
+ textBoxTeacherFirstName.TabIndex = 4;
+ //
+ // textBoxTeacherLastName
+ //
+ textBoxTeacherLastName.Location = new Point(162, 95);
+ textBoxTeacherLastName.Name = "textBoxTeacherLastName";
+ textBoxTeacherLastName.Size = new Size(120, 23);
+ textBoxTeacherLastName.TabIndex = 5;
+ //
+ // buttonCancel
+ //
+ buttonCancel.Location = new Point(154, 191);
+ buttonCancel.Name = "buttonCancel";
+ buttonCancel.Size = new Size(100, 48);
+ buttonCancel.TabIndex = 9;
+ buttonCancel.Text = "Отменить";
+ buttonCancel.UseVisualStyleBackColor = true;
+ buttonCancel.Click += buttonCancel_Click;
+ //
+ // buttonSave
+ //
+ buttonSave.Location = new Point(30, 191);
+ buttonSave.Name = "buttonSave";
+ buttonSave.Size = new Size(100, 48);
+ buttonSave.TabIndex = 8;
+ buttonSave.Text = "Сохранить";
+ buttonSave.UseVisualStyleBackColor = true;
+ buttonSave.Click += buttonSave_Click;
+ //
+ // FormTeacher
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(298, 292);
+ Controls.Add(buttonCancel);
+ Controls.Add(buttonSave);
+ Controls.Add(textBoxTeacherLastName);
+ Controls.Add(textBoxTeacherFirstName);
+ Controls.Add(label3);
+ Controls.Add(comboBoxTeacherPost);
+ Controls.Add(label2);
+ Controls.Add(label1);
+ Name = "FormTeacher";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "преподаватель";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private Label label1;
+ private Label label2;
+ private ComboBox comboBoxTeacherPost;
+ private Label label3;
+ private TextBox textBoxTeacherFirstName;
+ private TextBox textBoxTeacherLastName;
+ private Button buttonCancel;
+ private Button buttonSave;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeacher.cs b/ProjectSession/ProjectSession/Forms/FormTeacher.cs
new file mode 100644
index 0000000..794c64a
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeacher.cs
@@ -0,0 +1,84 @@
+using ProjectSession.Entities;
+using ProjectSession.Entities.Enum;
+using ProjectSession.Repositories;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormTeacher : Form
+ {
+ private readonly ITeacherRepository _teacherRepository;
+ private int? _teacherId;
+
+ public int Id
+ {
+ set
+ {
+ try
+ {
+ var teacher = _teacherRepository.ReadTeacherById(value);
+ if (teacher == null)
+ {
+ throw new
+ InvalidDataException(nameof(teacher));
+ }
+ textBoxTeacherFirstName.Text = teacher.FirstName;
+ textBoxTeacherLastName.Text = teacher.LastName;
+ comboBoxTeacherPost.SelectedItem = teacher.TeacherPost;
+ _teacherId = value;
+
+
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+
+ }
+
+ }
+ }
+ public FormTeacher(ITeacherRepository teacherRepository)
+ {
+ InitializeComponent();
+ _teacherRepository = teacherRepository ??
+ throw new
+ ArgumentNullException(nameof(teacherRepository));
+ comboBoxTeacherPost.DataSource = Enum.GetValues(typeof(TeacherPost));
+ }
+
+ private void buttonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(textBoxTeacherFirstName.Text) || string.IsNullOrWhiteSpace(textBoxTeacherLastName.Text) || comboBoxTeacherPost.SelectedIndex < 1)
+ {
+ throw new Exception("Имеются незаполненныеполя");
+ }
+ if (_teacherId.HasValue)
+ {
+ _teacherRepository.UpdateTeacher(CreateTeacher(_teacherId.Value));
+ }
+ else
+ {
+ _teacherRepository.CreateTeacher(CreateTeacher(0));
+ }
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void buttonCancel_Click(object sender, EventArgs e) => Close();
+
+
+ private Teacher CreateTeacher(int id) => Teacher.CreateEntity(
+ id,
+ textBoxTeacherFirstName.Text,
+ textBoxTeacherLastName.Text,
+ (TeacherPost)comboBoxTeacherPost.SelectedItem!);
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormTeacher.resx b/ProjectSession/ProjectSession/Forms/FormTeacher.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeacher.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachers.Designer.cs b/ProjectSession/ProjectSession/Forms/FormTeachers.Designer.cs
new file mode 100644
index 0000000..5cfb6df
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachers.Designer.cs
@@ -0,0 +1,125 @@
+namespace ProjectSession.Forms
+{
+ partial class FormTeachers
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ dataGridView = new DataGridView();
+ panel1 = new Panel();
+ buttonUpd = new Button();
+ buttonDell = new Button();
+ buttonAdd = new Button();
+ ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
+ panel1.SuspendLayout();
+ SuspendLayout();
+ //
+ // dataGridView
+ //
+ dataGridView.AllowUserToAddRows = false;
+ dataGridView.AllowUserToDeleteRows = false;
+ dataGridView.AllowUserToResizeColumns = false;
+ dataGridView.AllowUserToResizeRows = false;
+ dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridView.Dock = DockStyle.Fill;
+ dataGridView.Location = new Point(0, 0);
+ dataGridView.MultiSelect = false;
+ dataGridView.Name = "dataGridView";
+ dataGridView.ReadOnly = true;
+ dataGridView.RowHeadersVisible = false;
+ dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridView.Size = new Size(664, 450);
+ dataGridView.TabIndex = 3;
+ //
+ // panel1
+ //
+ panel1.Controls.Add(buttonUpd);
+ panel1.Controls.Add(buttonDell);
+ panel1.Controls.Add(buttonAdd);
+ panel1.Dock = DockStyle.Right;
+ panel1.Location = new Point(664, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(136, 450);
+ panel1.TabIndex = 2;
+ //
+ // buttonUpd
+ //
+ buttonUpd.BackgroundImage = Properties.Resources.Upd;
+ buttonUpd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonUpd.Location = new Point(34, 210);
+ buttonUpd.Name = "buttonUpd";
+ buttonUpd.Size = new Size(75, 70);
+ buttonUpd.TabIndex = 2;
+ buttonUpd.UseVisualStyleBackColor = true;
+ buttonUpd.Click += ButtonUpd_Click;
+ //
+ // buttonDell
+ //
+ buttonDell.BackgroundImage = Properties.Resources.Del;
+ buttonDell.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDell.Location = new Point(34, 121);
+ buttonDell.Name = "buttonDell";
+ buttonDell.Size = new Size(75, 70);
+ buttonDell.TabIndex = 1;
+ buttonDell.UseVisualStyleBackColor = true;
+ buttonDell.Click += ButtonDel_Click;
+ //
+ // buttonAdd
+ //
+ buttonAdd.BackgroundImage = Properties.Resources.Add;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonAdd.Location = new Point(34, 35);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(75, 70);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
+ buttonAdd.Click += ButtonAdd_Click;
+ //
+ // FormTeachers
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(800, 450);
+ Controls.Add(dataGridView);
+ Controls.Add(panel1);
+ Name = "FormTeachers";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "преродаватели";
+ ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
+ panel1.ResumeLayout(false);
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private DataGridView dataGridView;
+ private Panel panel1;
+ private Button buttonUpd;
+ private Button buttonDell;
+ private Button buttonAdd;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachers.cs b/ProjectSession/ProjectSession/Forms/FormTeachers.cs
new file mode 100644
index 0000000..39ea452
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachers.cs
@@ -0,0 +1,94 @@
+using ProjectSession.Repositories;
+using Unity;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormTeachers : Form
+ {
+ private readonly IUnityContainer _container;
+
+ private readonly ITeacherRepository _teacherRepository;
+ public FormTeachers(IUnityContainer container, ITeacherRepository teacherRepository)
+ {
+ InitializeComponent();
+ _container = container ?? throw new ArgumentNullException(nameof(container));
+ _teacherRepository = teacherRepository ?? throw new ArgumentNullException(nameof(teacherRepository));
+ }
+ private void FormTeacher_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonAdd_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonUpd_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ try
+ {
+ var form = _container.Resolve();
+ form.Id = findId;
+ form.ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ButtonDel_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
+ {
+ return;
+ }
+ try
+ {
+ _teacherRepository.DelitTeacher(findId);
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void LoadList() => dataGridView.DataSource = _teacherRepository.ReadTeacher();
+
+ private bool TryGetIdentifierFromSelectedRow(out int id)
+ {
+ id = 0;
+ if (dataGridView.SelectedRows.Count < 1)
+ {
+ MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return false;
+ }
+ id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
+ return true;
+ }
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachers.resx b/ProjectSession/ProjectSession/Forms/FormTeachers.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachers.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.Designer.cs b/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.Designer.cs
new file mode 100644
index 0000000..173f567
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.Designer.cs
@@ -0,0 +1,145 @@
+namespace ProjectSession.Forms
+{
+ partial class FormTeachersDistribution
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ groupBoxExam = new GroupBox();
+ dataGridViewDisciplines = new DataGridView();
+ ColumnDiscipline = new DataGridViewComboBoxColumn();
+ ColumnMark = new DataGridViewTextBoxColumn();
+ comboBoxTeacher = new ComboBox();
+ buttonCancel = new Button();
+ buttonSave = new Button();
+ label1 = new Label();
+ groupBoxExam.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)dataGridViewDisciplines).BeginInit();
+ SuspendLayout();
+ //
+ // groupBoxExam
+ //
+ groupBoxExam.Controls.Add(dataGridViewDisciplines);
+ groupBoxExam.Location = new Point(22, 102);
+ groupBoxExam.Name = "groupBoxExam";
+ groupBoxExam.Size = new Size(331, 314);
+ groupBoxExam.TabIndex = 17;
+ groupBoxExam.TabStop = false;
+ groupBoxExam.Text = "дисциплины";
+ //
+ // dataGridViewDisciplines
+ //
+ dataGridViewDisciplines.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridViewDisciplines.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridViewDisciplines.Columns.AddRange(new DataGridViewColumn[] { ColumnDiscipline, ColumnMark });
+ dataGridViewDisciplines.Dock = DockStyle.Fill;
+ dataGridViewDisciplines.Location = new Point(3, 19);
+ dataGridViewDisciplines.Margin = new Padding(3, 4, 3, 4);
+ dataGridViewDisciplines.MultiSelect = false;
+ dataGridViewDisciplines.Name = "dataGridViewDisciplines";
+ dataGridViewDisciplines.RowHeadersWidth = 51;
+ dataGridViewDisciplines.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridViewDisciplines.Size = new Size(325, 292);
+ dataGridViewDisciplines.TabIndex = 0;
+ //
+ // ColumnDiscipline
+ //
+ ColumnDiscipline.HeaderText = "дисциплина";
+ ColumnDiscipline.Name = "ColumnDiscipline";
+ //
+ // ColumnMark
+ //
+ ColumnMark.HeaderText = "количество часов";
+ ColumnMark.Name = "ColumnMark";
+ //
+ // comboBoxTeacher
+ //
+ comboBoxTeacher.FormattingEnabled = true;
+ comboBoxTeacher.Location = new Point(132, 32);
+ comboBoxTeacher.Name = "comboBoxTeacher";
+ comboBoxTeacher.Size = new Size(165, 23);
+ comboBoxTeacher.TabIndex = 16;
+ //
+ // buttonCancel
+ //
+ buttonCancel.Location = new Point(250, 463);
+ buttonCancel.Name = "buttonCancel";
+ buttonCancel.Size = new Size(100, 48);
+ buttonCancel.TabIndex = 15;
+ buttonCancel.Text = "Отменить";
+ buttonCancel.UseVisualStyleBackColor = true;
+ buttonCancel.Click += ButtonCancel_Click;
+ //
+ // buttonSave
+ //
+ buttonSave.Location = new Point(25, 463);
+ buttonSave.Name = "buttonSave";
+ buttonSave.Size = new Size(100, 48);
+ buttonSave.TabIndex = 14;
+ buttonSave.Text = "Сохранить";
+ buttonSave.UseVisualStyleBackColor = true;
+ buttonSave.Click += ButtonSave_Click;
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(37, 40);
+ label1.Name = "label1";
+ label1.Size = new Size(89, 15);
+ label1.TabIndex = 13;
+ label1.Text = "преподаватель";
+ //
+ // FormTeachersDistribution
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(372, 548);
+ Controls.Add(groupBoxExam);
+ Controls.Add(comboBoxTeacher);
+ Controls.Add(buttonCancel);
+ Controls.Add(buttonSave);
+ Controls.Add(label1);
+ Name = "FormTeachersDistribution";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "распределине преподавателя";
+ groupBoxExam.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)dataGridViewDisciplines).EndInit();
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private GroupBox groupBoxExam;
+ private DataGridView dataGridViewDisciplines;
+ private ComboBox comboBoxTeacher;
+ private Button buttonCancel;
+ private Button buttonSave;
+ private Label label1;
+ private DataGridViewComboBoxColumn ColumnDiscipline;
+ private DataGridViewTextBoxColumn ColumnMark;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.cs b/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.cs
new file mode 100644
index 0000000..d31f4b1
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.cs
@@ -0,0 +1,62 @@
+using ProjectSession.Entities;
+using ProjectSession.Repositories;
+
+
+namespace ProjectSession.Forms
+{
+ public partial class FormTeachersDistribution : Form
+ {
+ private readonly ITeachersDistributionRepository _teachersDistributionRepository;
+ public FormTeachersDistribution(ITeachersDistributionRepository teachersDistributionRepository, ITeacherRepository teacherRepository, IDisciplineRepository disciplineRepository)
+ {
+ InitializeComponent();
+ _teachersDistributionRepository = teachersDistributionRepository ?? throw new ArgumentNullException(nameof(teachersDistributionRepository));
+ comboBoxTeacher.DataSource = teacherRepository.ReadTeacher();
+ comboBoxTeacher.DisplayMember = "FirstName";
+ comboBoxTeacher.ValueMember = "Id";
+ ColumnDiscipline.DataSource = disciplineRepository.ReadDiscipline();
+ ColumnDiscipline.DisplayMember = "Name";
+ ColumnDiscipline.ValueMember = "Id";
+
+ }
+ private void ButtonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (dataGridViewDisciplines.RowCount < 1 || comboBoxTeacher.SelectedIndex < 0)
+ {
+ throw new Exception("Имеются незаполненные поля");
+ }
+ _teachersDistributionRepository.CreateTeachersDistribution(TeachersDistribution.CreateOpeartion(0, (int)comboBoxTeacher.SelectedValue!,
+ CreateListExamGradeBookFromDataGrid()));
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonCancel_Click(object sender, EventArgs e) =>
+ Close();
+ private List
+ CreateListExamGradeBookFromDataGrid()
+ {
+ var list = new List();
+ foreach (DataGridViewRow row in dataGridViewDisciplines.Rows)
+ {
+ if (row.Cells["ColumnDiscipline"].Value == null ||
+ row.Cells["ColumnNumberHours"].Value == null)
+ {
+ continue;
+ }
+ list.Add(DisciplineTeachersDistribution.CreateElement(0,
+ Convert.ToInt32(row.Cells["ColumnDiscipline"].Value),
+ Convert.ToInt32(row.Cells["ColumnNumberHours"].Value)));
+ }
+ return list;
+ }
+
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.resx b/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.resx
new file mode 100644
index 0000000..7f1251b
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachersDistribution.resx
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.Designer.cs b/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.Designer.cs
new file mode 100644
index 0000000..d9fa022
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.Designer.cs
@@ -0,0 +1,111 @@
+namespace ProjectSession.Forms
+{
+ partial class FormTeachersDistributions
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ dataGridViewData = new DataGridView();
+ panel1 = new Panel();
+ buttonDell = new Button();
+ buttonAdd = new Button();
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
+ panel1.SuspendLayout();
+ SuspendLayout();
+ //
+ // dataGridViewData
+ //
+ dataGridViewData.AllowUserToAddRows = false;
+ dataGridViewData.AllowUserToDeleteRows = false;
+ dataGridViewData.AllowUserToResizeColumns = false;
+ dataGridViewData.AllowUserToResizeRows = false;
+ dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridViewData.Dock = DockStyle.Fill;
+ dataGridViewData.Location = new Point(0, 0);
+ dataGridViewData.MultiSelect = false;
+ dataGridViewData.Name = "dataGridViewData";
+ dataGridViewData.ReadOnly = true;
+ dataGridViewData.RowHeadersVisible = false;
+ dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ dataGridViewData.Size = new Size(664, 450);
+ dataGridViewData.TabIndex = 7;
+ //
+ // panel1
+ //
+ panel1.Controls.Add(buttonDell);
+ panel1.Controls.Add(buttonAdd);
+ panel1.Dock = DockStyle.Right;
+ panel1.Location = new Point(664, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(136, 450);
+ panel1.TabIndex = 6;
+ //
+ // buttonDell
+ //
+ buttonDell.BackgroundImage = Properties.Resources.Del;
+ buttonDell.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDell.Location = new Point(34, 121);
+ buttonDell.Name = "buttonDell";
+ buttonDell.Size = new Size(75, 70);
+ buttonDell.TabIndex = 1;
+ buttonDell.UseVisualStyleBackColor = true;
+ buttonDell.Click += ButtonDel_Click;
+ //
+ // buttonAdd
+ //
+ buttonAdd.BackgroundImage = Properties.Resources.Add;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonAdd.Location = new Point(34, 35);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(75, 70);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
+ buttonAdd.Click += ButtonAdd_Click;
+ //
+ // FormTeachersDistributions
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(800, 450);
+ Controls.Add(dataGridViewData);
+ Controls.Add(panel1);
+ Name = "FormTeachersDistributions";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "распределения учителей";
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
+ panel1.ResumeLayout(false);
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private DataGridView dataGridViewData;
+ private Panel panel1;
+ private Button buttonDell;
+ private Button buttonAdd;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.cs b/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.cs
new file mode 100644
index 0000000..71478e4
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.cs
@@ -0,0 +1,75 @@
+using ProjectSession.Repositories;
+using Unity;
+
+namespace ProjectSession.Forms
+{
+ public partial class FormTeachersDistributions : Form
+ {
+ private readonly IUnityContainer _container;
+ private readonly ITeachersDistributionRepository _TeachersDistributionRepository;
+ public FormTeachersDistributions(IUnityContainer container, ITeachersDistributionRepository teachersDistributionRepository)
+ {
+ InitializeComponent();
+ _container = container ?? throw new ArgumentNullException(nameof(container));
+ _TeachersDistributionRepository = teachersDistributionRepository ?? throw new ArgumentNullException(nameof(teachersDistributionRepository));
+ }
+ private void FormFeedReplenishments_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonAdd_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ _container.Resolve().ShowDialog();
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonDel_Click(object sender, EventArgs e)
+ {
+ if (!TryGetIdentifierFromSelectedRow(out var findId))
+ {
+ return;
+ }
+ if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
+ {
+ return;
+ }
+ try
+ {
+ _TeachersDistributionRepository.DeleteTeachersDistribution(findId);
+ LoadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void LoadList() => dataGridViewData.DataSource = _TeachersDistributionRepository.ReadStudentTeachersDistribution;
+ private bool TryGetIdentifierFromSelectedRow(out int id)
+ {
+ id = 0;
+ if (dataGridViewData.SelectedRows.Count < 1)
+ {
+ MessageBox.Show("Нет выбранной записи", "Ошибка",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return false;
+ }
+ id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
+ return true;
+ }
+
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.resx b/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectSession/ProjectSession/Forms/FormTeachersDistributions.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Program.cs b/ProjectSession/ProjectSession/Program.cs
index 63613d2..6e77779 100644
--- a/ProjectSession/ProjectSession/Program.cs
+++ b/ProjectSession/ProjectSession/Program.cs
@@ -1,3 +1,7 @@
+using ProjectSession.Repositories;
+using ProjectSession.Repositories.Implementations;
+using Unity;
+
namespace ProjectSession
{
internal static class Program
@@ -11,7 +15,21 @@ namespace ProjectSession
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
- Application.Run(new Form1());
+ Application.Run(CreateContainer().Resolve());
+ }
+
+ private static IUnityContainer CreateContainer()
+ {
+ var container = new UnityContainer();
+
+ container.RegisterType();
+ container.RegisterType();
+ container.RegisterType();
+ container.RegisterType();
+ container.RegisterType();
+ container.RegisterType();
+ container.RegisterType();
+ return container;
}
}
}
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/ProjectSession.csproj b/ProjectSession/ProjectSession/ProjectSession.csproj
index 663fdb8..accbdf0 100644
--- a/ProjectSession/ProjectSession/ProjectSession.csproj
+++ b/ProjectSession/ProjectSession/ProjectSession.csproj
@@ -8,4 +8,23 @@
enable
+
+
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Properties/Resources.Designer.cs b/ProjectSession/ProjectSession/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..639aa47
--- /dev/null
+++ b/ProjectSession/ProjectSession/Properties/Resources.Designer.cs
@@ -0,0 +1,113 @@
+//------------------------------------------------------------------------------
+//
+// Этот код создан программой.
+// Исполняемая версия:4.0.30319.42000
+//
+// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+// повторной генерации кода.
+//
+//------------------------------------------------------------------------------
+
+namespace ProjectSession.Properties {
+ using System;
+
+
+ ///
+ /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
+ ///
+ // Этот класс создан автоматически классом StronglyTypedResourceBuilder
+ // с помощью такого средства, как ResGen или Visual Studio.
+ // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
+ // с параметром /str или перестройте свой проект VS.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectSession.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Перезаписывает свойство CurrentUICulture текущего потока для всех
+ /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Add {
+ get {
+ object obj = ResourceManager.GetObject("Add", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Del {
+ get {
+ object obj = ResourceManager.GetObject("Del", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap img_sessia {
+ get {
+ object obj = ResourceManager.GetObject("img-sessia", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap img_sessia1 {
+ get {
+ object obj = ResourceManager.GetObject("img-sessia1", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Upd {
+ get {
+ object obj = ResourceManager.GetObject("Upd", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Properties/Resources.resx b/ProjectSession/ProjectSession/Properties/Resources.resx
new file mode 100644
index 0000000..31c9d66
--- /dev/null
+++ b/ProjectSession/ProjectSession/Properties/Resources.resx
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\img-sessia.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Del.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\img-sessia.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Upd.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/ProjectSession/ProjectSession/Repositories/IDisciplineRepository.cs b/ProjectSession/ProjectSession/Repositories/IDisciplineRepository.cs
new file mode 100644
index 0000000..6adb45e
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/IDisciplineRepository.cs
@@ -0,0 +1,38 @@
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories
+{
+ public interface IDisciplineRepository
+ {
+ ///
+ /// получение
+ ///
+ ///
+ IEnumerable ReadDiscipline();
+
+ ///
+ /// чтение по id
+ ///
+ ///
+ ///
+ Discipline ReadDisciplineById(int id);
+
+ ///
+ /// создание
+ ///
+ ///
+ void CreateDiscipline(Discipline discipline);
+
+ ///
+ /// обновление
+ ///
+ ///
+ void UpdateDiscipline(Discipline discipline);
+
+ ///
+ /// удаление
+ ///
+ ///
+ void DelitDiscipline(int id);
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/IExamRepository.cs b/ProjectSession/ProjectSession/Repositories/IExamRepository.cs
new file mode 100644
index 0000000..fa8378a
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/IExamRepository.cs
@@ -0,0 +1,11 @@
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories
+{
+ public interface IExamRepository
+ {
+ IEnumerable ReadExam(DateTime? dateTime = null, int? examId =null, string? name =null );
+
+ void CreateExam( Exam exam );
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/IGroupRepository.cs b/ProjectSession/ProjectSession/Repositories/IGroupRepository.cs
new file mode 100644
index 0000000..d7b4f70
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/IGroupRepository.cs
@@ -0,0 +1,44 @@
+using ProjectSession.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectSession.Repositories
+{
+ public interface IGroupRepository
+ {
+ ///
+ /// получение
+ ///
+ ///
+ IEnumerable ReadGroup();
+
+
+ ///
+ /// чтение по id
+ ///
+ ///
+ ///
+ Group ReadGroupById(int id);
+
+ ///
+ /// создание
+ ///
+ ///
+ void CreateGroup(Group group);
+
+ ///
+ /// обновление
+ ///
+ ///
+ void UpdateGroup(Group group);
+
+ ///
+ /// удаление
+ ///
+ ///
+ void DelitGroup(int id);
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/IStudentGradeBookRepository.cs b/ProjectSession/ProjectSession/Repositories/IStudentGradeBookRepository.cs
new file mode 100644
index 0000000..926dba7
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/IStudentGradeBookRepository.cs
@@ -0,0 +1,17 @@
+using ProjectSession.Entities;
+using ProjectSession.Repositories.Implementations;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectSession.Repositories
+{
+ public interface IStudentGradeBookRepository
+ {
+ IEnumerable ReadStudentGradeBook(int? studentId = null, int? examId = null);
+ void CreateStudentGradeBook(StudentGradeBook studentGradeBook);
+ void DeleteStudentGradeBook(int id);
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/IStudentRepository.cs b/ProjectSession/ProjectSession/Repositories/IStudentRepository.cs
new file mode 100644
index 0000000..826cbf4
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/IStudentRepository.cs
@@ -0,0 +1,39 @@
+
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories
+{
+ public interface IStudentRepository
+ {
+ ///
+ /// получение
+ ///
+ ///
+ IEnumerable ReadStudent();
+
+ ///
+ /// чтение по id
+ ///
+ ///
+ ///
+ Student ReadStudentById(int id);
+
+ ///
+ /// создание
+ ///
+ ///
+ void CreateStudent(Student student);
+
+ ///
+ /// обновление
+ ///
+ ///
+ void UpdateStudent(Student student);
+
+ ///
+ /// удаление
+ ///
+ ///
+ void DelitStudent(int id);
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/ITeacherRepository.cs b/ProjectSession/ProjectSession/Repositories/ITeacherRepository.cs
new file mode 100644
index 0000000..7d8df43
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/ITeacherRepository.cs
@@ -0,0 +1,39 @@
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories
+{
+ public interface ITeacherRepository
+ {
+ ///
+ /// получение
+ ///
+ ///
+ IEnumerable ReadTeacher();
+
+ ///
+ /// чтение по id
+ ///
+ ///
+ ///
+ Teacher ReadTeacherById(int id);
+
+ ///
+ /// создание
+ ///
+ ///
+ void CreateTeacher(Teacher teacher);
+
+ ///
+ /// обновление
+ ///
+ ///
+ void UpdateTeacher(Teacher teacher);
+
+ ///
+ /// удаление
+ ///
+ ///
+ void DelitTeacher(int id);
+ }
+}
+
diff --git a/ProjectSession/ProjectSession/Repositories/ITeachersDistributionRepository.cs b/ProjectSession/ProjectSession/Repositories/ITeachersDistributionRepository.cs
new file mode 100644
index 0000000..a3b36c5
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/ITeachersDistributionRepository.cs
@@ -0,0 +1,11 @@
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories
+{
+ public interface ITeachersDistributionRepository
+ {
+ IEnumerable ReadStudentTeachersDistribution(int? teacherId = null, int? disciplineId = null);
+ void CreateTeachersDistribution(TeachersDistribution teachersDistribution);
+ void DeleteTeachersDistribution(int id);
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/Implementations/DisciplineRepository.cs b/ProjectSession/ProjectSession/Repositories/Implementations/DisciplineRepository.cs
new file mode 100644
index 0000000..55447b8
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/Implementations/DisciplineRepository.cs
@@ -0,0 +1,32 @@
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories.Implementations
+{
+ public class DisciplineRepository : IDisciplineRepository
+ {
+ public void CreateDiscipline(Discipline discipline)
+ {
+
+ }
+
+ public void DelitDiscipline(int id)
+ {
+
+ }
+
+ public IEnumerable ReadDiscipline()
+ {
+ return [];
+ }
+
+ public Discipline ReadDisciplineById(int id)
+ {
+ return Discipline.CreateEntity(0,string.Empty,0);
+ }
+
+ public void UpdateDiscipline(Discipline discipline)
+ {
+
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/Implementations/ExamRepository.cs b/ProjectSession/ProjectSession/Repositories/Implementations/ExamRepository.cs
new file mode 100644
index 0000000..62e9806
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/Implementations/ExamRepository.cs
@@ -0,0 +1,17 @@
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories.Implementations
+{
+ internal class ExamRepository : IExamRepository
+ {
+ public void CreateExam(Exam exam)
+ {
+
+ }
+
+ public IEnumerable ReadExam(DateTime? dateTime = null, int? examId = null, string? name = null)
+ {
+ return [];
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/Implementations/GroupRepository.cs b/ProjectSession/ProjectSession/Repositories/Implementations/GroupRepository.cs
new file mode 100644
index 0000000..6d2d4f8
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/Implementations/GroupRepository.cs
@@ -0,0 +1,37 @@
+using ProjectSession.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectSession.Repositories.Implementations
+{
+ public class GroupRepository : IGroupRepository
+ {
+ public void CreateGroup(Group group)
+ {
+
+ }
+
+ public void DelitGroup(int id)
+ {
+
+ }
+
+
+ public IEnumerable ReadGroup()
+ {
+ return [];
+ }
+
+ public Group ReadGroupById(int id)
+ {
+ return Group.CreateEntity(0, string.Empty, 0);
+ }
+
+ public void UpdateGroup(Group group)
+ {
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/Implementations/StudentGradeBookRepository.cs b/ProjectSession/ProjectSession/Repositories/Implementations/StudentGradeBookRepository.cs
new file mode 100644
index 0000000..df9b25a
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/Implementations/StudentGradeBookRepository.cs
@@ -0,0 +1,20 @@
+using ProjectSession.Entities;
+
+namespace ProjectSession.Repositories.Implementations
+{
+ public class StudentGradeBookRepository : IStudentGradeBookRepository
+ {
+ public void CreateStudentGradeBook(StudentGradeBook studentGradeBook)
+ {
+ }
+
+ public void DeleteStudentGradeBook(int id)
+ {
+ }
+
+ public IEnumerable ReadStudentGradeBook( int? studentId = null, int? examId = null)
+ {
+ return [];
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/Implementations/StudentRepository.cs b/ProjectSession/ProjectSession/Repositories/Implementations/StudentRepository.cs
new file mode 100644
index 0000000..ee2b50c
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/Implementations/StudentRepository.cs
@@ -0,0 +1,34 @@
+using ProjectSession.Entities;
+using ProjectSession.Entities.Enum;
+
+
+namespace ProjectSession.Repositories.Implementations
+{
+ public class StudentRepository : IStudentRepository
+ {
+ public void CreateStudent(Student student)
+ {
+
+ }
+
+ public void DelitStudent(int id)
+ {
+
+ }
+
+ public IEnumerable ReadStudent()
+ {
+ return [];
+ }
+
+ public Student ReadStudentById(int id)
+ {
+ return Student.CreateEntity(0, string.Empty,string.Empty,0, StudentStatus.None);
+ }
+
+ public void UpdateStudent(Student student)
+ {
+
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/Implementations/TeacherRepository.cs b/ProjectSession/ProjectSession/Repositories/Implementations/TeacherRepository.cs
new file mode 100644
index 0000000..7edb294
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/Implementations/TeacherRepository.cs
@@ -0,0 +1,33 @@
+using ProjectSession.Entities;
+
+
+namespace ProjectSession.Repositories.Implementations
+{
+ internal class TeacherRepository : ITeacherRepository
+ {
+ public void CreateTeacher(Teacher teacher)
+ {
+
+ }
+
+ public void DelitTeacher(int id)
+ {
+
+ }
+
+ public IEnumerable ReadTeacher()
+ {
+ return [];
+ }
+
+ public Teacher ReadTeacherById(int id)
+ {
+ return Teacher.CreateEntity(1, string.Empty, string.Empty, 0);
+ }
+
+ public void UpdateTeacher(Teacher teacher)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Repositories/Implementations/TeachersDistributionRepository.cs b/ProjectSession/ProjectSession/Repositories/Implementations/TeachersDistributionRepository.cs
new file mode 100644
index 0000000..ee80e6e
--- /dev/null
+++ b/ProjectSession/ProjectSession/Repositories/Implementations/TeachersDistributionRepository.cs
@@ -0,0 +1,25 @@
+using ProjectSession.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectSession.Repositories.Implementations
+{
+ internal class TeachersDistributionRepository : ITeachersDistributionRepository
+ {
+ public void CreateTeachersDistribution(TeachersDistribution teachersDistribution)
+ {
+ }
+
+ public void DeleteTeachersDistribution(int id)
+ {
+ }
+
+ public IEnumerable ReadStudentTeachersDistribution(int? teacherId = null, int? disciplineId = null)
+ {
+ return [];
+ }
+ }
+}
diff --git a/ProjectSession/ProjectSession/Resources/Add.png b/ProjectSession/ProjectSession/Resources/Add.png
new file mode 100644
index 0000000..079cda0
Binary files /dev/null and b/ProjectSession/ProjectSession/Resources/Add.png differ
diff --git a/ProjectSession/ProjectSession/Resources/Del.png b/ProjectSession/ProjectSession/Resources/Del.png
new file mode 100644
index 0000000..2b4c356
Binary files /dev/null and b/ProjectSession/ProjectSession/Resources/Del.png differ
diff --git a/ProjectSession/ProjectSession/Resources/Upd.png b/ProjectSession/ProjectSession/Resources/Upd.png
new file mode 100644
index 0000000..79dd85f
Binary files /dev/null and b/ProjectSession/ProjectSession/Resources/Upd.png differ
diff --git a/ProjectSession/ProjectSession/Resources/img-sessia.jpg b/ProjectSession/ProjectSession/Resources/img-sessia.jpg
new file mode 100644
index 0000000..f6cb562
Binary files /dev/null and b/ProjectSession/ProjectSession/Resources/img-sessia.jpg differ