2 новые формы

This commit is contained in:
Anastasia Yazykova 2024-12-04 05:45:53 +04:00
parent c015aab079
commit 242c61b655
11 changed files with 810 additions and 35 deletions

View File

@ -16,7 +16,7 @@ namespace Academic_Performance.Entities
public Value? Value { get; private set; }
public DateTime Date { get; private set; }
public static Mark CreateEntity(int id, int studentId, int statmentSubjectId, int statmentTeacherId, Value value)
public static Mark CreateOperation(int id, int studentId, int statmentSubjectId, int statmentTeacherId, Value value)
{
return new Mark
{

View File

@ -28,12 +28,142 @@
/// </summary>
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 = "FormMark";
comboBoxTeacher = new ComboBox();
comboBoxStudent = new ComboBox();
comboBoxSubject = new ComboBox();
comboBoxValue = new ComboBox();
buttonSave = new Button();
buttonEx = new Button();
label1 = new Label();
label2 = new Label();
label3 = new Label();
label4 = new Label();
SuspendLayout();
//
// comboBoxTeacher
//
comboBoxTeacher.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxTeacher.FormattingEnabled = true;
comboBoxTeacher.Location = new Point(256, 32);
comboBoxTeacher.Name = "comboBoxTeacher";
comboBoxTeacher.Size = new Size(357, 33);
comboBoxTeacher.TabIndex = 0;
//
// comboBoxStudent
//
comboBoxStudent.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxStudent.FormattingEnabled = true;
comboBoxStudent.Location = new Point(256, 101);
comboBoxStudent.Name = "comboBoxStudent";
comboBoxStudent.Size = new Size(357, 33);
comboBoxStudent.TabIndex = 1;
//
// comboBoxSubject
//
comboBoxSubject.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxSubject.FormattingEnabled = true;
comboBoxSubject.Location = new Point(256, 172);
comboBoxSubject.Name = "comboBoxSubject";
comboBoxSubject.Size = new Size(357, 33);
comboBoxSubject.TabIndex = 2;
//
// comboBoxValue
//
comboBoxValue.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxValue.FormattingEnabled = true;
comboBoxValue.Location = new Point(256, 250);
comboBoxValue.Name = "comboBoxValue";
comboBoxValue.Size = new Size(357, 33);
comboBoxValue.TabIndex = 3;
//
// buttonSave
//
buttonSave.Location = new Point(85, 376);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(112, 34);
buttonSave.TabIndex = 4;
buttonSave.Text = "button1";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += buttonSave_Click;
//
// buttonEx
//
buttonEx.Location = new Point(465, 376);
buttonEx.Name = "buttonEx";
buttonEx.Size = new Size(112, 34);
buttonEx.TabIndex = 5;
buttonEx.Text = "button2";
buttonEx.UseVisualStyleBackColor = true;
buttonEx.Click += buttonEx_Click;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(49, 40);
label1.Name = "label1";
label1.Size = new Size(183, 25);
label1.TabIndex = 6;
label1.Text = "ФИО Преподавателя";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(46, 109);
label2.Name = "label2";
label2.Size = new Size(129, 25);
label2.TabIndex = 7;
label2.Text = "ФИО Студента";
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(49, 180);
label3.Name = "label3";
label3.Size = new Size(84, 25);
label3.TabIndex = 8;
label3.Text = "Предмет";
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(49, 258);
label4.Name = "label4";
label4.Size = new Size(74, 25);
label4.TabIndex = 9;
label4.Text = "Оценка";
//
// FormMark
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(label4);
Controls.Add(label3);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(buttonEx);
Controls.Add(buttonSave);
Controls.Add(comboBoxValue);
Controls.Add(comboBoxSubject);
Controls.Add(comboBoxStudent);
Controls.Add(comboBoxTeacher);
Name = "FormMark";
Text = "FormMark";
ResumeLayout(false);
PerformLayout();
}
#endregion
private ComboBox comboBoxTeacher;
private ComboBox comboBoxStudent;
private ComboBox comboBoxSubject;
private ComboBox comboBoxValue;
private Button buttonSave;
private Button buttonEx;
private Label label1;
private Label label2;
private Label label3;
private Label label4;
}
}

View File

