diff --git a/ProjectHotel/ProjectHotel/Entities/Athlete.cs b/ProjectHotel/ProjectHotel/Entities/Athlete.cs
index c4607a4..080a91d 100644
--- a/ProjectHotel/ProjectHotel/Entities/Athlete.cs
+++ b/ProjectHotel/ProjectHotel/Entities/Athlete.cs
@@ -1,4 +1,4 @@
-using ProjectHotel.Entities.Enums;
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -13,8 +13,7 @@ public class Athlete
public string FirstName { get; private set; } = string.Empty;
public string LastName { get; private set; } = string.Empty;
public string FatherName { get; private set; } = string.Empty;
- public AthleteClass Class { get; set; }
- public static Athlete CreateEntity(int id, string first, string last, string father, AthleteClass athleteclass)
+ public static Athlete CreateEntity(int id, string first, string last, string father)
{
return new Athlete
{
@@ -22,7 +21,6 @@ public class Athlete
FirstName = first ?? string.Empty,
LastName = last ?? string.Empty,
FatherName = father ?? string.Empty,
- Class = athleteclass
};
}
diff --git a/ProjectHotel/ProjectHotel/Entities/AthletePlacingAthlete.cs b/ProjectHotel/ProjectHotel/Entities/AthletePlacingAthlete.cs
new file mode 100644
index 0000000..43e3ab0
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Entities/AthletePlacingAthlete.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectHotel.Entities;
+
+public class AthletePlacingAthlete
+{
+ public int Id { get; set; }
+ public int AthleteId { get; private set; }
+ public int PlacingId { get; private set; }
+ public static AthletePlacingAthlete CreateElement(int id, int athleteId, int placingId)
+ {
+ return new AthletePlacingAthlete
+ {
+ Id = id,
+ AthleteId = athleteId,
+ PlacingId = placingId
+ };
+ }
+
+}
diff --git a/ProjectHotel/ProjectHotel/Entities/AthleteSport.cs b/ProjectHotel/ProjectHotel/Entities/AthleteSport.cs
deleted file mode 100644
index ab500bd..0000000
--- a/ProjectHotel/ProjectHotel/Entities/AthleteSport.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ProjectHotel.Entities;
-
-public class AthleteSport
-{
- public int Id { get; private set; }
- public int SportId { get; private set; }
-
-
-
- public static AthleteSport CreateEntity(int id, int sportId)
- {
- return new AthleteSport
- {
- Id = id,
- SportId = sportId
-
-
- };
- }
-}
diff --git a/ProjectHotel/ProjectHotel/Entities/CleaningRoom.cs b/ProjectHotel/ProjectHotel/Entities/CleaningRoom.cs
new file mode 100644
index 0000000..49a45aa
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Entities/CleaningRoom.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectHotel.Entities;
+
+public class CleaningRoom
+{
+ public int Id { get; set; }
+ public int RoomId { get; set; }
+ public DateTime CleaningDate { get; private set; }
+ public static CleaningRoom CreateOperation(int id, int roomId)
+ {
+ return new CleaningRoom
+ {
+ Id = id,
+ RoomId = roomId,
+ CleaningDate = DateTime.Now
+ };
+ }
+}
diff --git a/ProjectHotel/ProjectHotel/Entities/Enums/AthleteClass.cs b/ProjectHotel/ProjectHotel/Entities/Enums/AthleteClass.cs
deleted file mode 100644
index 556a03e..0000000
--- a/ProjectHotel/ProjectHotel/Entities/Enums/AthleteClass.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ProjectHotel.Entities.Enums;
-
-public enum AthleteClass
-{
- None = 0,
- MSMK = 1,
- MS = 2,
- KMS = 3
-
-}
diff --git a/ProjectHotel/ProjectHotel/Entities/Enums/Sport.cs b/ProjectHotel/ProjectHotel/Entities/Enums/Sport.cs
deleted file mode 100644
index c75799b..0000000
--- a/ProjectHotel/ProjectHotel/Entities/Enums/Sport.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ProjectHotel.Entities.Enums;
-
-public enum Sport
-{
- None = 0,
- Archery = 2,
- Athletics = 4,
- Badminton = 8,
- Basketball = 16,
- Boxing = 32,
- Cycling = 64,
- Fencing = 128,
- Gymnastics = 256,
- Rowing = 512,
- Swimming = 1024
-}
-
diff --git a/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs b/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs
index 40c0dff..10ec6a0 100644
--- a/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs
+++ b/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs
@@ -9,16 +9,14 @@ namespace ProjectHotel.Entities;
public class PlacingAthlete
{
public int Id { get; private set; }
- public int AthleteId { get; private set;}
public int RoomId { get; private set; }
public DateTime PlacingDate { get; private set; }
public DateTime UnplacingDate { get; private set; }
- public static PlacingAthlete CreateOpeartion(int id, int roomId, int athleteId, DateTime unplacing)
+ public static PlacingAthlete CreateOpeartion(int id, int roomId, DateTime unplacing)
{
return new PlacingAthlete
{
Id = id,
- AthleteId = athleteId,
RoomId = roomId,
PlacingDate = DateTime.Now,
UnplacingDate = unplacing,
diff --git a/ProjectHotel/ProjectHotel/Forms/FormAthlete.Designer.cs b/ProjectHotel/ProjectHotel/Forms/FormAthlete.Designer.cs
new file mode 100644
index 0000000..5160b7a
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Forms/FormAthlete.Designer.cs
@@ -0,0 +1,114 @@
+namespace ProjectHotel.Forms
+{
+ partial class FormAthlete
+ {
+ ///
+ /// 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()
+ {
+ labelName = new Label();
+ labelSeckondName = new Label();
+ labelFatherName = new Label();
+ textBoxFirstName = new TextBox();
+ textBoxLastName = new TextBox();
+ textBoxFatherName = new TextBox();
+ SuspendLayout();
+ //
+ // labelName
+ //
+ labelName.AutoSize = true;
+ labelName.Location = new Point(12, 15);
+ labelName.Name = "labelName";
+ labelName.Size = new Size(31, 15);
+ labelName.TabIndex = 0;
+ labelName.Text = "Имя";
+ //
+ // labelSeckondName
+ //
+ labelSeckondName.AutoSize = true;
+ labelSeckondName.Location = new Point(12, 59);
+ labelSeckondName.Name = "labelSeckondName";
+ labelSeckondName.Size = new Size(58, 15);
+ labelSeckondName.TabIndex = 1;
+ labelSeckondName.Text = "Фамилия";
+ //
+ // labelFatherName
+ //
+ labelFatherName.AutoSize = true;
+ labelFatherName.Location = new Point(12, 104);
+ labelFatherName.Name = "labelFatherName";
+ labelFatherName.Size = new Size(58, 15);
+ labelFatherName.TabIndex = 2;
+ labelFatherName.Text = "Отчество";
+ //
+ // textBoxFirstName
+ //
+ textBoxFirstName.Location = new Point(99, 12);
+ textBoxFirstName.Name = "textBoxFirstName";
+ textBoxFirstName.Size = new Size(207, 23);
+ textBoxFirstName.TabIndex = 3;
+ //
+ // textBoxLastName
+ //
+ textBoxLastName.Location = new Point(99, 56);
+ textBoxLastName.Name = "textBoxLastName";
+ textBoxLastName.Size = new Size(207, 23);
+ textBoxLastName.TabIndex = 4;
+ //
+ // textBoxFatherName
+ //
+ textBoxFatherName.Location = new Point(99, 101);
+ textBoxFatherName.Name = "textBoxFatherName";
+ textBoxFatherName.Size = new Size(207, 23);
+ textBoxFatherName.TabIndex = 5;
+ //
+ // FormAthlete
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(318, 139);
+ Controls.Add(textBoxFatherName);
+ Controls.Add(textBoxLastName);
+ Controls.Add(textBoxFirstName);
+ Controls.Add(labelFatherName);
+ Controls.Add(labelSeckondName);
+ Controls.Add(labelName);
+ Name = "FormAthlete";
+ StartPosition = FormStartPosition.CenterParent;
+ Text = "Спортсмен";
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private Label labelName;
+ private Label labelSeckondName;
+ private Label labelFatherName;
+ private TextBox textBoxFirstName;
+ private TextBox textBoxLastName;
+ private TextBox textBoxFatherName;
+ }
+}
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Forms/FormAthlete.cs b/ProjectHotel/ProjectHotel/Forms/FormAthlete.cs
new file mode 100644
index 0000000..d50b52e
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Forms/FormAthlete.cs
@@ -0,0 +1,79 @@
+using ProjectHotel.Repositories;
+using ProjectHotel.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 ProjectHotel.Forms;
+
+public partial class FormAthlete : Form
+{
+ private readonly IAthleteRepository _athleteRepository;
+ private int? _athleteId;
+ public int Id
+ {
+ set
+ {
+ try
+ {
+ var athlete = _athleteRepository.ReadAthleteById(value);
+ if (athlete == null)
+ {
+ throw new
+ InvalidDataException(nameof(athlete));
+ }
+ textBoxFirstName.Text = athlete.FirstName;
+ textBoxLastName.Text = athlete.LastName;
+ textBoxFatherName.Text = athlete.FatherName;
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+ }
+ }
+ public FormAthlete(IAthleteRepository athleteRepository)
+ {
+ InitializeComponent();
+ _athleteRepository = athleteRepository ??
+ throw new
+ ArgumentNullException(nameof(athleteRepository));
+ }
+ private void ButtonSave_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(textBoxFirstName.Text) || string.IsNullOrWhiteSpace(textBoxLastName.Text) || string.IsNullOrWhiteSpace(textBoxFatherName.Text))
+ {
+ throw new Exception("Имеются незаполненные поля");
+ }
+ if (_athleteId.HasValue)
+ {
+ _athleteRepository.UpdateAthlete(CreateEmployee(_athleteId.Value));
+ }
+ else
+ {
+ _athleteRepository.CreateAthlete(CreateAthlete(0));
+ }
+ Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Ошибка при сохранении",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ private void ButtonCancel_Click(object sender, EventArgs e) =>
+ Close();
+ private Employee CreateEmployee(int id) =>
+ Employee.CreateEntity(id, textBoxFirstName.Text,
+ textBoxLastName.Text,
+ (EmployeePost)comboBoxPost.SelectedItem!);
+}
diff --git a/ProjectHotel/ProjectHotel/Forms/FormAthlete.resx b/ProjectHotel/ProjectHotel/Forms/FormAthlete.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Forms/FormAthlete.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/ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.resx b/ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.resx
index a0623c8..a39c409 100644
--- a/ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.resx
+++ b/ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.resx
@@ -120,4 +120,7 @@
17, 17
+
+ 25
+
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Forms/FormHotels.Designer.cs b/ProjectHotel/ProjectHotel/Forms/FormHotels.Designer.cs
index dbfce9a..8960bec 100644
--- a/ProjectHotel/ProjectHotel/Forms/FormHotels.Designer.cs
+++ b/ProjectHotel/ProjectHotel/Forms/FormHotels.Designer.cs
@@ -1,6 +1,6 @@
namespace ProjectHotel.Forms
{
- partial class FormHotels
+ partial class Отели
{
///
/// Required designer variable.
@@ -29,10 +29,12 @@
private void InitializeComponent()
{
panel1 = new Panel();
- buttonAdd = new Button();
- buttonChange = new Button();
buttonDelete = new Button();
+ buttonChange = new Button();
+ buttonAdd = new Button();
+ dataGridViewData = new DataGridView();
panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
SuspendLayout();
//
// panel1
@@ -46,17 +48,19 @@
panel1.Size = new Size(168, 450);
panel1.TabIndex = 0;
//
- // buttonAdd
+ // buttonDelete
//
- buttonAdd.BackgroundImageLayout = ImageLayout.Zoom;
- buttonAdd.Location = new Point(24, 12);
- buttonAdd.Name = "buttonAdd";
- buttonAdd.Size = new Size(130, 130);
- buttonAdd.TabIndex = 0;
- buttonAdd.UseVisualStyleBackColor = true;
+ buttonDelete.BackgroundImage = Properties.Resources.ImageDelete;
+ buttonDelete.BackgroundImageLayout = ImageLayout.Zoom;
+ buttonDelete.Location = new Point(24, 308);
+ buttonDelete.Name = "buttonDelete";
+ buttonDelete.Size = new Size(130, 130);
+ buttonDelete.TabIndex = 2;
+ buttonDelete.UseVisualStyleBackColor = true;
//
// buttonChange
//
+ buttonChange.BackgroundImage = Properties.Resources.ImageChange;
buttonChange.BackgroundImageLayout = ImageLayout.Zoom;
buttonChange.Location = new Point(24, 158);
buttonChange.Name = "buttonChange";
@@ -64,23 +68,46 @@
buttonChange.TabIndex = 1;
buttonChange.UseVisualStyleBackColor = true;
//
- // buttonDelete
+ // buttonAdd
//
- buttonDelete.Location = new Point(24, 308);
- buttonDelete.Name = "buttonDelete";
- buttonDelete.Size = new Size(130, 130);
- buttonDelete.TabIndex = 2;
- buttonDelete.UseVisualStyleBackColor = true;
+ buttonAdd.BackgroundImage = Properties.Resources.AddImage;
+ buttonAdd.BackgroundImageLayout = ImageLayout.Zoom;
+ buttonAdd.Location = new Point(24, 12);
+ buttonAdd.Name = "buttonAdd";
+ buttonAdd.Size = new Size(130, 130);
+ buttonAdd.TabIndex = 0;
+ buttonAdd.UseVisualStyleBackColor = true;
//
- // FormHotels
+ // 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(632, 450);
+ dataGridViewData.TabIndex = 1;
+ //
+ // Отели
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
+ Controls.Add(dataGridViewData);
Controls.Add(panel1);
- Name = "FormHotels";
+ Name = "Отели";
+ StartPosition = FormStartPosition.CenterParent;
Text = "FormHotels";
panel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
ResumeLayout(false);
}
@@ -90,5 +117,6 @@
private Button buttonAdd;
private Button buttonDelete;
private Button buttonChange;
+ private DataGridView dataGridViewData;
}
}
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Forms/FormHotels.cs b/ProjectHotel/ProjectHotel/Forms/FormHotels.cs
index c84373a..6157dde 100644
--- a/ProjectHotel/ProjectHotel/Forms/FormHotels.cs
+++ b/ProjectHotel/ProjectHotel/Forms/FormHotels.cs
@@ -1,4 +1,6 @@
-using System;
+using ProjectHotel.Repositories;
+using ProjectHotel.Repositories.Implementations;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -7,22 +9,22 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using Unity;
namespace ProjectHotel.Forms;
-public partial class FormHotels : Form
+public partial class Отели : Form
{
private readonly IUnityContainer _container;
- private readonly IAnimalRepository _animalRepository;
- public FormAnimals(IUnityContainer container, IAnimalRepository
- aimalRepository)
+ private readonly IHotelRepository _hotelRepository;
+
+ public Отели(IUnityContainer container, IHotelRepository hotelRepository)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
- _animalRepository = aimalRepository ??
- throw new
- ArgumentNullException(nameof(aimalRepository));
+ _hotelRepository = hotelRepository ??
+ throw new ArgumentNullException(nameof(hotelRepository));
}
private void FormAnimals_Load(object sender, EventArgs e)
{
@@ -40,7 +42,7 @@ public partial class FormHotels : Form
{
try
{
- _container.Resolve().ShowDialog();
+ _container.Resolve().ShowDialog();
LoadList();
}
catch (Exception ex)
@@ -57,8 +59,7 @@ public partial class FormHotels : Form
}
try
{
- 20
- var form = _container.Resolve();
+ var form = _container.Resolve();
form.Id = findId;
form.ShowDialog();
LoadList();
@@ -69,7 +70,7 @@ public partial class FormHotels : Form
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
- private void ButtonDel_Click(object sender, EventArgs e)
+ private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
@@ -81,7 +82,7 @@ public partial class FormHotels : Form
}
try
{
- _animalRepository.DeleteAnimal(findId);
+ _hotelRepository.DeleteHotel(findId);
LoadList();
}
catch (Exception ex)
@@ -90,7 +91,7 @@ public partial class FormHotels : Form
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
- private void LoadList() => dataGridViewData.DataSource = _animalRepository.ReadAnimals();
+ private void LoadList() => dataGridViewData.DataSource = _hotelRepository.ReadHotels();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
diff --git a/ProjectHotel/ProjectHotel/Forms/FormRoom.Designer.cs b/ProjectHotel/ProjectHotel/Forms/FormRoom.Designer.cs
new file mode 100644
index 0000000..bf304be
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Forms/FormRoom.Designer.cs
@@ -0,0 +1,55 @@
+namespace ProjectHotel.Forms
+{
+ partial class Комната
+ {
+ ///
+ /// 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()
+ {
+ components = new System.ComponentModel.Container();
+ hotelBindingSource = new BindingSource(components);
+ ((System.ComponentModel.ISupportInitialize)hotelBindingSource).BeginInit();
+ SuspendLayout();
+ //
+ // hotelBindingSource
+ //
+ hotelBindingSource.DataSource = typeof(Entities.Hotel);
+ //
+ // Комната
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(584, 389);
+ Name = "Комната";
+ StartPosition = FormStartPosition.CenterParent;
+ Text = "FormRoom";
+ ((System.ComponentModel.ISupportInitialize)hotelBindingSource).EndInit();
+ ResumeLayout(false);
+ }
+
+ #endregion
+ private BindingSource hotelBindingSource;
+ }
+}
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Forms/FormRoom.cs b/ProjectHotel/ProjectHotel/Forms/FormRoom.cs
new file mode 100644
index 0000000..e4a6c7a
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Forms/FormRoom.cs
@@ -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 ProjectHotel.Forms
+{
+ public partial class Комната : Form
+ {
+ public Комната()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/ProjectHotel/ProjectHotel/Forms/FormRoom.resx b/ProjectHotel/ProjectHotel/Forms/FormRoom.resx
new file mode 100644
index 0000000..bfd5f48
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Forms/FormRoom.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/ProjectHotel/ProjectHotel/ProjectHotel.csproj b/ProjectHotel/ProjectHotel/ProjectHotel.csproj
index af03d74..24b1910 100644
--- a/ProjectHotel/ProjectHotel/ProjectHotel.csproj
+++ b/ProjectHotel/ProjectHotel/ProjectHotel.csproj
@@ -23,4 +23,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Properties/DataSources/ProjectHotel.Entities.Hotel.datasource b/ProjectHotel/ProjectHotel/Properties/DataSources/ProjectHotel.Entities.Hotel.datasource
new file mode 100644
index 0000000..ba6d7c4
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Properties/DataSources/ProjectHotel.Entities.Hotel.datasource
@@ -0,0 +1,10 @@
+
+
+
+ ProjectHotel.Entities.Hotel, ProjectHotel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Properties/Resources.Designer.cs b/ProjectHotel/ProjectHotel/Properties/Resources.Designer.cs
index 9476918..d007245 100644
--- a/ProjectHotel/ProjectHotel/Properties/Resources.Designer.cs
+++ b/ProjectHotel/ProjectHotel/Properties/Resources.Designer.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
+// Этот код создан программой.
+// Исполняемая версия:4.0.30319.42000
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+// повторной генерации кода.
//
//------------------------------------------------------------------------------
@@ -13,12 +13,12 @@ namespace ProjectHotel.Properties {
///
- /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
+ // Этот класс создан автоматически классом 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()]
@@ -33,7 +33,7 @@ namespace ProjectHotel.Properties {
}
///
- /// Returns the cached ResourceManager instance used by this class.
+ /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ namespace ProjectHotel.Properties {
}
///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
+ /// Перезаписывает свойство CurrentUICulture текущего потока для всех
+ /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
@@ -61,7 +61,7 @@ namespace ProjectHotel.Properties {
}
///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
///
internal static System.Drawing.Bitmap AddImage {
get {
@@ -71,7 +71,7 @@ namespace ProjectHotel.Properties {
}
///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
///
internal static System.Drawing.Bitmap hotel {
get {
@@ -79,5 +79,25 @@ namespace ProjectHotel.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap ImageChange {
+ get {
+ object obj = ResourceManager.GetObject("ImageChange", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap ImageDelete {
+ get {
+ object obj = ResourceManager.GetObject("ImageDelete", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
}
}
diff --git a/ProjectHotel/ProjectHotel/Properties/Resources.resx b/ProjectHotel/ProjectHotel/Properties/Resources.resx
index efd84b8..ecd43f5 100644
--- a/ProjectHotel/ProjectHotel/Properties/Resources.resx
+++ b/ProjectHotel/ProjectHotel/Properties/Resources.resx
@@ -119,7 +119,7 @@
- ..\Resources\ImageChange.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+ ..\Resources\ImageChange1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\AddImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -127,7 +127,7 @@
..\Resources\hotel.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\ImageChange1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\ImageDelete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Repositories/IAthletePlacingAthleteRepository.cs b/ProjectHotel/ProjectHotel/Repositories/IAthletePlacingAthleteRepository.cs
new file mode 100644
index 0000000..00a82fb
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Repositories/IAthletePlacingAthleteRepository.cs
@@ -0,0 +1,15 @@
+using ProjectHotel.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectHotel.Repositories;
+
+internal interface IAthletePlacingAthleteRepository
+{
+ IEnumerable ReadAthletePlacingAthlete(int? id = null, int? athleteId = null, int? roomId = null);
+ void CreateAthletePlacingAthlete(AthletePlacingAthlete athletePlacingAthlete);
+ AthletePlacingAthlete ReadAthleteById(int id);
+}
diff --git a/ProjectHotel/ProjectHotel/Repositories/IAthleteSportReposetory.cs b/ProjectHotel/ProjectHotel/Repositories/IAthleteSportReposetory.cs
deleted file mode 100644
index 3c6ded8..0000000
--- a/ProjectHotel/ProjectHotel/Repositories/IAthleteSportReposetory.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using ProjectHotel.Entities;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ProjectHotel.Repositories;
-
-public interface IAthleteSportReposetory
-{
- IEnumerable ReadAthleteSport();
- AthleteSport ReadAthleteSportById(int id);
- void CreateAthleteSport(AthleteSport athleteSport);
- void DeleteAthleteSport(int id);
-}
diff --git a/ProjectHotel/ProjectHotel/Repositories/ICleaningRoomRepository.cs b/ProjectHotel/ProjectHotel/Repositories/ICleaningRoomRepository.cs
new file mode 100644
index 0000000..63db9d7
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Repositories/ICleaningRoomRepository.cs
@@ -0,0 +1,16 @@
+using ProjectHotel.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectHotel.Repositories;
+
+internal interface ICleaningRoomRepository
+{
+ IEnumerable ReadCleaningRoom(int? id = null, int? roomId = null, int? athleteId = null);
+ void CreateCleaningRoom(CleaningRoom cleaningRoom);
+ AthletePlacingAthlete ReadAthleteById(int id);
+}
+
\ No newline at end of file
diff --git a/ProjectHotel/ProjectHotel/Repositories/IPlacingAthleteRepository.cs b/ProjectHotel/ProjectHotel/Repositories/IPlacingAthleteRepository.cs
index 89bf0df..90d930d 100644
--- a/ProjectHotel/ProjectHotel/Repositories/IPlacingAthleteRepository.cs
+++ b/ProjectHotel/ProjectHotel/Repositories/IPlacingAthleteRepository.cs
@@ -9,8 +9,7 @@ namespace ProjectHotel.Repositories;
public interface IPlacingAthleteRepository
{
- IEnumerable ReadPlacingAthlete(DateTime? dateForm =
- null, DateTime? dateTo = null,
- int? athleteId = null, int? roomId = null);
+ IEnumerable ReadPlacingAthlete(DateTime? placing = null, DateTime? unplacing = null, int? roomId = null);
void CreatePlacingAthlete(PlacingAthlete placingAthlete);
+ PlacingAthlete ReadPlacingAthleteById(int id);
}
diff --git a/ProjectHotel/ProjectHotel/Repositories/Implementations/AthletePlacingAthleteRepository.cs b/ProjectHotel/ProjectHotel/Repositories/Implementations/AthletePlacingAthleteRepository.cs
new file mode 100644
index 0000000..cf4cc95
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Repositories/Implementations/AthletePlacingAthleteRepository.cs
@@ -0,0 +1,24 @@
+using ProjectHotel.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectHotel.Repositories.Implementations;
+
+internal class AthletePlacingAthleteRepository
+{
+ public IEnumerable ReadAthletePlacingAthlete(int? id = null, int? athleteId = null, int? roomId = null)
+ {
+ return [];
+ }
+ public void CreateAthletePlacingAthlete(AthletePlacingAthleteRepository athletePlacingAthlete)
+ {
+ }
+
+ public AthletePlacingAthlete ReadAthleteById(int id)
+ {
+ return AthletePlacingAthlete.CreateElement(0, 0, 0);
+ }
+}
diff --git a/ProjectHotel/ProjectHotel/Repositories/Implementations/AthleteRepository.cs b/ProjectHotel/ProjectHotel/Repositories/Implementations/AthleteRepository.cs
index c7de4a3..02b7f70 100644
--- a/ProjectHotel/ProjectHotel/Repositories/Implementations/AthleteRepository.cs
+++ b/ProjectHotel/ProjectHotel/Repositories/Implementations/AthleteRepository.cs
@@ -17,7 +17,7 @@ internal class AthleteRepository : IAthleteRepository
}
public Athlete ReadAthleteById(int id)
{
- return Athlete.CreateEntity(0, string.Empty, string.Empty, string.Empty, 0);
+ return Athlete.CreateEntity(0, string.Empty, string.Empty,string.Empty);
}
public IEnumerable ReadAthletes()
{
diff --git a/ProjectHotel/ProjectHotel/Repositories/Implementations/AthleteSportRepository.cs b/ProjectHotel/ProjectHotel/Repositories/Implementations/AthleteSportRepository.cs
deleted file mode 100644
index aa4066e..0000000
--- a/ProjectHotel/ProjectHotel/Repositories/Implementations/AthleteSportRepository.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using ProjectHotel.Entities;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ProjectHotel.Repositories.Implementations;
-
-internal class AthleteSportRepository : IAthleteSportReposetory
-{
- public IEnumerable ReadAthleteSport()
- {
- return [];
- }
- public AthleteSport ReadAthleteSportById(int id)
- {
- return AthleteSport.CreateEntity(0, 0);
- }
- public void CreateAthleteSport(AthleteSport athleteSport)
- {
-
- }
- public void DeleteAthleteSport(int id)
- {
-
- }
-}
diff --git a/ProjectHotel/ProjectHotel/Repositories/Implementations/CleaningRoomRepository.cs b/ProjectHotel/ProjectHotel/Repositories/Implementations/CleaningRoomRepository.cs
new file mode 100644
index 0000000..f0f4415
--- /dev/null
+++ b/ProjectHotel/ProjectHotel/Repositories/Implementations/CleaningRoomRepository.cs
@@ -0,0 +1,24 @@
+using ProjectHotel.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectHotel.Repositories.Implementations;
+
+internal class CleaningRoomRepository
+{
+ IEnumerable ReadCleaningRoom(int? id = null, int? roomId = null, int? athleteId = null)
+ {
+ return [];
+ }
+ void CreateCleaningRoom(CleaningRoom cleaningRoom)
+ {
+
+ }
+ AthletePlacingAthlete ReadAthleteById(int id)
+ {
+ return AthletePlacingAthlete.CreateElement(0, 0, 0);
+ }
+}
diff --git a/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs b/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs
index ae856ab..60773f0 100644
--- a/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs
+++ b/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs
@@ -9,9 +9,7 @@ namespace ProjectHotel.Repositories.Implementations;
internal class PlacingAthleteRepository : IPlacingAthleteRepository
{
- public IEnumerable ReadPlacingAthlete(DateTime? dateForm =
- null, DateTime? dateTo = null,
- int? athleteId = null, int? roomId = null)
+ public IEnumerable ReadPlacingAthlete(DateTime? plasing = null, DateTime? unplacing = null, int? roomId = null)
{
return [];
}
@@ -19,4 +17,8 @@ internal class PlacingAthleteRepository : IPlacingAthleteRepository
{
}
+ public PlacingAthlete ReadPlacingAthleteById(int id)
+ {
+ return PlacingAthlete.CreateOpeartion(0, 0, DateTime.Now);
+ }
}
diff --git a/ProjectHotel/ProjectHotel/Resources/AddImage.png b/ProjectHotel/ProjectHotel/Resources/AddImage.png
new file mode 100644
index 0000000..87306ed
Binary files /dev/null and b/ProjectHotel/ProjectHotel/Resources/AddImage.png differ
diff --git a/ProjectHotel/ProjectHotel/Resources/ImageChange1.png b/ProjectHotel/ProjectHotel/Resources/ImageChange1.png
new file mode 100644
index 0000000..01a08d0
Binary files /dev/null and b/ProjectHotel/ProjectHotel/Resources/ImageChange1.png differ
diff --git a/ProjectHotel/ProjectHotel/Resources/ImageDelete.png b/ProjectHotel/ProjectHotel/Resources/ImageDelete.png
new file mode 100644
index 0000000..3887666
Binary files /dev/null and b/ProjectHotel/ProjectHotel/Resources/ImageDelete.png differ
diff --git a/lab2.vpp b/lab2.vpp
new file mode 100644
index 0000000..5da342e
Binary files /dev/null and b/lab2.vpp differ