1
This commit is contained in:
parent
8f986c6beb
commit
bcd36cebc6
@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.8.34525.116
|
VisualStudioVersion = 17.8.34525.116
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectHotel", "ProjectHotel\ProjectHotel.csproj", "{A2780283-9040-4F10-8929-96574BD22EAD}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectHotel", "ProjectHotel\ProjectHotel.csproj", "{C81DFC0D-3F51-4F84-AF78-1ADA30A157B1}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -11,15 +11,15 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{A2780283-9040-4F10-8929-96574BD22EAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{C81DFC0D-3F51-4F84-AF78-1ADA30A157B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A2780283-9040-4F10-8929-96574BD22EAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C81DFC0D-3F51-4F84-AF78-1ADA30A157B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A2780283-9040-4F10-8929-96574BD22EAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C81DFC0D-3F51-4F84-AF78-1ADA30A157B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A2780283-9040-4F10-8929-96574BD22EAD}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C81DFC0D-3F51-4F84-AF78-1ADA30A157B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {63AC2E5C-4881-4878-851B-89C4AC958820}
|
SolutionGuid = {20DC1BC0-A8A5-4BA7-B0A2-533382967ACC}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
@ -12,15 +12,18 @@ public class Athlete
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string FirstName { get; private set; } = string.Empty;
|
public string FirstName { get; private set; } = string.Empty;
|
||||||
public string LastName { get; private set; } = string.Empty;
|
public string LastName { get; private set; } = string.Empty;
|
||||||
public KindOfSport KindOfSport { get; private set; }
|
public string FatherName { get; private set; } = string.Empty;
|
||||||
public static Athlete CreateEntity(int id, string first, string last, KindOfSport kindOfSport)
|
public AthleteClass Class { get; set; }
|
||||||
|
public static Athlete CreateEntity(int id, string first, string last, string father, AthleteClass athleteclass)
|
||||||
{
|
{
|
||||||
return new Athlete
|
return new Athlete
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
FirstName = first ?? string.Empty,
|
FirstName = first ?? string.Empty,
|
||||||
LastName = last ?? string.Empty,
|
LastName = last ?? string.Empty,
|
||||||
KindOfSport = kindOfSport
|
FatherName = father ?? string.Empty,
|
||||||
|
Class = athleteclass
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
ProjectHotel/ProjectHotel/Entities/AthleteSport.cs
Normal file
26
ProjectHotel/ProjectHotel/Entities/AthleteSport.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
16
ProjectHotel/ProjectHotel/Entities/Enums/AthleteClass.cs
Normal file
16
ProjectHotel/ProjectHotel/Entities/Enums/AthleteClass.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
}
|
@ -1,24 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectHotel.Entities.Enums
|
|
||||||
{
|
|
||||||
public enum KindOfSport
|
|
||||||
{
|
|
||||||
None = 0,
|
|
||||||
Archery = 1,
|
|
||||||
Athletics = 2,
|
|
||||||
Badminton = 3,
|
|
||||||
Basketball = 4,
|
|
||||||
Boxing = 5,
|
|
||||||
Cycling = 6,
|
|
||||||
Fencing = 7,
|
|
||||||
Gymnastics = 8,
|
|
||||||
Rowing = 9,
|
|
||||||
Swimming = 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
23
ProjectHotel/ProjectHotel/Entities/Enums/Sport.cs
Normal file
23
ProjectHotel/ProjectHotel/Entities/Enums/Sport.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
|
@ -11,32 +11,16 @@ public class Hotel
|
|||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public string HotelName { get; private set; } = string.Empty;
|
public string HotelName { get; private set; } = string.Empty;
|
||||||
public string Adress { get; private set; } = string.Empty;
|
public string Adress { get; private set; } = string.Empty;
|
||||||
public int TotalRooms { get; private set; }
|
|
||||||
public int SingleRooms { get; private set; }
|
|
||||||
public int DoubleRooms { get; private set; }
|
|
||||||
public int TripleRooms { get; private set; }
|
|
||||||
|
|
||||||
|
|
||||||
public int AvailableSingleRooms { get; private set; }
|
public static Hotel CreateEntity(int id, string hotelName, string adress)
|
||||||
public int AvailableDoubleRooms { get; private set; }
|
|
||||||
public int AvailableTripleRooms { get; private set; }
|
|
||||||
|
|
||||||
|
|
||||||
public static Hotel CreateEntity(int id, string hotelName, string adress, int totalRooms, int singleRooms, int doubleRooms, int tripleRooms,
|
|
||||||
int availableSingleRooms, int availableDoubleRooms, int availableTripleRooms)
|
|
||||||
{
|
{
|
||||||
return new Hotel
|
return new Hotel
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
HotelName = hotelName,
|
HotelName = hotelName,
|
||||||
TotalRooms = totalRooms,
|
Adress = adress
|
||||||
Adress = adress,
|
|
||||||
SingleRooms = singleRooms,
|
|
||||||
DoubleRooms = doubleRooms,
|
|
||||||
TripleRooms = tripleRooms,
|
|
||||||
AvailableSingleRooms = availableSingleRooms,
|
|
||||||
AvailableDoubleRooms = availableDoubleRooms,
|
|
||||||
AvailableTripleRooms = tripleRooms
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -11,16 +11,16 @@ public class Rooms
|
|||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public int HotelId { get; private set; }
|
public int HotelId { get; private set; }
|
||||||
public char RoomType { get; private set; }
|
public string Name { get; private set; } = string.Empty;
|
||||||
public bool IsAvaiable { get; private set; }
|
public int Capacity { get; private set; }
|
||||||
public static Rooms CreateEntity(int id, int hotel, char type, bool avalible)
|
public static Rooms CreateEntity(int id, int hotel, string name, int capacity)
|
||||||
{
|
{
|
||||||
return new Rooms
|
return new Rooms
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
HotelId = hotel,
|
HotelId = hotel,
|
||||||
RoomType = type,
|
Name = name,
|
||||||
IsAvaiable = avalible
|
Capacity = capacity
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
39
ProjectHotel/ProjectHotel/Form1.Designer.cs
generated
39
ProjectHotel/ProjectHotel/Form1.Designer.cs
generated
@ -1,39 +0,0 @@
|
|||||||
namespace ProjectHotel
|
|
||||||
{
|
|
||||||
partial class Form1
|
|
||||||
{
|
|
||||||
/// <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()
|
|
||||||
{
|
|
||||||
this.components = new System.ComponentModel.Container();
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
|
||||||
this.Text = "Form1";
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
92
ProjectHotel/ProjectHotel/Forms/FormHotel.Designer.cs
generated
Normal file
92
ProjectHotel/ProjectHotel/Forms/FormHotel.Designer.cs
generated
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
namespace ProjectHotel.Forms
|
||||||
|
{
|
||||||
|
partial class FormHotel
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
label1 = new Label();
|
||||||
|
label2 = new Label();
|
||||||
|
textBoxHotelName = new TextBox();
|
||||||
|
textBoxHotelAdress = new TextBox();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(15, 41);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(122, 15);
|
||||||
|
label1.TabIndex = 0;
|
||||||
|
label1.Text = "Название гостиницы";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
label2.AutoSize = true;
|
||||||
|
label2.Location = new Point(15, 93);
|
||||||
|
label2.Name = "label2";
|
||||||
|
label2.Size = new Size(46, 15);
|
||||||
|
label2.TabIndex = 1;
|
||||||
|
label2.Text = "Адресс";
|
||||||
|
//
|
||||||
|
// textBoxHotelName
|
||||||
|
//
|
||||||
|
textBoxHotelName.Location = new Point(168, 38);
|
||||||
|
textBoxHotelName.Name = "textBoxHotelName";
|
||||||
|
textBoxHotelName.Size = new Size(390, 23);
|
||||||
|
textBoxHotelName.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// textBoxHotelAdress
|
||||||
|
//
|
||||||
|
textBoxHotelAdress.Location = new Point(168, 90);
|
||||||
|
textBoxHotelAdress.Name = "textBoxHotelAdress";
|
||||||
|
textBoxHotelAdress.Size = new Size(387, 23);
|
||||||
|
textBoxHotelAdress.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// FormHotel
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(570, 167);
|
||||||
|
Controls.Add(textBoxHotelAdress);
|
||||||
|
Controls.Add(textBoxHotelName);
|
||||||
|
Controls.Add(label2);
|
||||||
|
Controls.Add(label1);
|
||||||
|
Name = "FormHotel";
|
||||||
|
StartPosition = FormStartPosition.CenterParent;
|
||||||
|
Text = "Гостиница";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Label label1;
|
||||||
|
private Label label2;
|
||||||
|
private TextBox textBoxHotelName;
|
||||||
|
private TextBox textBoxHotelAdress;
|
||||||
|
}
|
||||||
|
}
|
82
ProjectHotel/ProjectHotel/Forms/FormHotel.cs
Normal file
82
ProjectHotel/ProjectHotel/Forms/FormHotel.cs
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
using ProjectHotel.Entities;
|
||||||
|
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 FormHotel : Form
|
||||||
|
{
|
||||||
|
private readonly IHotelRepository _hotelRepository;
|
||||||
|
private int? _hotelId;
|
||||||
|
public int Id
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var hotel =
|
||||||
|
_hotelRepository.ReadHotelById(value);
|
||||||
|
if (hotel == null)
|
||||||
|
{
|
||||||
|
throw new
|
||||||
|
InvalidDataException(nameof(hotel));
|
||||||
|
}
|
||||||
|
textBoxHotelName.Text = hotel.HotelName;
|
||||||
|
textBoxHotelAdress.Text =
|
||||||
|
hotel.Adress;
|
||||||
|
|
||||||
|
_hotelId = value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public FormHotel(IHotelRepository hotelRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_hotelRepository = hotelRepository ??
|
||||||
|
throw new
|
||||||
|
ArgumentNullException(nameof(hotelRepository));
|
||||||
|
}
|
||||||
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(textBoxHotelName.Text)
|
||||||
|
||
|
||||||
|
string.IsNullOrWhiteSpace(textBoxHotelName.Text))
|
||||||
|
{
|
||||||
|
throw new Exception("Имеются незаполненные поля");
|
||||||
|
}
|
||||||
|
if (_hotelId.HasValue)
|
||||||
|
{
|
||||||
|
_hotelRepository.UpdateHotel(CreateHotel(_hotelId.Value));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_hotelRepository.CreateHotel(CreateHotel(0));
|
||||||
|
}
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при сохранении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||||
|
private Hotel CreateHotel(int id) => Hotel.CreateEntity(id, textBoxHotelName.Text, textBoxHotelAdress.Text);
|
||||||
|
}
|
||||||
|
|
@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</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>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
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
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
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
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
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
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
124
ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.Designer.cs
generated
Normal file
124
ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.Designer.cs
generated
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
namespace ProjectHotel
|
||||||
|
{
|
||||||
|
partial class FormHotelForAthletes
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
menuStrip1 = new MenuStrip();
|
||||||
|
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
комнатыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
отелелиToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
спортсменыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
заселениеСпортсменаToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
menuStrip1.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// menuStrip1
|
||||||
|
//
|
||||||
|
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem });
|
||||||
|
menuStrip1.Location = new Point(0, 0);
|
||||||
|
menuStrip1.Name = "menuStrip1";
|
||||||
|
menuStrip1.Size = new Size(800, 24);
|
||||||
|
menuStrip1.TabIndex = 0;
|
||||||
|
menuStrip1.Text = "menuStrip1";
|
||||||
|
//
|
||||||
|
// справочникиToolStripMenuItem
|
||||||
|
//
|
||||||
|
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { комнатыToolStripMenuItem, отелелиToolStripMenuItem, спортсменыToolStripMenuItem });
|
||||||
|
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||||
|
справочникиToolStripMenuItem.Size = new Size(94, 20);
|
||||||
|
справочникиToolStripMenuItem.Text = "Справочники";
|
||||||
|
//
|
||||||
|
// комнатыToolStripMenuItem
|
||||||
|
//
|
||||||
|
комнатыToolStripMenuItem.Name = "комнатыToolStripMenuItem";
|
||||||
|
комнатыToolStripMenuItem.Size = new Size(145, 22);
|
||||||
|
комнатыToolStripMenuItem.Text = "Комнаты";
|
||||||
|
//
|
||||||
|
// отелелиToolStripMenuItem
|
||||||
|
//
|
||||||
|
отелелиToolStripMenuItem.Name = "отелелиToolStripMenuItem";
|
||||||
|
отелелиToolStripMenuItem.Size = new Size(145, 22);
|
||||||
|
отелелиToolStripMenuItem.Text = "Отелели";
|
||||||
|
//
|
||||||
|
// спортсменыToolStripMenuItem
|
||||||
|
//
|
||||||
|
спортсменыToolStripMenuItem.Name = "спортсменыToolStripMenuItem";
|
||||||
|
спортсменыToolStripMenuItem.Size = new Size(145, 22);
|
||||||
|
спортсменыToolStripMenuItem.Text = "Спортсмены";
|
||||||
|
//
|
||||||
|
// операцииToolStripMenuItem
|
||||||
|
//
|
||||||
|
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { заселениеСпортсменаToolStripMenuItem });
|
||||||
|
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||||
|
операцииToolStripMenuItem.Size = new Size(75, 20);
|
||||||
|
операцииToolStripMenuItem.Text = "Операции";
|
||||||
|
//
|
||||||
|
// заселениеСпортсменаToolStripMenuItem
|
||||||
|
//
|
||||||
|
заселениеСпортсменаToolStripMenuItem.Name = "заселениеСпортсменаToolStripMenuItem";
|
||||||
|
заселениеСпортсменаToolStripMenuItem.Size = new Size(201, 22);
|
||||||
|
заселениеСпортсменаToolStripMenuItem.Text = "Заселение спортсмена";
|
||||||
|
//
|
||||||
|
// отчетыToolStripMenuItem
|
||||||
|
//
|
||||||
|
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||||
|
отчетыToolStripMenuItem.Size = new Size(60, 20);
|
||||||
|
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||||
|
//
|
||||||
|
// FormHotelForAthletes
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
BackgroundImage = Properties.Resources.hotel;
|
||||||
|
BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(menuStrip1);
|
||||||
|
MainMenuStrip = menuStrip1;
|
||||||
|
Name = "FormHotelForAthletes";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Гостиница";
|
||||||
|
menuStrip1.ResumeLayout(false);
|
||||||
|
menuStrip1.PerformLayout();
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private MenuStrip menuStrip1;
|
||||||
|
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem комнатыToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem отелелиToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem спортсменыToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem операцииToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem заселениеСпортсменаToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
namespace ProjectHotel
|
namespace ProjectHotel
|
||||||
{
|
{
|
||||||
public partial class Form1 : Form
|
public partial class FormHotelForAthletes : Form
|
||||||
{
|
{
|
||||||
public Form1()
|
public FormHotelForAthletes()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
123
ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.resx
Normal file
123
ProjectHotel/ProjectHotel/Forms/FormHotelForAthletes.resx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?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="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
94
ProjectHotel/ProjectHotel/Forms/FormHotels.Designer.cs
generated
Normal file
94
ProjectHotel/ProjectHotel/Forms/FormHotels.Designer.cs
generated
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
namespace ProjectHotel.Forms
|
||||||
|
{
|
||||||
|
partial class FormHotels
|
||||||
|
{
|
||||||
|
/// <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();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
buttonChange = new Button();
|
||||||
|
buttonDelete = new Button();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Controls.Add(buttonDelete);
|
||||||
|
panel1.Controls.Add(buttonChange);
|
||||||
|
panel1.Controls.Add(buttonAdd);
|
||||||
|
panel1.Dock = DockStyle.Right;
|
||||||
|
panel1.Location = new Point(632, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(168, 450);
|
||||||
|
panel1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
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;
|
||||||
|
//
|
||||||
|
// buttonChange
|
||||||
|
//
|
||||||
|
buttonChange.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
buttonChange.Location = new Point(24, 158);
|
||||||
|
buttonChange.Name = "buttonChange";
|
||||||
|
buttonChange.Size = new Size(130, 130);
|
||||||
|
buttonChange.TabIndex = 1;
|
||||||
|
buttonChange.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// buttonDelete
|
||||||
|
//
|
||||||
|
buttonDelete.Location = new Point(24, 308);
|
||||||
|
buttonDelete.Name = "buttonDelete";
|
||||||
|
buttonDelete.Size = new Size(130, 130);
|
||||||
|
buttonDelete.TabIndex = 2;
|
||||||
|
buttonDelete.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// FormHotels
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Name = "FormHotels";
|
||||||
|
Text = "FormHotels";
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Panel panel1;
|
||||||
|
private Button buttonAdd;
|
||||||
|
private Button buttonDelete;
|
||||||
|
private Button buttonChange;
|
||||||
|
}
|
||||||
|
}
|
108
ProjectHotel/ProjectHotel/Forms/FormHotels.cs
Normal file
108
ProjectHotel/ProjectHotel/Forms/FormHotels.cs
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
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 FormHotels : Form
|
||||||
|
{
|
||||||
|
private readonly IUnityContainer _container;
|
||||||
|
private readonly IAnimalRepository _animalRepository;
|
||||||
|
public FormAnimals(IUnityContainer container, IAnimalRepository
|
||||||
|
aimalRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_container = container ??
|
||||||
|
throw new ArgumentNullException(nameof(container));
|
||||||
|
_animalRepository = aimalRepository ??
|
||||||
|
throw new
|
||||||
|
ArgumentNullException(nameof(aimalRepository));
|
||||||
|
}
|
||||||
|
private void FormAnimals_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormAnimal>().ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при добавлении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ButtonUpd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
20
|
||||||
|
var form = _container.Resolve<FormAnimal>();
|
||||||
|
form.Id = findId;
|
||||||
|
form.ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при изменении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ButtonDel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_animalRepository.DeleteAnimal(findId);
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при удалении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void LoadList() => dataGridViewData.DataSource = _animalRepository.ReadAnimals();
|
||||||
|
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||||
|
{
|
||||||
|
id = 0;
|
||||||
|
if (dataGridViewData.SelectedRows.Count < 1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Нет выбранной записи", "Ошибка",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
120
ProjectHotel/ProjectHotel/Forms/FormHotels.resx
Normal file
120
ProjectHotel/ProjectHotel/Forms/FormHotels.resx
Normal 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>
|
@ -11,7 +11,7 @@ namespace ProjectHotel
|
|||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new Form1());
|
Application.Run(new FormHotelForAthletes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,10 +2,25 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net7.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
83
ProjectHotel/ProjectHotel/Properties/Resources.Designer.cs
generated
Normal file
83
ProjectHotel/ProjectHotel/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ProjectHotel.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// 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.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectHotel.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap AddImage {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("AddImage", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap hotel {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("hotel", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
133
ProjectHotel/ProjectHotel/Properties/Resources.resx
Normal file
133
ProjectHotel/ProjectHotel/Properties/Resources.resx
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
<?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>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="ImageChange" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\ImageChange.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="AddImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\AddImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="hotel" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\hotel.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="ImageChange" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\ImageChange1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
@ -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;
|
||||||
|
|
||||||
|
public interface IAthleteSportReposetory
|
||||||
|
{
|
||||||
|
IEnumerable<AthleteSport> ReadAthleteSport();
|
||||||
|
AthleteSport ReadAthleteSportById(int id);
|
||||||
|
void CreateAthleteSport(AthleteSport athleteSport);
|
||||||
|
void DeleteAthleteSport(int id);
|
||||||
|
}
|
@ -9,8 +9,8 @@ namespace ProjectHotel.Repositories;
|
|||||||
|
|
||||||
public interface IHotelRepository
|
public interface IHotelRepository
|
||||||
{
|
{
|
||||||
IEnumerable<Hotel> ReadAthletes();
|
IEnumerable<Hotel> ReadHotels();
|
||||||
Athlete ReadHotelById(int id);
|
Hotel ReadHotelById(int id);
|
||||||
void CreateHotel(Hotel hotel);
|
void CreateHotel(Hotel hotel);
|
||||||
void UpdateHotel(Hotel hotel);
|
void UpdateHotel(Hotel hotel);
|
||||||
void DeleteHotel(int id);
|
void DeleteHotel(int id);
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
public interface IPlacingAthleteRepository
|
||||||
|
{
|
||||||
|
IEnumerable<PlacingAthlete> ReadPlacingAthlete(DateTime? dateForm =
|
||||||
|
null, DateTime? dateTo = null,
|
||||||
|
int? athleteId = null, int? roomId = null);
|
||||||
|
void CreatePlacingAthlete(PlacingAthlete placingAthlete);
|
||||||
|
}
|
@ -1,18 +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 IPlacingRepository
|
|
||||||
{
|
|
||||||
IEnumerable<PlacingAthlete> ReadPlacing();
|
|
||||||
PlacingAthlete ReadPlacingById(int id);
|
|
||||||
void CreateHotel(PlacingAthlete placing);
|
|
||||||
void UpdateHotel(PlacingAthlete placing);
|
|
||||||
void DeletePlacing(int id);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +1,18 @@
|
|||||||
using System;
|
using ProjectHotel.Entities;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ProjectHotel.Repositories
|
namespace ProjectHotel.Repositories;
|
||||||
|
|
||||||
|
public interface IRoomRepository
|
||||||
{
|
{
|
||||||
internal interface IRoomRepository
|
|
||||||
{
|
IEnumerable<Rooms> ReadRooms();
|
||||||
}
|
Rooms ReadRoomById(int id);
|
||||||
|
void CreateRoom(Rooms rooms);
|
||||||
|
void UpdateRoom(Rooms rooms);
|
||||||
|
void DeleteRoom(int id);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
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 AthleteRepository : IAthleteRepository
|
||||||
|
{
|
||||||
|
public void CreateAthlete(Athlete athlete)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void DeleteAthlete(int id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public Athlete ReadAthleteById(int id)
|
||||||
|
{
|
||||||
|
return Athlete.CreateEntity(0, string.Empty, string.Empty, string.Empty, 0);
|
||||||
|
}
|
||||||
|
public IEnumerable<Athlete> ReadAthletes()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public void UpdateAthlete(Athlete athlete)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
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<AthleteSport> ReadAthleteSport()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public AthleteSport ReadAthleteSportById(int id)
|
||||||
|
{
|
||||||
|
return AthleteSport.CreateEntity(0, 0);
|
||||||
|
}
|
||||||
|
public void CreateAthleteSport(AthleteSport athleteSport)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void DeleteAthleteSport(int id)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
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 HotelRepository : IHotelRepository
|
||||||
|
{
|
||||||
|
public IEnumerable<Hotel> ReadHotels()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public Hotel ReadHotelById(int id)
|
||||||
|
{
|
||||||
|
return Hotel.CreateEntity(0, string.Empty, string.Empty);
|
||||||
|
}
|
||||||
|
public void CreateHotel(Hotel hotel)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void UpdateHotel(Hotel hotel)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void DeleteHotel(int id)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
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 PlacingAthleteRepository : IPlacingAthleteRepository
|
||||||
|
{
|
||||||
|
public IEnumerable<PlacingAthlete> ReadPlacingAthlete(DateTime? dateForm =
|
||||||
|
null, DateTime? dateTo = null,
|
||||||
|
int? athleteId = null, int? roomId = null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public void CreatePlacingAthlete(PlacingAthlete placingAthlete)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
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 RoomRepository : IRoomRepository
|
||||||
|
{
|
||||||
|
public IEnumerable<Rooms> ReadRooms()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public Rooms ReadRoomById(int id)
|
||||||
|
{
|
||||||
|
return Rooms.CreateEntity(0, 0, string.Empty, 0);
|
||||||
|
}
|
||||||
|
public void CreateRoom(Rooms rooms)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void UpdateRoom(Rooms rooms)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void DeleteRoom(int id)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
BIN
ProjectHotel/ProjectHotel/Resources/hotel.jpg
Normal file
BIN
ProjectHotel/ProjectHotel/Resources/hotel.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 121 KiB |
Loading…
Reference in New Issue
Block a user