@ -1,7 +1,11 @@
using System;
using Academic_Performance.Entities;
using Academic_Performance.Entities.Enums;
using Academic_Performance.Repositories;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
@ -12,9 +16,55 @@ namespace Academic_Performance.Forms
{
public partial class FormMark : Form
{
public FormMark()
private readonly IMarkRepository _markRepository;
public FormMark(IMarkRepository examConductingRepository, ITeacherRepository teacherRepository, ISubjectRepository subjectRepository, IStudentRepository studentRepository)
{
InitializeComponent();
_markRepository = examConductingRepository ??
throw new ArgumentNullException(nameof(examConductingRepository));
comboBoxTeacher.DataSource = teacherRepository.ReadTeachers();
comboBoxTeacher.DisplayMember = "Name";
comboBoxTeacher.ValueMember = "Id";
comboBoxSubject.DataSource = subjectRepository.ReadSubject();
comboBoxSubject.DisplayMember = "Name";
comboBoxSubject.ValueMember = "Id";
comboBoxStudent.DataSource = studentRepository.ReadStudent();
comboBoxStudent.DisplayMember = "Name";
comboBoxStudent.ValueMember = "Id";
comboBoxValue.DataSource = Enum.GetValues(typeof(Value));
}
private void buttonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxTeacher.SelectedIndex < 0 || comboBoxSubject.SelectedIndex < 0 ||
comboBoxStudent.SelectedIndex < 0 || comboBoxValue.SelectedIndex < 1)
{
throw new Exception("Имеются незаполненные поля");
}
_markRepository.AddMark(Mark.CreateOperation(0, (int)comboBoxStudent.SelectedValue!, (int)comboBoxSubject.SelectedValue!, (int)comboBoxTeacher.SelectedValue!,
(Value)comboBoxValue.SelectedItem!));
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка сохранения", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void buttonEx_Click(object sender, EventArgs e)
=> Close();
}
}

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->

View File

