Добавление связи "многие ко многим" и разделения
This commit is contained in:
parent
a902a2d7bb
commit
91af80d9ea
@ -5,9 +5,13 @@ namespace ProjectSchedule.Entities;
|
|||||||
public class Audience
|
public class Audience
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
public string NumberAudience { get; private set; } = string.Empty;
|
public string NumberAudience { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public TypeAudience TypeAudience { get; private set; }
|
public TypeAudience TypeAudience { get; private set; }
|
||||||
|
|
||||||
public int QuantitySeats { get; private set; }
|
public int QuantitySeats { get; private set; }
|
||||||
|
|
||||||
public static Audience CreateEntity(int id, string numberAudience, TypeAudience typeAudience, int quantitySeats)
|
public static Audience CreateEntity(int id, string numberAudience, TypeAudience typeAudience, int quantitySeats)
|
||||||
{
|
{
|
||||||
return new Audience
|
return new Audience
|
||||||
|
@ -5,14 +5,23 @@ namespace ProjectSchedule.Entities;
|
|||||||
public class CompilingSchedule
|
public class CompilingSchedule
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
public int EducatorId { get; private set; }
|
public int EducatorId { get; private set; }
|
||||||
|
|
||||||
public int DisciplineId { get; private set; }
|
public int DisciplineId { get; private set; }
|
||||||
|
|
||||||
public int GroupStudentsId { get; private set; }
|
public int GroupStudentsId { get; private set; }
|
||||||
|
|
||||||
public int AudienceId { get; private set; }
|
public int AudienceId { get; private set; }
|
||||||
|
|
||||||
public TypeWeek TypeWeek { get; private set; }
|
public TypeWeek TypeWeek { get; private set; }
|
||||||
|
|
||||||
public int NumberDay { get; private set; }
|
public int NumberDay { get; private set; }
|
||||||
|
|
||||||
public int NumberPair { get; private set; }
|
public int NumberPair { get; private set; }
|
||||||
|
|
||||||
public TypeActivity TypeActivity { get; private set; }
|
public TypeActivity TypeActivity { get; private set; }
|
||||||
|
|
||||||
public static CompilingSchedule CreateOperation(int id, int educatorId, int disciplineId, int groupStudentsId, int audienceId, TypeWeek typeWeek,
|
public static CompilingSchedule CreateOperation(int id, int educatorId, int disciplineId, int groupStudentsId, int audienceId, TypeWeek typeWeek,
|
||||||
int numberDay, int numberPair, TypeActivity typeActivity)
|
int numberDay, int numberPair, TypeActivity typeActivity)
|
||||||
{
|
{
|
||||||
|
@ -3,24 +3,25 @@
|
|||||||
public class CurriculumSupplement
|
public class CurriculumSupplement
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public int DisciplineId { get; private set; }
|
|
||||||
public int GroupStudentsId { get; private set; }
|
public int GroupStudentsId { get; private set; }
|
||||||
public string NameCurriculum { get; private set; } = string.Empty;
|
|
||||||
public int QuantityLectures { get; private set; }
|
public string NameCurriculum { get; private set; } = string.Empty;
|
||||||
public int QuantityPractices { get; private set; }
|
|
||||||
public string Semester { get; private set; } = string.Empty;
|
public string Semester { get; private set; } = string.Empty;
|
||||||
public static CurriculumSupplement CreateOperation(int id, int disciplineId, int groupStudentsId, string nameCurriculum,
|
|
||||||
int quantityLectures, int quantityPractices, string semester)
|
public IEnumerable<DisciplineCurriculumSupplement> DisciplineCurriculumSupplements { get; private set; } = [];
|
||||||
|
|
||||||
|
public static CurriculumSupplement CreateOperation(int id, int groupStudentsId, string nameCurriculum,
|
||||||
|
string semester, IEnumerable<DisciplineCurriculumSupplement> disciplineCurriculumSupplements)
|
||||||
{
|
{
|
||||||
return new CurriculumSupplement
|
return new CurriculumSupplement
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
DisciplineId = disciplineId,
|
|
||||||
GroupStudentsId = groupStudentsId,
|
GroupStudentsId = groupStudentsId,
|
||||||
NameCurriculum = nameCurriculum ?? string.Empty,
|
NameCurriculum = nameCurriculum ?? string.Empty,
|
||||||
QuantityLectures = quantityLectures,
|
Semester = semester ?? string.Empty,
|
||||||
QuantityPractices = quantityPractices,
|
DisciplineCurriculumSupplements = disciplineCurriculumSupplements
|
||||||
Semester = semester ?? string.Empty
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,9 @@
|
|||||||
public class Discipline
|
public class Discipline
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
public string NameDiscipline { get; private set; } = string.Empty;
|
public string NameDiscipline { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public static Discipline CreateEntity(int id, string nameDiscipline)
|
public static Discipline CreateEntity(int id, string nameDiscipline)
|
||||||
{
|
{
|
||||||
return new Discipline
|
return new Discipline
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
namespace ProjectSchedule.Entities;
|
||||||
|
|
||||||
|
public class DisciplineCurriculumSupplement
|
||||||
|
{
|
||||||
|
public int Id { get; private set; }
|
||||||
|
|
||||||
|
public int DisciplineId { get; private set; }
|
||||||
|
|
||||||
|
public int QuantityLectures { get; private set; }
|
||||||
|
|
||||||
|
public int QuantityPractices { get; private set; }
|
||||||
|
|
||||||
|
public static DisciplineCurriculumSupplement CreateElement(int id, int disciplineId, int quantityLectures, int quantityPractices)
|
||||||
|
{
|
||||||
|
return new DisciplineCurriculumSupplement
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
DisciplineId = disciplineId,
|
||||||
|
QuantityLectures = quantityLectures,
|
||||||
|
QuantityPractices = quantityPractices
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -3,9 +3,13 @@
|
|||||||
public class Educator
|
public class Educator
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
public string Surname { get; private set; } = string.Empty;
|
public string Surname { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public string Name { get; private set; } = string.Empty;
|
public string Name { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public string Patronymic { get; private set; } = string.Empty;
|
public string Patronymic { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public static Educator CreateEntity(int id, string surname, string name, string patronymic)
|
public static Educator CreateEntity(int id, string surname, string name, string patronymic)
|
||||||
{
|
{
|
||||||
return new Educator
|
return new Educator
|
||||||
|
@ -3,9 +3,13 @@
|
|||||||
public class GroupStudents
|
public class GroupStudents
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
public string AbbreviationGroup { get; private set; } = string.Empty;
|
public string AbbreviationGroup { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public string GroupNumber { get; private set; } = string.Empty;
|
public string GroupNumber { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public int QuantityStudents { get; private set; }
|
public int QuantityStudents { get; private set; }
|
||||||
|
|
||||||
public static GroupStudents CreateEntity(int id, string abbreviationGroup, string groupNumber, int quantityStudents)
|
public static GroupStudents CreateEntity(int id, string abbreviationGroup, string groupNumber, int quantityStudents)
|
||||||
{
|
{
|
||||||
return new GroupStudents
|
return new GroupStudents
|
||||||
|
@ -92,4 +92,4 @@ namespace ProjectSchedule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -28,55 +28,36 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
comboBoxDiscipline = new ComboBox();
|
|
||||||
comboBoxGroupStudents = new ComboBox();
|
comboBoxGroupStudents = new ComboBox();
|
||||||
labelDiscipline = new Label();
|
|
||||||
labelGroupStudents = new Label();
|
labelGroupStudents = new Label();
|
||||||
labelNameCurriculum = new Label();
|
labelNameCurriculum = new Label();
|
||||||
labelQuantityLectures = new Label();
|
|
||||||
labelQuantityPractices = new Label();
|
|
||||||
labelSemester = new Label();
|
labelSemester = new Label();
|
||||||
textBoxNameCurriculum = new TextBox();
|
textBoxNameCurriculum = new TextBox();
|
||||||
numericUpDownQuantityLectures = new NumericUpDown();
|
|
||||||
numericUpDownQuantityPractices = new NumericUpDown();
|
|
||||||
buttonSave = new Button();
|
buttonSave = new Button();
|
||||||
buttonCancel = new Button();
|
buttonCancel = new Button();
|
||||||
textBoxSemester = new TextBox();
|
textBoxSemester = new TextBox();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDownQuantityLectures).BeginInit();
|
groupBoxDisciplines = new GroupBox();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDownQuantityPractices).BeginInit();
|
dataGridViewDisciplines = new DataGridView();
|
||||||
|
ColumnDiscipline = new DataGridViewComboBoxColumn();
|
||||||
|
ColumnQuantityLectures = new DataGridViewTextBoxColumn();
|
||||||
|
ColumnQuantityPractices = new DataGridViewTextBoxColumn();
|
||||||
|
groupBoxDisciplines.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewDisciplines).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// comboBoxDiscipline
|
|
||||||
//
|
|
||||||
comboBoxDiscipline.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
||||||
comboBoxDiscipline.FormattingEnabled = true;
|
|
||||||
comboBoxDiscipline.Location = new Point(252, 12);
|
|
||||||
comboBoxDiscipline.Name = "comboBoxDiscipline";
|
|
||||||
comboBoxDiscipline.Size = new Size(218, 28);
|
|
||||||
comboBoxDiscipline.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// comboBoxGroupStudents
|
// comboBoxGroupStudents
|
||||||
//
|
//
|
||||||
comboBoxGroupStudents.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboBoxGroupStudents.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboBoxGroupStudents.FormattingEnabled = true;
|
comboBoxGroupStudents.FormattingEnabled = true;
|
||||||
comboBoxGroupStudents.Location = new Point(252, 68);
|
comboBoxGroupStudents.Location = new Point(252, 6);
|
||||||
comboBoxGroupStudents.Name = "comboBoxGroupStudents";
|
comboBoxGroupStudents.Name = "comboBoxGroupStudents";
|
||||||
comboBoxGroupStudents.Size = new Size(218, 28);
|
comboBoxGroupStudents.Size = new Size(218, 28);
|
||||||
comboBoxGroupStudents.TabIndex = 1;
|
comboBoxGroupStudents.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// labelDiscipline
|
|
||||||
//
|
|
||||||
labelDiscipline.AutoSize = true;
|
|
||||||
labelDiscipline.Location = new Point(12, 15);
|
|
||||||
labelDiscipline.Name = "labelDiscipline";
|
|
||||||
labelDiscipline.Size = new Size(99, 20);
|
|
||||||
labelDiscipline.TabIndex = 2;
|
|
||||||
labelDiscipline.Text = "Дисциплина:";
|
|
||||||
//
|
|
||||||
// labelGroupStudents
|
// labelGroupStudents
|
||||||
//
|
//
|
||||||
labelGroupStudents.AutoSize = true;
|
labelGroupStudents.AutoSize = true;
|
||||||
labelGroupStudents.Location = new Point(12, 71);
|
labelGroupStudents.Location = new Point(12, 9);
|
||||||
labelGroupStudents.Name = "labelGroupStudents";
|
labelGroupStudents.Name = "labelGroupStudents";
|
||||||
labelGroupStudents.Size = new Size(133, 20);
|
labelGroupStudents.Size = new Size(133, 20);
|
||||||
labelGroupStudents.TabIndex = 3;
|
labelGroupStudents.TabIndex = 3;
|
||||||
@ -85,34 +66,16 @@
|
|||||||
// labelNameCurriculum
|
// labelNameCurriculum
|
||||||
//
|
//
|
||||||
labelNameCurriculum.AutoSize = true;
|
labelNameCurriculum.AutoSize = true;
|
||||||
labelNameCurriculum.Location = new Point(12, 130);
|
labelNameCurriculum.Location = new Point(12, 46);
|
||||||
labelNameCurriculum.Name = "labelNameCurriculum";
|
labelNameCurriculum.Name = "labelNameCurriculum";
|
||||||
labelNameCurriculum.Size = new Size(230, 20);
|
labelNameCurriculum.Size = new Size(230, 20);
|
||||||
labelNameCurriculum.TabIndex = 4;
|
labelNameCurriculum.TabIndex = 4;
|
||||||
labelNameCurriculum.Text = "Название учебной программы:";
|
labelNameCurriculum.Text = "Название учебной программы:";
|
||||||
//
|
//
|
||||||
// labelQuantityLectures
|
|
||||||
//
|
|
||||||
labelQuantityLectures.AutoSize = true;
|
|
||||||
labelQuantityLectures.Location = new Point(12, 189);
|
|
||||||
labelQuantityLectures.Name = "labelQuantityLectures";
|
|
||||||
labelQuantityLectures.Size = new Size(147, 20);
|
|
||||||
labelQuantityLectures.TabIndex = 5;
|
|
||||||
labelQuantityLectures.Text = "Количество лекций:";
|
|
||||||
//
|
|
||||||
// labelQuantityPractices
|
|
||||||
//
|
|
||||||
labelQuantityPractices.AutoSize = true;
|
|
||||||
labelQuantityPractices.Location = new Point(12, 236);
|
|
||||||
labelQuantityPractices.Name = "labelQuantityPractices";
|
|
||||||
labelQuantityPractices.Size = new Size(152, 20);
|
|
||||||
labelQuantityPractices.TabIndex = 6;
|
|
||||||
labelQuantityPractices.Text = "Количество практик:";
|
|
||||||
//
|
|
||||||
// labelSemester
|
// labelSemester
|
||||||
//
|
//
|
||||||
labelSemester.AutoSize = true;
|
labelSemester.AutoSize = true;
|
||||||
labelSemester.Location = new Point(12, 278);
|
labelSemester.Location = new Point(12, 83);
|
||||||
labelSemester.Name = "labelSemester";
|
labelSemester.Name = "labelSemester";
|
||||||
labelSemester.Size = new Size(70, 20);
|
labelSemester.Size = new Size(70, 20);
|
||||||
labelSemester.TabIndex = 7;
|
labelSemester.TabIndex = 7;
|
||||||
@ -120,30 +83,15 @@
|
|||||||
//
|
//
|
||||||
// textBoxNameCurriculum
|
// textBoxNameCurriculum
|
||||||
//
|
//
|
||||||
textBoxNameCurriculum.Location = new Point(252, 127);
|
textBoxNameCurriculum.Location = new Point(252, 43);
|
||||||
textBoxNameCurriculum.Name = "textBoxNameCurriculum";
|
textBoxNameCurriculum.Name = "textBoxNameCurriculum";
|
||||||
textBoxNameCurriculum.Size = new Size(218, 27);
|
textBoxNameCurriculum.Size = new Size(218, 27);
|
||||||
textBoxNameCurriculum.TabIndex = 8;
|
textBoxNameCurriculum.TabIndex = 8;
|
||||||
//
|
//
|
||||||
// numericUpDownQuantityLectures
|
|
||||||
//
|
|
||||||
numericUpDownQuantityLectures.Location = new Point(252, 187);
|
|
||||||
numericUpDownQuantityLectures.Maximum = new decimal(new int[] { 40, 0, 0, 0 });
|
|
||||||
numericUpDownQuantityLectures.Name = "numericUpDownQuantityLectures";
|
|
||||||
numericUpDownQuantityLectures.Size = new Size(218, 27);
|
|
||||||
numericUpDownQuantityLectures.TabIndex = 10;
|
|
||||||
//
|
|
||||||
// numericUpDownQuantityPractices
|
|
||||||
//
|
|
||||||
numericUpDownQuantityPractices.Location = new Point(252, 234);
|
|
||||||
numericUpDownQuantityPractices.Maximum = new decimal(new int[] { 40, 0, 0, 0 });
|
|
||||||
numericUpDownQuantityPractices.Name = "numericUpDownQuantityPractices";
|
|
||||||
numericUpDownQuantityPractices.Size = new Size(218, 27);
|
|
||||||
numericUpDownQuantityPractices.TabIndex = 11;
|
|
||||||
//
|
|
||||||
// buttonSave
|
// buttonSave
|
||||||
//
|
//
|
||||||
buttonSave.Location = new Point(12, 312);
|
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
|
buttonSave.Location = new Point(12, 462);
|
||||||
buttonSave.Name = "buttonSave";
|
buttonSave.Name = "buttonSave";
|
||||||
buttonSave.Size = new Size(116, 29);
|
buttonSave.Size = new Size(116, 29);
|
||||||
buttonSave.TabIndex = 12;
|
buttonSave.TabIndex = 12;
|
||||||
@ -153,7 +101,8 @@
|
|||||||
//
|
//
|
||||||
// buttonCancel
|
// buttonCancel
|
||||||
//
|
//
|
||||||
buttonCancel.Location = new Point(354, 312);
|
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
|
buttonCancel.Location = new Point(354, 462);
|
||||||
buttonCancel.Name = "buttonCancel";
|
buttonCancel.Name = "buttonCancel";
|
||||||
buttonCancel.Size = new Size(116, 29);
|
buttonCancel.Size = new Size(116, 29);
|
||||||
buttonCancel.TabIndex = 13;
|
buttonCancel.TabIndex = 13;
|
||||||
@ -163,55 +112,93 @@
|
|||||||
//
|
//
|
||||||
// textBoxSemester
|
// textBoxSemester
|
||||||
//
|
//
|
||||||
textBoxSemester.Location = new Point(252, 275);
|
textBoxSemester.Location = new Point(252, 80);
|
||||||
textBoxSemester.Name = "textBoxSemester";
|
textBoxSemester.Name = "textBoxSemester";
|
||||||
textBoxSemester.Size = new Size(218, 27);
|
textBoxSemester.Size = new Size(218, 27);
|
||||||
textBoxSemester.TabIndex = 15;
|
textBoxSemester.TabIndex = 15;
|
||||||
//
|
//
|
||||||
|
// groupBoxDisciplines
|
||||||
|
//
|
||||||
|
groupBoxDisciplines.Controls.Add(dataGridViewDisciplines);
|
||||||
|
groupBoxDisciplines.Location = new Point(12, 113);
|
||||||
|
groupBoxDisciplines.Name = "groupBoxDisciplines";
|
||||||
|
groupBoxDisciplines.Size = new Size(458, 343);
|
||||||
|
groupBoxDisciplines.TabIndex = 16;
|
||||||
|
groupBoxDisciplines.TabStop = false;
|
||||||
|
groupBoxDisciplines.Text = "Дисциплины";
|
||||||
|
//
|
||||||
|
// dataGridViewDisciplines
|
||||||
|
//
|
||||||
|
dataGridViewDisciplines.AllowUserToResizeColumns = false;
|
||||||
|
dataGridViewDisciplines.AllowUserToResizeRows = false;
|
||||||
|
dataGridViewDisciplines.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dataGridViewDisciplines.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridViewDisciplines.Columns.AddRange(new DataGridViewColumn[] { ColumnDiscipline, ColumnQuantityLectures, ColumnQuantityPractices });
|
||||||
|
dataGridViewDisciplines.Dock = DockStyle.Fill;
|
||||||
|
dataGridViewDisciplines.Location = new Point(3, 23);
|
||||||
|
dataGridViewDisciplines.MultiSelect = false;
|
||||||
|
dataGridViewDisciplines.Name = "dataGridViewDisciplines";
|
||||||
|
dataGridViewDisciplines.RowHeadersVisible = false;
|
||||||
|
dataGridViewDisciplines.RowHeadersWidth = 51;
|
||||||
|
dataGridViewDisciplines.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dataGridViewDisciplines.Size = new Size(452, 317);
|
||||||
|
dataGridViewDisciplines.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// ColumnDiscipline
|
||||||
|
//
|
||||||
|
ColumnDiscipline.HeaderText = "Дисциплина";
|
||||||
|
ColumnDiscipline.MinimumWidth = 6;
|
||||||
|
ColumnDiscipline.Name = "ColumnDiscipline";
|
||||||
|
//
|
||||||
|
// ColumnQuantityLectures
|
||||||
|
//
|
||||||
|
ColumnQuantityLectures.HeaderText = "Количество лекций";
|
||||||
|
ColumnQuantityLectures.MinimumWidth = 6;
|
||||||
|
ColumnQuantityLectures.Name = "ColumnQuantityLectures";
|
||||||
|
//
|
||||||
|
// ColumnQuantityPractices
|
||||||
|
//
|
||||||
|
ColumnQuantityPractices.HeaderText = "Количество практик";
|
||||||
|
ColumnQuantityPractices.MinimumWidth = 6;
|
||||||
|
ColumnQuantityPractices.Name = "ColumnQuantityPractices";
|
||||||
|
//
|
||||||
// FormCurriculumSupplement
|
// FormCurriculumSupplement
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(482, 353);
|
ClientSize = new Size(482, 503);
|
||||||
|
Controls.Add(groupBoxDisciplines);
|
||||||
Controls.Add(textBoxSemester);
|
Controls.Add(textBoxSemester);
|
||||||
Controls.Add(buttonCancel);
|
Controls.Add(buttonCancel);
|
||||||
Controls.Add(buttonSave);
|
Controls.Add(buttonSave);
|
||||||
Controls.Add(numericUpDownQuantityPractices);
|
|
||||||
Controls.Add(numericUpDownQuantityLectures);
|
|
||||||
Controls.Add(textBoxNameCurriculum);
|
Controls.Add(textBoxNameCurriculum);
|
||||||
Controls.Add(labelSemester);
|
Controls.Add(labelSemester);
|
||||||
Controls.Add(labelQuantityPractices);
|
|
||||||
Controls.Add(labelQuantityLectures);
|
|
||||||
Controls.Add(labelNameCurriculum);
|
Controls.Add(labelNameCurriculum);
|
||||||
Controls.Add(labelGroupStudents);
|
Controls.Add(labelGroupStudents);
|
||||||
Controls.Add(labelDiscipline);
|
|
||||||
Controls.Add(comboBoxGroupStudents);
|
Controls.Add(comboBoxGroupStudents);
|
||||||
Controls.Add(comboBoxDiscipline);
|
|
||||||
Name = "FormCurriculumSupplement";
|
Name = "FormCurriculumSupplement";
|
||||||
StartPosition = FormStartPosition.CenterParent;
|
StartPosition = FormStartPosition.CenterParent;
|
||||||
Text = "Дополнение учебного плана";
|
Text = "Дополнение учебного плана";
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDownQuantityLectures).EndInit();
|
groupBoxDisciplines.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDownQuantityPractices).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridViewDisciplines).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private ComboBox comboBoxDiscipline;
|
|
||||||
private ComboBox comboBoxGroupStudents;
|
private ComboBox comboBoxGroupStudents;
|
||||||
private Label labelDiscipline;
|
|
||||||
private Label labelGroupStudents;
|
private Label labelGroupStudents;
|
||||||
private Label labelNameCurriculum;
|
private Label labelNameCurriculum;
|
||||||
private Label labelQuantityLectures;
|
|
||||||
private Label labelQuantityPractices;
|
|
||||||
private Label labelSemester;
|
private Label labelSemester;
|
||||||
private TextBox textBoxNameCurriculum;
|
private TextBox textBoxNameCurriculum;
|
||||||
private NumericUpDown numericUpDownQuantityLectures;
|
|
||||||
private NumericUpDown numericUpDownQuantityPractices;
|
|
||||||
private Button buttonSave;
|
private Button buttonSave;
|
||||||
private Button buttonCancel;
|
private Button buttonCancel;
|
||||||
private NumericUpDown numericUpDown;
|
private NumericUpDown numericUpDown;
|
||||||
private TextBox textBoxSemester;
|
private TextBox textBoxSemester;
|
||||||
|
private GroupBox groupBoxDisciplines;
|
||||||
|
private DataGridView dataGridViewDisciplines;
|
||||||
|
private DataGridViewComboBoxColumn ColumnDiscipline;
|
||||||
|
private DataGridViewTextBoxColumn ColumnQuantityLectures;
|
||||||
|
private DataGridViewTextBoxColumn ColumnQuantityPractices;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -15,28 +15,27 @@ namespace ProjectSchedule.Forms
|
|||||||
_curriculumSupplementRepository = curriculumSupplementRepository ??
|
_curriculumSupplementRepository = curriculumSupplementRepository ??
|
||||||
throw new ArgumentNullException(nameof(curriculumSupplementRepository));
|
throw new ArgumentNullException(nameof(curriculumSupplementRepository));
|
||||||
|
|
||||||
comboBoxDiscipline.DataSource = disciplineRepository.ReadDisciplines();
|
|
||||||
comboBoxDiscipline.DisplayMember = "NameDiscipline";
|
|
||||||
comboBoxDiscipline.ValueMember = "Id";
|
|
||||||
|
|
||||||
comboBoxGroupStudents.DataSource = groupStudentsRepository.ReadGroupsStudents();
|
comboBoxGroupStudents.DataSource = groupStudentsRepository.ReadGroupsStudents();
|
||||||
comboBoxGroupStudents.DisplayMember = "AbbreviationGroup";
|
comboBoxGroupStudents.DisplayMember = "AbbreviationGroup";
|
||||||
comboBoxGroupStudents.ValueMember = "Id";
|
comboBoxGroupStudents.ValueMember = "Id";
|
||||||
|
|
||||||
|
ColumnDiscipline.DataSource = disciplineRepository.ReadDisciplines();
|
||||||
|
ColumnDiscipline.DisplayMember = "NameDiscipline";
|
||||||
|
ColumnDiscipline.ValueMember = "Id";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonSave_Click(object sender, EventArgs e)
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (comboBoxDiscipline.SelectedIndex < 0 || comboBoxGroupStudents.SelectedIndex < 0)
|
if (dataGridViewDisciplines.RowCount < 1 || comboBoxGroupStudents.SelectedIndex < 0)
|
||||||
{
|
{
|
||||||
throw new Exception("Имеются незаполненные поля");
|
throw new Exception("Имеются незаполненные поля");
|
||||||
}
|
}
|
||||||
|
|
||||||
_curriculumSupplementRepository.CreateCurriculumSupplement(CurriculumSupplement.CreateOperation(0,
|
_curriculumSupplementRepository.CreateCurriculumSupplement(CurriculumSupplement.CreateOperation(0,
|
||||||
(int)comboBoxDiscipline.SelectedValue!, (int)comboBoxGroupStudents.SelectedValue!,
|
(int)comboBoxGroupStudents.SelectedValue!, textBoxNameCurriculum.Text, textBoxSemester.Text,
|
||||||
textBoxNameCurriculum.Text, Convert.ToInt32(numericUpDownQuantityLectures.Value),
|
CreateListDisciplineCurriculumSupplementsFromDataGrid()));
|
||||||
Convert.ToInt32(numericUpDownQuantityPractices.Value), textBoxSemester.Text));
|
|
||||||
|
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
@ -47,5 +46,24 @@ namespace ProjectSchedule.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||||
}
|
|
||||||
|
private List<DisciplineCurriculumSupplement> CreateListDisciplineCurriculumSupplementsFromDataGrid()
|
||||||
|
{
|
||||||
|
var list = new List<DisciplineCurriculumSupplement>();
|
||||||
|
foreach (DataGridViewRow row in dataGridViewDisciplines.Rows)
|
||||||
|
{
|
||||||
|
if (row.Cells["ColumnDiscipline"].Value == null || row.Cells["ColumnQuantityLectures"].Value == null ||
|
||||||
|
row.Cells["ColumnQuantityPractices"].Value == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
list.Add(DisciplineCurriculumSupplement.CreateElement(0, Convert.ToInt32(row.Cells["ColumnDiscipline"].Value),
|
||||||
|
Convert.ToInt32(row.Cells["ColumnQuantityLectures"].Value),
|
||||||
|
Convert.ToInt32(row.Cells["ColumnQuantityPractices"].Value)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -117,4 +117,13 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="ColumnDiscipline.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ColumnQuantityLectures.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ColumnQuantityPractices.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
@ -6,6 +6,8 @@ public interface ICompilingScheduleRepository
|
|||||||
{
|
{
|
||||||
IEnumerable<CompilingSchedule> ReadCompilingSchedules(int? educatorId = null, int? disciplineId = null,
|
IEnumerable<CompilingSchedule> ReadCompilingSchedules(int? educatorId = null, int? disciplineId = null,
|
||||||
int? groupStudentsId = null, int? audienceId = null);
|
int? groupStudentsId = null, int? audienceId = null);
|
||||||
|
|
||||||
void CreateCompilingSchedule(CompilingSchedule compilingSchedule);
|
void CreateCompilingSchedule(CompilingSchedule compilingSchedule);
|
||||||
|
|
||||||
void DeleteCompilingSchedule(int id);
|
void DeleteCompilingSchedule(int id);
|
||||||
}
|
}
|
@ -5,6 +5,8 @@ namespace ProjectSchedule.Repositories;
|
|||||||
public interface ICurriculumSupplementRepository
|
public interface ICurriculumSupplementRepository
|
||||||
{
|
{
|
||||||
IEnumerable<CurriculumSupplement> ReadCurriculumSupplements(int? disciplineId = null, int? groupStudentsId = null);
|
IEnumerable<CurriculumSupplement> ReadCurriculumSupplements(int? disciplineId = null, int? groupStudentsId = null);
|
||||||
|
|
||||||
void CreateCurriculumSupplement(CurriculumSupplement curriculumSupplement);
|
void CreateCurriculumSupplement(CurriculumSupplement curriculumSupplement);
|
||||||
|
|
||||||
void DeleteCurriculumSupplement(int id);
|
void DeleteCurriculumSupplement(int id);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user