From fe7fb59458a7b16468eb1a1c06ad716e4faad24a Mon Sep 17 00:00:00 2001 From: DeWolFix <96820238+DeWolFix@users.noreply.github.com> Date: Mon, 30 Nov 2026 05:25:42 +0300 Subject: [PATCH] Update --- WinTest/Data/DataBaseConnection.cs | 10 +- WinTest/Data/Entities/Course.cs | 13 ++ WinTest/Data/Entities/Learner.cs | 12 ++ WinTest/Data/Entities/LearnerCourse.cs | 16 +++ ...Form1.Designer.cs => MainForm.Designer.cs} | 13 +- WinTest/{Form1.cs => MainForm.cs} | 4 +- WinTest/MainForm.resx | 120 ++++++++++++++++++ WinTest/Program.cs | 2 +- WinTest/Repositories/LearnerRepository.cs | 9 ++ WinTest/WinTest.csproj | 13 +- 10 files changed, 198 insertions(+), 14 deletions(-) create mode 100644 WinTest/Data/Entities/Course.cs create mode 100644 WinTest/Data/Entities/Learner.cs create mode 100644 WinTest/Data/Entities/LearnerCourse.cs rename WinTest/{Form1.Designer.cs => MainForm.Designer.cs} (80%) rename WinTest/{Form1.cs => MainForm.cs} (80%) create mode 100644 WinTest/MainForm.resx create mode 100644 WinTest/Repositories/LearnerRepository.cs diff --git a/WinTest/Data/DataBaseConnection.cs b/WinTest/Data/DataBaseConnection.cs index 2e1cf68..23066f8 100644 --- a/WinTest/Data/DataBaseConnection.cs +++ b/WinTest/Data/DataBaseConnection.cs @@ -1,12 +1,9 @@ -using System; +using Microsoft.Data.SqlClient; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using Microsoft.Data.SqlClient; -using Microsoft.IdentityModel.Tokens; using WinTest.Properties; - namespace WinTest.ADO { public static class DataBaseConnection @@ -18,5 +15,8 @@ namespace WinTest.ADO { return Connect; } + + + //void Add(string fullname, DateTime date) } } diff --git a/WinTest/Data/Entities/Course.cs b/WinTest/Data/Entities/Course.cs new file mode 100644 index 0000000..5201215 --- /dev/null +++ b/WinTest/Data/Entities/Course.cs @@ -0,0 +1,13 @@ +using System; + +namespace WinTest.Data.Entities +{ + public class Course + { + public int Id; + public string Name; + public decimal Price; + public int Hour; + public DateTime Date; + } +} \ No newline at end of file diff --git a/WinTest/Data/Entities/Learner.cs b/WinTest/Data/Entities/Learner.cs new file mode 100644 index 0000000..4d880b8 --- /dev/null +++ b/WinTest/Data/Entities/Learner.cs @@ -0,0 +1,12 @@ +using System; +namespace WinTest.Data.Entities +{ + public class Learner + { + public int Id; + public string Name; + public string Surname; + public DateTime DateOfBirth; + public string Phone; + } +} \ No newline at end of file diff --git a/WinTest/Data/Entities/LearnerCourse.cs b/WinTest/Data/Entities/LearnerCourse.cs new file mode 100644 index 0000000..7929269 --- /dev/null +++ b/WinTest/Data/Entities/LearnerCourse.cs @@ -0,0 +1,16 @@ +using System; +namespace WinTest.Data.Entities +{ + public class LearnerCourse + { + public int Id; + public int LearnerId; + public int CourseId; + public DateTime Date; + } + + public class LearnerCourseFull : LearnerCourse + { + + } +} \ No newline at end of file diff --git a/WinTest/Form1.Designer.cs b/WinTest/MainForm.Designer.cs similarity index 80% rename from WinTest/Form1.Designer.cs rename to WinTest/MainForm.Designer.cs index c859498..833f59b 100644 --- a/WinTest/Form1.Designer.cs +++ b/WinTest/MainForm.Designer.cs @@ -1,6 +1,6 @@ namespace WinTest { - partial class Form1 + partial class MainForm { /// /// Обязательная переменная конструктора. @@ -28,10 +28,17 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(1146, 610); + this.Name = "MainForm"; this.Text = "Form1"; + this.ResumeLayout(false); + } #endregion diff --git a/WinTest/Form1.cs b/WinTest/MainForm.cs similarity index 80% rename from WinTest/Form1.cs rename to WinTest/MainForm.cs index 834b6af..eb105d7 100644 --- a/WinTest/Form1.cs +++ b/WinTest/MainForm.cs @@ -9,9 +9,9 @@ using System.Windows.Forms; namespace WinTest { - public partial class Form1 : Form + public partial class MainForm : Form { - public Form1() + public MainForm() { InitializeComponent(); } diff --git a/WinTest/MainForm.resx b/WinTest/MainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/WinTest/MainForm.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/WinTest/Program.cs b/WinTest/Program.cs index e7f36e5..2b6e86c 100644 --- a/WinTest/Program.cs +++ b/WinTest/Program.cs @@ -15,7 +15,7 @@ namespace WinTest { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new MainForm()); } } } diff --git a/WinTest/Repositories/LearnerRepository.cs b/WinTest/Repositories/LearnerRepository.cs new file mode 100644 index 0000000..65063c3 --- /dev/null +++ b/WinTest/Repositories/LearnerRepository.cs @@ -0,0 +1,9 @@ +namespace WinTest.Repositories +{ + internal class LearnerRepository + { + //DB -> SQML Management Studio + //query (select, insert, delete, update) + //Course, Learner, + } +} diff --git a/WinTest/WinTest.csproj b/WinTest/WinTest.csproj index 3d9e2c9..d6497e9 100644 --- a/WinTest/WinTest.csproj +++ b/WinTest/WinTest.csproj @@ -158,14 +158,21 @@ - + + + + Form - - Form1.cs + + MainForm.cs + + + MainForm.cs + ResXFileCodeGenerator Resources.Designer.cs