1233
This commit is contained in:
parent
bcd36cebc6
commit
3435de98be
@ -1,4 +1,4 @@
|
|||||||
using ProjectHotel.Entities.Enums;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -13,8 +13,7 @@ public class Athlete
|
|||||||
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 string FatherName { 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)
|
||||||
public static Athlete CreateEntity(int id, string first, string last, string father, AthleteClass athleteclass)
|
|
||||||
{
|
{
|
||||||
return new Athlete
|
return new Athlete
|
||||||
{
|
{
|
||||||
@ -22,7 +21,6 @@ public class Athlete
|
|||||||
FirstName = first ?? string.Empty,
|
FirstName = first ?? string.Empty,
|
||||||
LastName = last ?? string.Empty,
|
LastName = last ?? string.Empty,
|
||||||
FatherName = father ?? string.Empty,
|
FatherName = father ?? string.Empty,
|
||||||
Class = athleteclass
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
24
ProjectHotel/ProjectHotel/Entities/AthletePlacingAthlete.cs
Normal file
24
ProjectHotel/ProjectHotel/Entities/AthletePlacingAthlete.cs
Normal file
@ -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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
23
ProjectHotel/ProjectHotel/Entities/CleaningRoom.cs
Normal file
23
ProjectHotel/ProjectHotel/Entities/CleaningRoom.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;
|
||||||
|
|
||||||
|
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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
|
||||||
|
|
||||||
}
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
@ -9,16 +9,14 @@ namespace ProjectHotel.Entities;
|
|||||||
public class PlacingAthlete
|
public class PlacingAthlete
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public int AthleteId { get; private set;}
|
|
||||||
public int RoomId { get; private set; }
|
public int RoomId { get; private set; }
|
||||||
public DateTime PlacingDate { get; private set; }
|
public DateTime PlacingDate { get; private set; }
|
||||||
public DateTime UnplacingDate { 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
|
return new PlacingAthlete
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
AthleteId = athleteId,
|
|
||||||
RoomId = roomId,
|
RoomId = roomId,
|
||||||
PlacingDate = DateTime.Now,
|
PlacingDate = DateTime.Now,
|
||||||
UnplacingDate = unplacing,
|
UnplacingDate = unplacing,
|
||||||
|
114
ProjectHotel/ProjectHotel/Forms/FormAthlete.Designer.cs
generated
Normal file
114
ProjectHotel/ProjectHotel/Forms/FormAthlete.Designer.cs
generated
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
namespace ProjectHotel.Forms
|
||||||
|
{
|
||||||
|
partial class FormAthlete
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
79
ProjectHotel/ProjectHotel/Forms/FormAthlete.cs
Normal file
79
ProjectHotel/ProjectHotel/Forms/FormAthlete.cs
Normal file
@ -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!);
|
||||||
|
}
|
120
ProjectHotel/ProjectHotel/Forms/FormAthlete.resx
Normal file
120
ProjectHotel/ProjectHotel/Forms/FormAthlete.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>
|
@ -120,4 +120,7 @@
|
|||||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>25</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
@ -1,6 +1,6 @@
|
|||||||
namespace ProjectHotel.Forms
|
namespace ProjectHotel.Forms
|
||||||
{
|
{
|
||||||
partial class FormHotels
|
partial class Отели
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
@ -29,10 +29,12 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
panel1 = new Panel();
|
panel1 = new Panel();
|
||||||
buttonAdd = new Button();
|
|
||||||
buttonChange = new Button();
|
|
||||||
buttonDelete = new Button();
|
buttonDelete = new Button();
|
||||||
|
buttonChange = new Button();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
dataGridViewData = new DataGridView();
|
||||||
panel1.SuspendLayout();
|
panel1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// panel1
|
// panel1
|
||||||
@ -46,17 +48,19 @@
|
|||||||
panel1.Size = new Size(168, 450);
|
panel1.Size = new Size(168, 450);
|
||||||
panel1.TabIndex = 0;
|
panel1.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// buttonAdd
|
// buttonDelete
|
||||||
//
|
//
|
||||||
buttonAdd.BackgroundImageLayout = ImageLayout.Zoom;
|
buttonDelete.BackgroundImage = Properties.Resources.ImageDelete;
|
||||||
buttonAdd.Location = new Point(24, 12);
|
buttonDelete.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
buttonAdd.Name = "buttonAdd";
|
buttonDelete.Location = new Point(24, 308);
|
||||||
buttonAdd.Size = new Size(130, 130);
|
buttonDelete.Name = "buttonDelete";
|
||||||
buttonAdd.TabIndex = 0;
|
buttonDelete.Size = new Size(130, 130);
|
||||||
buttonAdd.UseVisualStyleBackColor = true;
|
buttonDelete.TabIndex = 2;
|
||||||
|
buttonDelete.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// buttonChange
|
// buttonChange
|
||||||
//
|
//
|
||||||
|
buttonChange.BackgroundImage = Properties.Resources.ImageChange;
|
||||||
buttonChange.BackgroundImageLayout = ImageLayout.Zoom;
|
buttonChange.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
buttonChange.Location = new Point(24, 158);
|
buttonChange.Location = new Point(24, 158);
|
||||||
buttonChange.Name = "buttonChange";
|
buttonChange.Name = "buttonChange";
|
||||||
@ -64,23 +68,46 @@
|
|||||||
buttonChange.TabIndex = 1;
|
buttonChange.TabIndex = 1;
|
||||||
buttonChange.UseVisualStyleBackColor = true;
|
buttonChange.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// buttonDelete
|
// buttonAdd
|
||||||
//
|
//
|
||||||
buttonDelete.Location = new Point(24, 308);
|
buttonAdd.BackgroundImage = Properties.Resources.AddImage;
|
||||||
buttonDelete.Name = "buttonDelete";
|
buttonAdd.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
buttonDelete.Size = new Size(130, 130);
|
buttonAdd.Location = new Point(24, 12);
|
||||||
buttonDelete.TabIndex = 2;
|
buttonAdd.Name = "buttonAdd";
|
||||||
buttonDelete.UseVisualStyleBackColor = true;
|
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);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(800, 450);
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(dataGridViewData);
|
||||||
Controls.Add(panel1);
|
Controls.Add(panel1);
|
||||||
Name = "FormHotels";
|
Name = "Отели";
|
||||||
|
StartPosition = FormStartPosition.CenterParent;
|
||||||
Text = "FormHotels";
|
Text = "FormHotels";
|
||||||
panel1.ResumeLayout(false);
|
panel1.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,5 +117,6 @@
|
|||||||
private Button buttonAdd;
|
private Button buttonAdd;
|
||||||
private Button buttonDelete;
|
private Button buttonDelete;
|
||||||
private Button buttonChange;
|
private Button buttonChange;
|
||||||
|
private DataGridView dataGridViewData;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,6 @@
|
|||||||
using System;
|
using ProjectHotel.Repositories;
|
||||||
|
using ProjectHotel.Repositories.Implementations;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@ -7,22 +9,22 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using Unity;
|
||||||
|
|
||||||
namespace ProjectHotel.Forms;
|
namespace ProjectHotel.Forms;
|
||||||
|
|
||||||
public partial class FormHotels : Form
|
public partial class Отели : Form
|
||||||
{
|
{
|
||||||
private readonly IUnityContainer _container;
|
private readonly IUnityContainer _container;
|
||||||
private readonly IAnimalRepository _animalRepository;
|
private readonly IHotelRepository _hotelRepository;
|
||||||
public FormAnimals(IUnityContainer container, IAnimalRepository
|
|
||||||
aimalRepository)
|
public Отели(IUnityContainer container, IHotelRepository hotelRepository)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_container = container ??
|
_container = container ??
|
||||||
throw new ArgumentNullException(nameof(container));
|
throw new ArgumentNullException(nameof(container));
|
||||||
_animalRepository = aimalRepository ??
|
_hotelRepository = hotelRepository ??
|
||||||
throw new
|
throw new ArgumentNullException(nameof(hotelRepository));
|
||||||
ArgumentNullException(nameof(aimalRepository));
|
|
||||||
}
|
}
|
||||||
private void FormAnimals_Load(object sender, EventArgs e)
|
private void FormAnimals_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -40,7 +42,7 @@ public partial class FormHotels : Form
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_container.Resolve<FormAnimal>().ShowDialog();
|
_container.Resolve<FormHotel>().ShowDialog();
|
||||||
LoadList();
|
LoadList();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -57,8 +59,7 @@ public partial class FormHotels : Form
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
20
|
var form = _container.Resolve<FormHotel>();
|
||||||
var form = _container.Resolve<FormAnimal>();
|
|
||||||
form.Id = findId;
|
form.Id = findId;
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
LoadList();
|
LoadList();
|
||||||
@ -69,7 +70,7 @@ public partial class FormHotels : Form
|
|||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
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))
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
{
|
{
|
||||||
@ -81,7 +82,7 @@ public partial class FormHotels : Form
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_animalRepository.DeleteAnimal(findId);
|
_hotelRepository.DeleteHotel(findId);
|
||||||
LoadList();
|
LoadList();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -90,7 +91,7 @@ public partial class FormHotels : Form
|
|||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void LoadList() => dataGridViewData.DataSource = _animalRepository.ReadAnimals();
|
private void LoadList() => dataGridViewData.DataSource = _hotelRepository.ReadHotels();
|
||||||
private bool TryGetIdentifierFromSelectedRow(out int id)
|
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||||
{
|
{
|
||||||
id = 0;
|
id = 0;
|
||||||
|
55
ProjectHotel/ProjectHotel/Forms/FormRoom.Designer.cs
generated
Normal file
55
ProjectHotel/ProjectHotel/Forms/FormRoom.Designer.cs
generated
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
namespace ProjectHotel.Forms
|
||||||
|
{
|
||||||
|
partial class Комната
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
20
ProjectHotel/ProjectHotel/Forms/FormRoom.cs
Normal file
20
ProjectHotel/ProjectHotel/Forms/FormRoom.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace ProjectHotel.Forms
|
||||||
|
{
|
||||||
|
public partial class Комната : Form
|
||||||
|
{
|
||||||
|
public Комната()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
123
ProjectHotel/ProjectHotel/Forms/FormRoom.resx
Normal file
123
ProjectHotel/ProjectHotel/Forms/FormRoom.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="hotelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
@ -23,4 +23,12 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Entities\Enums\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Unity" Version="5.11.10" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is automatically generated by Visual Studio. It is
|
||||||
|
used to store generic object data source configuration information.
|
||||||
|
Renaming the file extension or editing the content of this file may
|
||||||
|
cause the file to be unrecognizable by the program.
|
||||||
|
-->
|
||||||
|
<GenericObjectDataSource DisplayName="Hotel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||||
|
<TypeInfo>ProjectHotel.Entities.Hotel, ProjectHotel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||||
|
</GenericObjectDataSource>
|
@ -1,10 +1,10 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// 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.
|
// повторной генерации кода.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -13,12 +13,12 @@ namespace ProjectHotel.Properties {
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||||
// class via a tool like ResGen or Visual Studio.
|
// с помощью такого средства, как ResGen или Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// с параметром /str или перестройте свой проект VS.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
@ -33,7 +33,7 @@ namespace ProjectHotel.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
@ -47,8 +47,8 @@ namespace ProjectHotel.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
@ -61,7 +61,7 @@ namespace ProjectHotel.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap AddImage {
|
internal static System.Drawing.Bitmap AddImage {
|
||||||
get {
|
get {
|
||||||
@ -71,7 +71,7 @@ namespace ProjectHotel.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap hotel {
|
internal static System.Drawing.Bitmap hotel {
|
||||||
get {
|
get {
|
||||||
@ -79,5 +79,25 @@ namespace ProjectHotel.Properties {
|
|||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap ImageChange {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("ImageChange", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap ImageDelete {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("ImageDelete", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<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">
|
<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>
|
<value>..\Resources\ImageChange1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AddImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<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>
|
<value>..\Resources\AddImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
@ -127,7 +127,7 @@
|
|||||||
<data name="hotel" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<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>
|
<value>..\Resources\hotel.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ImageChange" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="ImageDelete" 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>
|
<value>..\Resources\ImageDelete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
@ -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<AthletePlacingAthlete> ReadAthletePlacingAthlete(int? id = null, int? athleteId = null, int? roomId = null);
|
||||||
|
void CreateAthletePlacingAthlete(AthletePlacingAthlete athletePlacingAthlete);
|
||||||
|
AthletePlacingAthlete ReadAthleteById(int id);
|
||||||
|
}
|
@ -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<AthleteSport> ReadAthleteSport();
|
|
||||||
AthleteSport ReadAthleteSportById(int id);
|
|
||||||
void CreateAthleteSport(AthleteSport athleteSport);
|
|
||||||
void DeleteAthleteSport(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;
|
||||||
|
|
||||||
|
internal interface ICleaningRoomRepository
|
||||||
|
{
|
||||||
|
IEnumerable<CleaningRoom> ReadCleaningRoom(int? id = null, int? roomId = null, int? athleteId = null);
|
||||||
|
void CreateCleaningRoom(CleaningRoom cleaningRoom);
|
||||||
|
AthletePlacingAthlete ReadAthleteById(int id);
|
||||||
|
}
|
||||||
|
|
@ -9,8 +9,7 @@ namespace ProjectHotel.Repositories;
|
|||||||
|
|
||||||
public interface IPlacingAthleteRepository
|
public interface IPlacingAthleteRepository
|
||||||
{
|
{
|
||||||
IEnumerable<PlacingAthlete> ReadPlacingAthlete(DateTime? dateForm =
|
IEnumerable<PlacingAthlete> ReadPlacingAthlete(DateTime? placing = null, DateTime? unplacing = null, int? roomId = null);
|
||||||
null, DateTime? dateTo = null,
|
|
||||||
int? athleteId = null, int? roomId = null);
|
|
||||||
void CreatePlacingAthlete(PlacingAthlete placingAthlete);
|
void CreatePlacingAthlete(PlacingAthlete placingAthlete);
|
||||||
|
PlacingAthlete ReadPlacingAthleteById(int id);
|
||||||
}
|
}
|
||||||
|
@ -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<AthletePlacingAthleteRepository> 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);
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,7 @@ internal class AthleteRepository : IAthleteRepository
|
|||||||
}
|
}
|
||||||
public Athlete ReadAthleteById(int id)
|
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<Athlete> ReadAthletes()
|
public IEnumerable<Athlete> ReadAthletes()
|
||||||
{
|
{
|
||||||
|
@ -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<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,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<CleaningRoom> 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);
|
||||||
|
}
|
||||||
|
}
|
@ -9,9 +9,7 @@ namespace ProjectHotel.Repositories.Implementations;
|
|||||||
|
|
||||||
internal class PlacingAthleteRepository : IPlacingAthleteRepository
|
internal class PlacingAthleteRepository : IPlacingAthleteRepository
|
||||||
{
|
{
|
||||||
public IEnumerable<PlacingAthlete> ReadPlacingAthlete(DateTime? dateForm =
|
public IEnumerable<PlacingAthlete> ReadPlacingAthlete(DateTime? plasing = null, DateTime? unplacing = null, int? roomId = null)
|
||||||
null, DateTime? dateTo = null,
|
|
||||||
int? athleteId = null, int? roomId = null)
|
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@ -19,4 +17,8 @@ internal class PlacingAthleteRepository : IPlacingAthleteRepository
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public PlacingAthlete ReadPlacingAthleteById(int id)
|
||||||
|
{
|
||||||
|
return PlacingAthlete.CreateOpeartion(0, 0, DateTime.Now);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
BIN
ProjectHotel/ProjectHotel/Resources/AddImage.png
Normal file
BIN
ProjectHotel/ProjectHotel/Resources/AddImage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
BIN
ProjectHotel/ProjectHotel/Resources/ImageChange1.png
Normal file
BIN
ProjectHotel/ProjectHotel/Resources/ImageChange1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
ProjectHotel/ProjectHotel/Resources/ImageDelete.png
Normal file
BIN
ProjectHotel/ProjectHotel/Resources/ImageDelete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Loading…
Reference in New Issue
Block a user