@ -0,0 +1,109 @@
namespace Academic_Performance.Forms
{
partial class FormMarks
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
panel1 = new Panel();
buttonDel = new Button();
buttonSave = new Button();
dataGridView = new DataGridView();
panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// panel1
//
panel1.Controls.Add(buttonDel);
panel1.Controls.Add(buttonSave);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(591, 0);
panel1.Name = "panel1";
panel1.Size = new Size(209, 450);
panel1.TabIndex = 2;
//
// buttonDel
//
buttonDel.BackgroundImage = Properties.Resources.Del;
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
buttonDel.Location = new Point(52, 324);
buttonDel.Name = "buttonDel";
buttonDel.Size = new Size(112, 98);
buttonDel.TabIndex = 2;
buttonDel.UseVisualStyleBackColor = true;
//
// buttonSave
//
buttonSave.BackgroundImage = Properties.Resources.Add;
buttonSave.BackgroundImageLayout = ImageLayout.Stretch;
buttonSave.Location = new Point(52, 28);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(112, 93);
buttonSave.TabIndex = 0;
buttonSave.UseVisualStyleBackColor = true;
//
// 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.RowHeadersWidth = 62;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(591, 450);
dataGridView.TabIndex = 3;
//
// FormMarks
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(dataGridView);
Controls.Add(panel1);
Name = "FormMarks";
Text = "FormMarks";
panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panel1;
private Button buttonDel;
private Button buttonSave;
private DataGridView dataGridView;
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Academic_Performance.Forms
{
public partial class FormMarks : Form
{
public FormMarks()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,151 @@
namespace Academic_Performance.Forms
{
partial class FormStatement
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
dateTimePickerDateIntroductionSubject = new DateTimePicker();
groupBoxAssessment = new GroupBox();
buttonEx = new Button();
buttonSave = new Button();
dataGridView1 = new DataGridView();
ColTeacher = new DataGridViewComboBoxColumn();
ColSubject = new DataGridViewComboBoxColumn();
Lable = new Label();
groupBoxAssessment.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// dateTimePickerDateIntroductionSubject
//
dateTimePickerDateIntroductionSubject.Location = new Point(70, 35);
dateTimePickerDateIntroductionSubject.Margin = new Padding(4, 3, 4, 3);
dateTimePickerDateIntroductionSubject.Name = "dateTimePickerDateIntroductionSubject";
dateTimePickerDateIntroductionSubject.Size = new Size(222, 31);
dateTimePickerDateIntroductionSubject.TabIndex = 31;
//
// groupBoxAssessment
//
groupBoxAssessment.Controls.Add(buttonEx);
groupBoxAssessment.Controls.Add(buttonSave);
groupBoxAssessment.Controls.Add(dataGridView1);
groupBoxAssessment.Dock = DockStyle.Bottom;
groupBoxAssessment.Location = new Point(0, 126);
groupBoxAssessment.Margin = new Padding(4, 5, 4, 5);
groupBoxAssessment.Name = "groupBoxAssessment";
groupBoxAssessment.Padding = new Padding(4, 5, 4, 5);
groupBoxAssessment.Size = new Size(800, 528);
groupBoxAssessment.TabIndex = 32;
groupBoxAssessment.TabStop = false;
groupBoxAssessment.Text = "Ведомость";
//
// buttonEx
//
buttonEx.Location = new Point(507, 393);
buttonEx.Name = "buttonEx";
buttonEx.Size = new Size(112, 34);
buttonEx.TabIndex = 2;
buttonEx.Text = "Отмена";
buttonEx.UseVisualStyleBackColor = true;
//
// buttonSave
//
buttonSave.Location = new Point(91, 400);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(112, 34);
buttonSave.TabIndex = 1;
buttonSave.Text = "Сохранение";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += buttonSave_Click;
//
// dataGridView1
//
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { ColTeacher, ColSubject });
dataGridView1.Location = new Point(33, 51);
dataGridView1.Margin = new Padding(4, 5, 4, 5);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1";
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 62;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(692, 259);
dataGridView1.TabIndex = 0;
//
// ColTeacher
//
ColTeacher.HeaderText = "Преподаватель";
ColTeacher.MinimumWidth = 8;
ColTeacher.Name = "ColTeacher";
//
// ColSubject
//
ColSubject.HeaderText = "Предмет";
ColSubject.MinimumWidth = 8;
ColSubject.Name = "ColSubject";
//
// Lable
//
Lable.AutoSize = true;
Lable.Location = new Point(14, 40);
Lable.Name = "Lable";
Lable.Size = new Size(49, 25);
Lable.TabIndex = 33;
Lable.Text = "Дата";
//
// FormStatement
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 654);
Controls.Add(Lable);
Controls.Add(groupBoxAssessment);
Controls.Add(dateTimePickerDateIntroductionSubject);
Name = "FormStatement";
Text = "FormStatement";
groupBoxAssessment.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private DateTimePicker dateTimePickerDateIntroductionSubject;
private GroupBox groupBoxAssessment;
private DataGridView dataGridView1;
private Label Lable;
private Button buttonEx;
private Button buttonSave;
private DataGridViewComboBoxColumn ColTeacher;
private DataGridViewComboBoxColumn ColSubject;
}
}

View File

@ -0,0 +1,63 @@
using Academic_Performance.Entities;
using Academic_Performance.Repositories;
using Academic_Performance.Repositories.Implementations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Academic_Performance.Forms
{
public partial class FormStatement : Form
{
private readonly IStatementRepository _statementRepository;
public FormStatement(IStatementRepository statementRepository, ITeacherRepository teacherRepository,
ISubjectRepository subjectRepository)
{
InitializeComponent();
_statementRepository = statementRepository ??
throw new ArgumentNullException(nameof(statementRepository));
ColTeacher.DataSource = teacherRepository.ReadTeachers();
ColTeacher.DisplayMember = "Name";
ColTeacher.ValueMember = "Id";
ColSubject.DataSource = subjectRepository.ReadSubject();
ColSubject.DisplayMember = "Name";
ColSubject.ValueMember = "Id";
}
private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void buttonSave_Click(object sender, EventArgs e)
{
try
{
if (dataGridView1.RowCount < 1)
{
throw new Exception("Имеются незаполненные поля");
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ColTeacher.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColSubject.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColTeacher.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColSubject.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -25,7 +25,7 @@ namespace Academic_Performance.Repositories.Implementations
public Mark GetMarkById(int id)
{
return Mark.CreateEntity(0, 0, 0, 0, Value.One);
return Mark.CreateOperation(0, 0, 0, 0, Value.One);
}
public IEnumerable<Mark> GetAllMarks()