формы начало
This commit is contained in:
parent
6e34674f13
commit
d5889d1e51
@ -6,14 +6,14 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace ProjectLibrary.Entites
|
namespace ProjectLibrary.Entites
|
||||||
{
|
{
|
||||||
public class BookOrders
|
public class Book_Orders
|
||||||
{
|
{
|
||||||
public int BookID { get; private set; }
|
public int BookID { get; private set; }
|
||||||
public int OrderID { get; private set; }
|
public int OrderID { get; private set; }
|
||||||
|
|
||||||
public static BookOrders CreateEntity(int bookID, int orderID)
|
public static Book_Orders CreateEntity(int bookID, int orderID)
|
||||||
{
|
{
|
||||||
return new BookOrders
|
return new Book_Orders
|
||||||
{
|
{
|
||||||
BookID = bookID,
|
BookID = bookID,
|
||||||
OrderID = orderID
|
OrderID = orderID
|
||||||
|
@ -6,15 +6,15 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace ProjectLibrary.Entites
|
namespace ProjectLibrary.Entites
|
||||||
{
|
{
|
||||||
public class BookLibrary
|
public class Book_Library
|
||||||
{
|
{
|
||||||
public int BookID { get; private set; }
|
public int BookID { get; private set; }
|
||||||
public int LibraryID { get; private set; }
|
public int LibraryID { get; private set; }
|
||||||
public int Count { get; private set; }
|
public int Count { get; private set; }
|
||||||
|
|
||||||
public static BookLibrary CreateEntity(int bookID, int libraryID, int count)
|
public static Book_Library CreateEntity(int bookID, int libraryID, int count)
|
||||||
{
|
{
|
||||||
return new BookLibrary
|
return new Book_Library
|
||||||
{
|
{
|
||||||
BookID = bookID,
|
BookID = bookID,
|
||||||
LibraryID = libraryID,
|
LibraryID = libraryID,
|
||||||
|
104
ProjectLibrary/FormLibrary.Designer.cs
generated
104
ProjectLibrary/FormLibrary.Designer.cs
generated
@ -28,12 +28,108 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
menuStrip1 = new MenuStrip();
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
читательскийБилетToolStripMenuItem = new ToolStripMenuItem();
|
||||||
this.Text = "Form1";
|
книгаToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
картаСотрудникаToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
оформлениеБилетаToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
обновлениеБилетаToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
menuStrip1.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// menuStrip1
|
||||||
|
//
|
||||||
|
menuStrip1.BackColor = Color.SlateGray;
|
||||||
|
menuStrip1.ImageScalingSize = new Size(20, 20);
|
||||||
|
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem });
|
||||||
|
menuStrip1.Location = new Point(0, 0);
|
||||||
|
menuStrip1.Name = "menuStrip1";
|
||||||
|
menuStrip1.Size = new Size(832, 28);
|
||||||
|
menuStrip1.TabIndex = 0;
|
||||||
|
menuStrip1.Text = "menuStrip";
|
||||||
|
//
|
||||||
|
// справочникиToolStripMenuItem
|
||||||
|
//
|
||||||
|
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { читательскийБилетToolStripMenuItem, книгаToolStripMenuItem, картаСотрудникаToolStripMenuItem });
|
||||||
|
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||||
|
справочникиToolStripMenuItem.Size = new Size(117, 24);
|
||||||
|
справочникиToolStripMenuItem.Text = "Справочники";
|
||||||
|
//
|
||||||
|
// читательскийБилетToolStripMenuItem
|
||||||
|
//
|
||||||
|
читательскийБилетToolStripMenuItem.Name = "читательскийБилетToolStripMenuItem";
|
||||||
|
читательскийБилетToolStripMenuItem.Size = new Size(231, 26);
|
||||||
|
читательскийБилетToolStripMenuItem.Text = "Читательский билет";
|
||||||
|
//
|
||||||
|
// книгаToolStripMenuItem
|
||||||
|
//
|
||||||
|
книгаToolStripMenuItem.Name = "книгаToolStripMenuItem";
|
||||||
|
книгаToolStripMenuItem.Size = new Size(231, 26);
|
||||||
|
книгаToolStripMenuItem.Text = "Книга";
|
||||||
|
//
|
||||||
|
// картаСотрудникаToolStripMenuItem
|
||||||
|
//
|
||||||
|
картаСотрудникаToolStripMenuItem.Name = "картаСотрудникаToolStripMenuItem";
|
||||||
|
картаСотрудникаToolStripMenuItem.Size = new Size(231, 26);
|
||||||
|
картаСотрудникаToolStripMenuItem.Text = "Сотрудники";
|
||||||
|
картаСотрудникаToolStripMenuItem.Click += картаСотрудникаToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// операцииToolStripMenuItem
|
||||||
|
//
|
||||||
|
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { оформлениеБилетаToolStripMenuItem, обновлениеБилетаToolStripMenuItem });
|
||||||
|
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||||
|
операцииToolStripMenuItem.Size = new Size(95, 24);
|
||||||
|
операцииToolStripMenuItem.Text = "Операции";
|
||||||
|
//
|
||||||
|
// оформлениеБилетаToolStripMenuItem
|
||||||
|
//
|
||||||
|
оформлениеБилетаToolStripMenuItem.Name = "оформлениеБилетаToolStripMenuItem";
|
||||||
|
оформлениеБилетаToolStripMenuItem.Size = new Size(240, 26);
|
||||||
|
оформлениеБилетаToolStripMenuItem.Text = "Оформление билета ";
|
||||||
|
//
|
||||||
|
// обновлениеБилетаToolStripMenuItem
|
||||||
|
//
|
||||||
|
обновлениеБилетаToolStripMenuItem.Name = "обновлениеБилетаToolStripMenuItem";
|
||||||
|
обновлениеБилетаToolStripMenuItem.Size = new Size(240, 26);
|
||||||
|
обновлениеБилетаToolStripMenuItem.Text = "Обновление билета";
|
||||||
|
//
|
||||||
|
// отчетыToolStripMenuItem
|
||||||
|
//
|
||||||
|
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||||
|
отчетыToolStripMenuItem.Size = new Size(73, 24);
|
||||||
|
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||||
|
//
|
||||||
|
// FormLibrary
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
BackColor = SystemColors.ButtonHighlight;
|
||||||
|
BackgroundImage = Properties.Resources.Снимок_экрана_2024_11_19_132940;
|
||||||
|
ClientSize = new Size(832, 453);
|
||||||
|
Controls.Add(menuStrip1);
|
||||||
|
MainMenuStrip = menuStrip1;
|
||||||
|
Name = "FormLibrary";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Библиотека";
|
||||||
|
menuStrip1.ResumeLayout(false);
|
||||||
|
menuStrip1.PerformLayout();
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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;
|
||||||
|
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,10 @@ namespace ProjectLibrary
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void êàðòàÑîòðóäíèêàToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.
|
||||||
-->
|
-->
|
||||||
@ -117,4 +117,7 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
183
ProjectLibrary/Forms/FBook.Designer.cs
generated
Normal file
183
ProjectLibrary/Forms/FBook.Designer.cs
generated
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
partial class FBook
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Обязательная переменная конструктора
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Очистка всех используемых ресурсов
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true, если управляемые ресурсы нужно освободить; иначе false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Код, автоматически созданный конструктором Windows Form Designer
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Требуемый метод для поддержки конструктора - не изменяйте
|
||||||
|
/// содержимое этого метода с помощью редактора кода.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
lblId = new Label();
|
||||||
|
txtId = new TextBox();
|
||||||
|
lblAuthor = new Label();
|
||||||
|
txtAuthor = new TextBox();
|
||||||
|
lblName = new Label();
|
||||||
|
txtName = new TextBox();
|
||||||
|
lblType = new Label();
|
||||||
|
cmbType = new ComboBox();
|
||||||
|
lblLibraryId = new Label();
|
||||||
|
txtLibraryId = new TextBox();
|
||||||
|
btnSave = new Button();
|
||||||
|
buttonCancel_Click = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblId
|
||||||
|
//
|
||||||
|
lblId.AutoSize = true;
|
||||||
|
lblId.Location = new Point(20, 20);
|
||||||
|
lblId.Name = "lblId";
|
||||||
|
lblId.Size = new Size(27, 20);
|
||||||
|
lblId.TabIndex = 0;
|
||||||
|
lblId.Text = "ID:";
|
||||||
|
//
|
||||||
|
// txtId
|
||||||
|
//
|
||||||
|
txtId.Location = new Point(100, 20);
|
||||||
|
txtId.Name = "txtId";
|
||||||
|
txtId.ReadOnly = true;
|
||||||
|
txtId.Size = new Size(200, 27);
|
||||||
|
txtId.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// lblAuthor
|
||||||
|
//
|
||||||
|
lblAuthor.AutoSize = true;
|
||||||
|
lblAuthor.Location = new Point(20, 60);
|
||||||
|
lblAuthor.Name = "lblAuthor";
|
||||||
|
lblAuthor.Size = new Size(54, 20);
|
||||||
|
lblAuthor.TabIndex = 2;
|
||||||
|
lblAuthor.Text = "Автор:";
|
||||||
|
//
|
||||||
|
// txtAuthor
|
||||||
|
//
|
||||||
|
txtAuthor.Location = new Point(100, 60);
|
||||||
|
txtAuthor.Name = "txtAuthor";
|
||||||
|
txtAuthor.Size = new Size(200, 27);
|
||||||
|
txtAuthor.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// lblName
|
||||||
|
//
|
||||||
|
lblName.AutoSize = true;
|
||||||
|
lblName.Location = new Point(20, 100);
|
||||||
|
lblName.Name = "lblName";
|
||||||
|
lblName.Size = new Size(80, 20);
|
||||||
|
lblName.TabIndex = 4;
|
||||||
|
lblName.Text = "Название:";
|
||||||
|
//
|
||||||
|
// txtName
|
||||||
|
//
|
||||||
|
txtName.Location = new Point(100, 100);
|
||||||
|
txtName.Name = "txtName";
|
||||||
|
txtName.Size = new Size(200, 27);
|
||||||
|
txtName.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// lblType
|
||||||
|
//
|
||||||
|
lblType.AutoSize = true;
|
||||||
|
lblType.Location = new Point(20, 140);
|
||||||
|
lblType.Name = "lblType";
|
||||||
|
lblType.Size = new Size(38, 20);
|
||||||
|
lblType.TabIndex = 6;
|
||||||
|
lblType.Text = "Тип:";
|
||||||
|
//
|
||||||
|
// cmbType
|
||||||
|
//
|
||||||
|
cmbType.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
cmbType.FormattingEnabled = true;
|
||||||
|
cmbType.Items.AddRange(new object[] { "Fiction", "Non-Fiction", "Science", "Biography" });
|
||||||
|
cmbType.Location = new Point(100, 140);
|
||||||
|
cmbType.Name = "cmbType";
|
||||||
|
cmbType.Size = new Size(200, 28);
|
||||||
|
cmbType.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// lblLibraryId
|
||||||
|
//
|
||||||
|
lblLibraryId.AutoSize = true;
|
||||||
|
lblLibraryId.Location = new Point(20, 180);
|
||||||
|
lblLibraryId.Name = "lblLibraryId";
|
||||||
|
lblLibraryId.Size = new Size(114, 20);
|
||||||
|
lblLibraryId.TabIndex = 8;
|
||||||
|
lblLibraryId.Text = "ID библиотеки:";
|
||||||
|
//
|
||||||
|
// txtLibraryId
|
||||||
|
//
|
||||||
|
txtLibraryId.Location = new Point(140, 177);
|
||||||
|
txtLibraryId.Name = "txtLibraryId";
|
||||||
|
txtLibraryId.Size = new Size(200, 27);
|
||||||
|
txtLibraryId.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
btnSave.Location = new Point(20, 220);
|
||||||
|
btnSave.Name = "btnSave";
|
||||||
|
btnSave.Size = new Size(100, 30);
|
||||||
|
btnSave.TabIndex = 10;
|
||||||
|
btnSave.Text = "Сохранить";
|
||||||
|
btnSave.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// buttonCancel_Click
|
||||||
|
//
|
||||||
|
buttonCancel_Click.Location = new Point(240, 220);
|
||||||
|
buttonCancel_Click.Name = "buttonCancel_Click";
|
||||||
|
buttonCancel_Click.Size = new Size(100, 30);
|
||||||
|
buttonCancel_Click.TabIndex = 11;
|
||||||
|
buttonCancel_Click.Text = "Отмена";
|
||||||
|
buttonCancel_Click.Click += buttonCancel_Click_Click;
|
||||||
|
//
|
||||||
|
// FBook
|
||||||
|
//
|
||||||
|
ClientSize = new Size(400, 300);
|
||||||
|
Controls.Add(buttonCancel_Click);
|
||||||
|
Controls.Add(lblId);
|
||||||
|
Controls.Add(txtId);
|
||||||
|
Controls.Add(lblAuthor);
|
||||||
|
Controls.Add(txtAuthor);
|
||||||
|
Controls.Add(lblName);
|
||||||
|
Controls.Add(txtName);
|
||||||
|
Controls.Add(lblType);
|
||||||
|
Controls.Add(cmbType);
|
||||||
|
Controls.Add(lblLibraryId);
|
||||||
|
Controls.Add(txtLibraryId);
|
||||||
|
Controls.Add(btnSave);
|
||||||
|
Name = "FBook";
|
||||||
|
Text = "Книга";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label lblId;
|
||||||
|
private System.Windows.Forms.TextBox txtId;
|
||||||
|
private System.Windows.Forms.Label lblAuthor;
|
||||||
|
private System.Windows.Forms.TextBox txtAuthor;
|
||||||
|
private System.Windows.Forms.Label lblName;
|
||||||
|
private System.Windows.Forms.TextBox txtName;
|
||||||
|
private System.Windows.Forms.Label lblType;
|
||||||
|
private System.Windows.Forms.ComboBox cmbType;
|
||||||
|
private System.Windows.Forms.Label lblLibraryId;
|
||||||
|
private System.Windows.Forms.TextBox txtLibraryId;
|
||||||
|
private System.Windows.Forms.Button btnSave;
|
||||||
|
private Button buttonCancel_Click;
|
||||||
|
}
|
||||||
|
}
|
123
ProjectLibrary/Forms/FBook.cs
Normal file
123
ProjectLibrary/Forms/FBook.cs
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
public partial class FBook : Form
|
||||||
|
{
|
||||||
|
public FBook()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
InitializeFormElements();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeFormElements()
|
||||||
|
{
|
||||||
|
// Заголовок формы
|
||||||
|
this.Text = "Книга";
|
||||||
|
|
||||||
|
// Создание метки и текстового поля для Id
|
||||||
|
Label lblId = new Label
|
||||||
|
{
|
||||||
|
Text = "ID:",
|
||||||
|
Location = new System.Drawing.Point(20, 20),
|
||||||
|
AutoSize = true
|
||||||
|
};
|
||||||
|
TextBox txtId = new TextBox
|
||||||
|
{
|
||||||
|
Location = new System.Drawing.Point(100, 20),
|
||||||
|
Width = 200,
|
||||||
|
ReadOnly = true // ID обычно только для чтения
|
||||||
|
};
|
||||||
|
|
||||||
|
// Создание метки и текстового поля для Author
|
||||||
|
Label lblAuthor = new Label
|
||||||
|
{
|
||||||
|
Text = "Автор:",
|
||||||
|
Location = new System.Drawing.Point(20, 60),
|
||||||
|
AutoSize = true
|
||||||
|
};
|
||||||
|
TextBox txtAuthor = new TextBox
|
||||||
|
{
|
||||||
|
Location = new System.Drawing.Point(100, 60),
|
||||||
|
Width = 200
|
||||||
|
};
|
||||||
|
|
||||||
|
// Создание метки и текстового поля для Name
|
||||||
|
Label lblName = new Label
|
||||||
|
{
|
||||||
|
Text = "Название:",
|
||||||
|
Location = new System.Drawing.Point(20, 100),
|
||||||
|
AutoSize = true
|
||||||
|
};
|
||||||
|
TextBox txtName = new TextBox
|
||||||
|
{
|
||||||
|
Location = new System.Drawing.Point(100, 100),
|
||||||
|
Width = 200
|
||||||
|
};
|
||||||
|
|
||||||
|
// Создание метки и выпадающего списка для Type
|
||||||
|
Label lblType = new Label
|
||||||
|
{
|
||||||
|
Text = "Тип:",
|
||||||
|
Location = new System.Drawing.Point(20, 140),
|
||||||
|
AutoSize = true
|
||||||
|
};
|
||||||
|
ComboBox cmbType = new ComboBox
|
||||||
|
{
|
||||||
|
Location = new System.Drawing.Point(100, 140),
|
||||||
|
Width = 200,
|
||||||
|
DropDownStyle = ComboBoxStyle.DropDownList
|
||||||
|
};
|
||||||
|
cmbType.Items.AddRange(new string[] { "Fiction", "Non-Fiction", "Science", "Biography" }); // Пример данных
|
||||||
|
|
||||||
|
// Создание метки и текстового поля для LibraryID
|
||||||
|
Label lblLibraryId = new Label
|
||||||
|
{
|
||||||
|
Text = "ID библиотеки:",
|
||||||
|
Location = new System.Drawing.Point(20, 180),
|
||||||
|
AutoSize = true
|
||||||
|
};
|
||||||
|
TextBox txtLibraryId = new TextBox
|
||||||
|
{
|
||||||
|
Location = new System.Drawing.Point(100, 180),
|
||||||
|
Width = 200
|
||||||
|
};
|
||||||
|
|
||||||
|
// Кнопка "Сохранить"
|
||||||
|
Button btnSave = new Button
|
||||||
|
{
|
||||||
|
Text = "Сохранить",
|
||||||
|
Location = new System.Drawing.Point(100, 220),
|
||||||
|
Width = 100
|
||||||
|
};
|
||||||
|
btnSave.Click += (sender, e) => SaveData(txtId.Text, txtAuthor.Text, txtName.Text, cmbType.SelectedItem?.ToString(), txtLibraryId.Text);
|
||||||
|
|
||||||
|
// Добавление элементов на форму
|
||||||
|
this.Controls.Add(lblId);
|
||||||
|
this.Controls.Add(txtId);
|
||||||
|
this.Controls.Add(lblAuthor);
|
||||||
|
this.Controls.Add(txtAuthor);
|
||||||
|
this.Controls.Add(lblName);
|
||||||
|
this.Controls.Add(txtName);
|
||||||
|
this.Controls.Add(lblType);
|
||||||
|
this.Controls.Add(cmbType);
|
||||||
|
this.Controls.Add(lblLibraryId);
|
||||||
|
this.Controls.Add(txtLibraryId);
|
||||||
|
this.Controls.Add(btnSave);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveData(string id, string author, string name, string type, string libraryId)
|
||||||
|
{
|
||||||
|
// Логика сохранения данных (например, в базу данных)
|
||||||
|
MessageBox.Show("Данные сохранены:\n" +
|
||||||
|
$"ID: {id}\n" +
|
||||||
|
$"Автор: {author}\n" +
|
||||||
|
$"Название: {name}\n" +
|
||||||
|
$"Тип: {type}\n" +
|
||||||
|
$"ID библиотеки: {libraryId}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectLibrary/Forms/FBook.resx
Normal file
120
ProjectLibrary/Forms/FBook.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>
|
101
ProjectLibrary/Forms/FBook_Orders.Designer.cs
generated
Normal file
101
ProjectLibrary/Forms/FBook_Orders.Designer.cs
generated
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
partial class FBook_Orders
|
||||||
|
{
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
private Label lblBookID;
|
||||||
|
private TextBox txtBookID;
|
||||||
|
private Label lblOrderID;
|
||||||
|
private TextBox txtOrderID;
|
||||||
|
private Button btnSave;
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
lblBookID = new Label();
|
||||||
|
txtBookID = new TextBox();
|
||||||
|
lblOrderID = new Label();
|
||||||
|
txtOrderID = new TextBox();
|
||||||
|
btnSave = new Button();
|
||||||
|
buttonCancel_Click = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblBookID
|
||||||
|
//
|
||||||
|
lblBookID.AutoSize = true;
|
||||||
|
lblBookID.Location = new Point(20, 20);
|
||||||
|
lblBookID.Name = "lblBookID";
|
||||||
|
lblBookID.Size = new Size(71, 20);
|
||||||
|
lblBookID.TabIndex = 0;
|
||||||
|
lblBookID.Text = "ID книги:";
|
||||||
|
//
|
||||||
|
// txtBookID
|
||||||
|
//
|
||||||
|
txtBookID.Location = new Point(100, 20);
|
||||||
|
txtBookID.Name = "txtBookID";
|
||||||
|
txtBookID.ReadOnly = true;
|
||||||
|
txtBookID.Size = new Size(200, 27);
|
||||||
|
txtBookID.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// lblOrderID
|
||||||
|
//
|
||||||
|
lblOrderID.AutoSize = true;
|
||||||
|
lblOrderID.Location = new Point(20, 60);
|
||||||
|
lblOrderID.Name = "lblOrderID";
|
||||||
|
lblOrderID.Size = new Size(76, 20);
|
||||||
|
lblOrderID.TabIndex = 2;
|
||||||
|
lblOrderID.Text = "ID заказа:";
|
||||||
|
//
|
||||||
|
// txtOrderID
|
||||||
|
//
|
||||||
|
txtOrderID.Location = new Point(100, 60);
|
||||||
|
txtOrderID.Name = "txtOrderID";
|
||||||
|
txtOrderID.ReadOnly = true;
|
||||||
|
txtOrderID.Size = new Size(200, 27);
|
||||||
|
txtOrderID.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
btnSave.Location = new Point(20, 93);
|
||||||
|
btnSave.Name = "btnSave";
|
||||||
|
btnSave.Size = new Size(100, 30);
|
||||||
|
btnSave.TabIndex = 4;
|
||||||
|
btnSave.Text = "Сохранить";
|
||||||
|
btnSave.Click += btnSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel_Click
|
||||||
|
//
|
||||||
|
buttonCancel_Click.Location = new Point(200, 93);
|
||||||
|
buttonCancel_Click.Name = "buttonCancel_Click";
|
||||||
|
buttonCancel_Click.Size = new Size(100, 30);
|
||||||
|
buttonCancel_Click.TabIndex = 10;
|
||||||
|
buttonCancel_Click.Text = "Отмена";
|
||||||
|
buttonCancel_Click.Click += buttonCancel_Click_Click;
|
||||||
|
//
|
||||||
|
// FBook_Orders
|
||||||
|
//
|
||||||
|
ClientSize = new Size(400, 200);
|
||||||
|
Controls.Add(buttonCancel_Click);
|
||||||
|
Controls.Add(lblBookID);
|
||||||
|
Controls.Add(txtBookID);
|
||||||
|
Controls.Add(lblOrderID);
|
||||||
|
Controls.Add(txtOrderID);
|
||||||
|
Controls.Add(btnSave);
|
||||||
|
Name = "FBook_Orders";
|
||||||
|
Text = "Книга и заказ";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button buttonCancel_Click;
|
||||||
|
}
|
||||||
|
}
|
43
ProjectLibrary/Forms/FBook_Orders.cs
Normal file
43
ProjectLibrary/Forms/FBook_Orders.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ProjectLibrary.Entites;
|
||||||
|
|
||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
public partial class FBook_Orders : Form
|
||||||
|
{
|
||||||
|
private Book_Orders _bookOrders;
|
||||||
|
|
||||||
|
public FBook_Orders(Book_Orders bookOrders)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_bookOrders = bookOrders;
|
||||||
|
LoadOrderData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadOrderData()
|
||||||
|
{
|
||||||
|
txtBookID.Text = _bookOrders.BookID.ToString();
|
||||||
|
txtOrderID.Text = _bookOrders.OrderID.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Создание новой сущности с обновленными данными
|
||||||
|
var updatedBookOrders = Book_Orders.CreateEntity(
|
||||||
|
int.Parse(txtBookID.Text),
|
||||||
|
int.Parse(txtOrderID.Text)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Обновление внутренней переменной
|
||||||
|
_bookOrders = updatedBookOrders;
|
||||||
|
|
||||||
|
MessageBox.Show("Данные успешно сохранены!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectLibrary/Forms/FBook_Orders.resx
Normal file
120
ProjectLibrary/Forms/FBook_Orders.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>
|
126
ProjectLibrary/Forms/FBook_library.Designer.cs
generated
Normal file
126
ProjectLibrary/Forms/FBook_library.Designer.cs
generated
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
partial class FBook_library
|
||||||
|
{
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
private Label lblBookID;
|
||||||
|
private TextBox txtBookID;
|
||||||
|
private Label lblLibraryID;
|
||||||
|
private TextBox txtLibraryID;
|
||||||
|
private Label lblCount;
|
||||||
|
private TextBox txtCount;
|
||||||
|
private Button btnSave;
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
lblBookID = new Label();
|
||||||
|
txtBookID = new TextBox();
|
||||||
|
lblLibraryID = new Label();
|
||||||
|
txtLibraryID = new TextBox();
|
||||||
|
lblCount = new Label();
|
||||||
|
txtCount = new TextBox();
|
||||||
|
btnSave = new Button();
|
||||||
|
buttonCancel_Click = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblBookID
|
||||||
|
//
|
||||||
|
lblBookID.AutoSize = true;
|
||||||
|
lblBookID.Location = new Point(20, 20);
|
||||||
|
lblBookID.Name = "lblBookID";
|
||||||
|
lblBookID.Size = new Size(71, 20);
|
||||||
|
lblBookID.TabIndex = 0;
|
||||||
|
lblBookID.Text = "ID книги:";
|
||||||
|
//
|
||||||
|
// txtBookID
|
||||||
|
//
|
||||||
|
txtBookID.Location = new Point(140, 20);
|
||||||
|
txtBookID.Name = "txtBookID";
|
||||||
|
txtBookID.ReadOnly = true;
|
||||||
|
txtBookID.Size = new Size(200, 27);
|
||||||
|
txtBookID.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// lblLibraryID
|
||||||
|
//
|
||||||
|
lblLibraryID.AutoSize = true;
|
||||||
|
lblLibraryID.Location = new Point(20, 60);
|
||||||
|
lblLibraryID.Name = "lblLibraryID";
|
||||||
|
lblLibraryID.Size = new Size(114, 20);
|
||||||
|
lblLibraryID.TabIndex = 2;
|
||||||
|
lblLibraryID.Text = "ID библиотеки:";
|
||||||
|
//
|
||||||
|
// txtLibraryID
|
||||||
|
//
|
||||||
|
txtLibraryID.Location = new Point(140, 57);
|
||||||
|
txtLibraryID.Name = "txtLibraryID";
|
||||||
|
txtLibraryID.ReadOnly = true;
|
||||||
|
txtLibraryID.Size = new Size(200, 27);
|
||||||
|
txtLibraryID.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// lblCount
|
||||||
|
//
|
||||||
|
lblCount.AutoSize = true;
|
||||||
|
lblCount.Location = new Point(20, 100);
|
||||||
|
lblCount.Name = "lblCount";
|
||||||
|
lblCount.Size = new Size(93, 20);
|
||||||
|
lblCount.TabIndex = 4;
|
||||||
|
lblCount.Text = "Количество:";
|
||||||
|
//
|
||||||
|
// txtCount
|
||||||
|
//
|
||||||
|
txtCount.Location = new Point(140, 93);
|
||||||
|
txtCount.Name = "txtCount";
|
||||||
|
txtCount.Size = new Size(200, 27);
|
||||||
|
txtCount.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
btnSave.Location = new Point(20, 140);
|
||||||
|
btnSave.Name = "btnSave";
|
||||||
|
btnSave.Size = new Size(100, 30);
|
||||||
|
btnSave.TabIndex = 6;
|
||||||
|
btnSave.Text = "Сохранить";
|
||||||
|
btnSave.Click += btnSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel_Click
|
||||||
|
//
|
||||||
|
buttonCancel_Click.Location = new Point(240, 140);
|
||||||
|
buttonCancel_Click.Name = "buttonCancel_Click";
|
||||||
|
buttonCancel_Click.Size = new Size(100, 30);
|
||||||
|
buttonCancel_Click.TabIndex = 10;
|
||||||
|
buttonCancel_Click.Text = "Отмена";
|
||||||
|
buttonCancel_Click.Click += buttonCancel_Click_Click;
|
||||||
|
//
|
||||||
|
// FBook_library
|
||||||
|
//
|
||||||
|
ClientSize = new Size(400, 200);
|
||||||
|
Controls.Add(buttonCancel_Click);
|
||||||
|
Controls.Add(lblBookID);
|
||||||
|
Controls.Add(txtBookID);
|
||||||
|
Controls.Add(lblLibraryID);
|
||||||
|
Controls.Add(txtLibraryID);
|
||||||
|
Controls.Add(lblCount);
|
||||||
|
Controls.Add(txtCount);
|
||||||
|
Controls.Add(btnSave);
|
||||||
|
Name = "FBook_library";
|
||||||
|
Text = "Книга в библиотеке";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Button buttonCancel_Click;
|
||||||
|
}
|
||||||
|
}
|
45
ProjectLibrary/Forms/FBook_library.cs
Normal file
45
ProjectLibrary/Forms/FBook_library.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ProjectLibrary.Entites;
|
||||||
|
|
||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
public partial class FBook_library : Form
|
||||||
|
{
|
||||||
|
private Book_Library _bookLibrary;
|
||||||
|
|
||||||
|
public FBook_library(Book_Library bookLibrary)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_bookLibrary = bookLibrary;
|
||||||
|
LoadLibraryData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadLibraryData()
|
||||||
|
{
|
||||||
|
txtBookID.Text = _bookLibrary.BookID.ToString();
|
||||||
|
txtLibraryID.Text = _bookLibrary.LibraryID.ToString();
|
||||||
|
txtCount.Text = _bookLibrary.Count.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Создание новой сущности с измененными данными
|
||||||
|
var updatedBookLibrary = Book_Library.CreateEntity(
|
||||||
|
int.Parse(txtBookID.Text),
|
||||||
|
int.Parse(txtLibraryID.Text),
|
||||||
|
int.Parse(txtCount.Text)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Обновление внутренней переменной
|
||||||
|
_bookLibrary = updatedBookLibrary;
|
||||||
|
|
||||||
|
MessageBox.Show("Данные успешно сохранены!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectLibrary/Forms/FBook_library.resx
Normal file
120
ProjectLibrary/Forms/FBook_library.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>
|
122
ProjectLibrary/Forms/FLibrary.Designer.cs
generated
Normal file
122
ProjectLibrary/Forms/FLibrary.Designer.cs
generated
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
partial class FLibrary
|
||||||
|
{
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
private Label lblId;
|
||||||
|
private TextBox txtId;
|
||||||
|
private Label lblName;
|
||||||
|
private TextBox txtName;
|
||||||
|
private Label lblAddress;
|
||||||
|
private TextBox txtAddress;
|
||||||
|
private Button btnSave;
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
lblId = new Label();
|
||||||
|
txtId = new TextBox();
|
||||||
|
lblName = new Label();
|
||||||
|
txtName = new TextBox();
|
||||||
|
lblAddress = new Label();
|
||||||
|
txtAddress = new TextBox();
|
||||||
|
btnSave = new Button();
|
||||||
|
buttonCancel_Click = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblId
|
||||||
|
//
|
||||||
|
lblId.AutoSize = true;
|
||||||
|
lblId.Location = new Point(20, 20);
|
||||||
|
lblId.Name = "lblId";
|
||||||
|
lblId.Size = new Size(27, 20);
|
||||||
|
lblId.TabIndex = 0;
|
||||||
|
lblId.Text = "ID:";
|
||||||
|
//
|
||||||
|
// txtId
|
||||||
|
//
|
||||||
|
txtId.Location = new Point(100, 20);
|
||||||
|
txtId.Name = "txtId";
|
||||||
|
txtId.ReadOnly = true;
|
||||||
|
txtId.Size = new Size(200, 27);
|
||||||
|
txtId.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// lblName
|
||||||
|
//
|
||||||
|
lblName.AutoSize = true;
|
||||||
|
lblName.Location = new Point(20, 60);
|
||||||
|
lblName.Name = "lblName";
|
||||||
|
lblName.Size = new Size(42, 20);
|
||||||
|
lblName.TabIndex = 2;
|
||||||
|
lblName.Text = "Имя:";
|
||||||
|
//
|
||||||
|
// txtName
|
||||||
|
//
|
||||||
|
txtName.Location = new Point(100, 60);
|
||||||
|
txtName.Name = "txtName";
|
||||||
|
txtName.Size = new Size(200, 27);
|
||||||
|
txtName.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// lblAddress
|
||||||
|
//
|
||||||
|
lblAddress.AutoSize = true;
|
||||||
|
lblAddress.Location = new Point(20, 100);
|
||||||
|
lblAddress.Name = "lblAddress";
|
||||||
|
lblAddress.Size = new Size(54, 20);
|
||||||
|
lblAddress.TabIndex = 4;
|
||||||
|
lblAddress.Text = "Адрес:";
|
||||||
|
//
|
||||||
|
// txtAddress
|
||||||
|
//
|
||||||
|
txtAddress.Location = new Point(100, 100);
|
||||||
|
txtAddress.Name = "txtAddress";
|
||||||
|
txtAddress.Size = new Size(200, 27);
|
||||||
|
txtAddress.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
btnSave.Location = new Point(20, 133);
|
||||||
|
btnSave.Name = "btnSave";
|
||||||
|
btnSave.Size = new Size(100, 30);
|
||||||
|
btnSave.TabIndex = 6;
|
||||||
|
btnSave.Text = "Сохранить";
|
||||||
|
btnSave.Click += btnSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel_Click
|
||||||
|
//
|
||||||
|
buttonCancel_Click.Location = new Point(200, 133);
|
||||||
|
buttonCancel_Click.Name = "buttonCancel_Click";
|
||||||
|
buttonCancel_Click.Size = new Size(100, 30);
|
||||||
|
buttonCancel_Click.TabIndex = 10;
|
||||||
|
buttonCancel_Click.Text = "Отмена";
|
||||||
|
buttonCancel_Click.Click += buttonCancel_Click_Click;
|
||||||
|
//
|
||||||
|
// FLibrary
|
||||||
|
//
|
||||||
|
ClientSize = new Size(400, 200);
|
||||||
|
Controls.Add(buttonCancel_Click);
|
||||||
|
Controls.Add(lblId);
|
||||||
|
Controls.Add(txtId);
|
||||||
|
Controls.Add(lblName);
|
||||||
|
Controls.Add(txtName);
|
||||||
|
Controls.Add(lblAddress);
|
||||||
|
Controls.Add(txtAddress);
|
||||||
|
Controls.Add(btnSave);
|
||||||
|
Name = "FLibrary";
|
||||||
|
Text = "Библиотека";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button buttonCancel_Click;
|
||||||
|
}
|
||||||
|
}
|
45
ProjectLibrary/Forms/FLibrary.cs
Normal file
45
ProjectLibrary/Forms/FLibrary.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ProjectLibrary.Entites;
|
||||||
|
|
||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
public partial class FLibrary : Form
|
||||||
|
{
|
||||||
|
private Library _library;
|
||||||
|
|
||||||
|
public FLibrary(Library library)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_library = library;
|
||||||
|
LoadLibraryData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadLibraryData()
|
||||||
|
{
|
||||||
|
txtId.Text = _library.Id.ToString();
|
||||||
|
txtName.Text = _library.Name;
|
||||||
|
txtAddress.Text = _library.Address;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Создание новой сущности с обновленными данными
|
||||||
|
var updatedLibrary = Library.CreateEntity(
|
||||||
|
int.Parse(txtId.Text),
|
||||||
|
txtName.Text,
|
||||||
|
txtAddress.Text
|
||||||
|
);
|
||||||
|
|
||||||
|
// Обновление внутренней переменной
|
||||||
|
_library = updatedLibrary;
|
||||||
|
|
||||||
|
MessageBox.Show("Данные успешно сохранены!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectLibrary/Forms/FLibrary.resx
Normal file
120
ProjectLibrary/Forms/FLibrary.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>
|
167
ProjectLibrary/Forms/FOrders.Designer.cs
generated
Normal file
167
ProjectLibrary/Forms/FOrders.Designer.cs
generated
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
partial class FOrders
|
||||||
|
{
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
private Label lblOrderID;
|
||||||
|
private TextBox txtOrderID;
|
||||||
|
private Label lblOrderDate;
|
||||||
|
private TextBox txtOrderDate;
|
||||||
|
private Label lblReturnDate;
|
||||||
|
private TextBox txtReturnDate;
|
||||||
|
private Label lblReaderID;
|
||||||
|
private TextBox txtReaderID;
|
||||||
|
private Label lblBookID;
|
||||||
|
private TextBox txtBookID;
|
||||||
|
private Button btnSave;
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
lblOrderID = new Label();
|
||||||
|
txtOrderID = new TextBox();
|
||||||
|
lblOrderDate = new Label();
|
||||||
|
txtOrderDate = new TextBox();
|
||||||
|
lblReturnDate = new Label();
|
||||||
|
txtReturnDate = new TextBox();
|
||||||
|
lblReaderID = new Label();
|
||||||
|
txtReaderID = new TextBox();
|
||||||
|
lblBookID = new Label();
|
||||||
|
txtBookID = new TextBox();
|
||||||
|
btnSave = new Button();
|
||||||
|
buttonCancel_Click = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblOrderID
|
||||||
|
//
|
||||||
|
lblOrderID.AutoSize = true;
|
||||||
|
lblOrderID.Location = new Point(20, 20);
|
||||||
|
lblOrderID.Name = "lblOrderID";
|
||||||
|
lblOrderID.Size = new Size(76, 20);
|
||||||
|
lblOrderID.TabIndex = 0;
|
||||||
|
lblOrderID.Text = "ID заказа:";
|
||||||
|
//
|
||||||
|
// txtOrderID
|
||||||
|
//
|
||||||
|
txtOrderID.Location = new Point(137, 20);
|
||||||
|
txtOrderID.Name = "txtOrderID";
|
||||||
|
txtOrderID.ReadOnly = true;
|
||||||
|
txtOrderID.Size = new Size(200, 27);
|
||||||
|
txtOrderID.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// lblOrderDate
|
||||||
|
//
|
||||||
|
lblOrderDate.AutoSize = true;
|
||||||
|
lblOrderDate.Location = new Point(20, 60);
|
||||||
|
lblOrderDate.Name = "lblOrderDate";
|
||||||
|
lblOrderDate.Size = new Size(93, 20);
|
||||||
|
lblOrderDate.TabIndex = 2;
|
||||||
|
lblOrderDate.Text = "Дата заказа:";
|
||||||
|
//
|
||||||
|
// txtOrderDate
|
||||||
|
//
|
||||||
|
txtOrderDate.Location = new Point(137, 60);
|
||||||
|
txtOrderDate.Name = "txtOrderDate";
|
||||||
|
txtOrderDate.Size = new Size(200, 27);
|
||||||
|
txtOrderDate.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// lblReturnDate
|
||||||
|
//
|
||||||
|
lblReturnDate.AutoSize = true;
|
||||||
|
lblReturnDate.Location = new Point(20, 100);
|
||||||
|
lblReturnDate.Name = "lblReturnDate";
|
||||||
|
lblReturnDate.Size = new Size(111, 20);
|
||||||
|
lblReturnDate.TabIndex = 4;
|
||||||
|
lblReturnDate.Text = "Дата возврата:";
|
||||||
|
//
|
||||||
|
// txtReturnDate
|
||||||
|
//
|
||||||
|
txtReturnDate.Location = new Point(137, 100);
|
||||||
|
txtReturnDate.Name = "txtReturnDate";
|
||||||
|
txtReturnDate.Size = new Size(200, 27);
|
||||||
|
txtReturnDate.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// lblReaderID
|
||||||
|
//
|
||||||
|
lblReaderID.AutoSize = true;
|
||||||
|
lblReaderID.Location = new Point(20, 140);
|
||||||
|
lblReaderID.Name = "lblReaderID";
|
||||||
|
lblReaderID.Size = new Size(92, 20);
|
||||||
|
lblReaderID.TabIndex = 6;
|
||||||
|
lblReaderID.Text = "ID читателя:";
|
||||||
|
//
|
||||||
|
// txtReaderID
|
||||||
|
//
|
||||||
|
txtReaderID.Location = new Point(137, 140);
|
||||||
|
txtReaderID.Name = "txtReaderID";
|
||||||
|
txtReaderID.Size = new Size(200, 27);
|
||||||
|
txtReaderID.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// lblBookID
|
||||||
|
//
|
||||||
|
lblBookID.AutoSize = true;
|
||||||
|
lblBookID.Location = new Point(20, 180);
|
||||||
|
lblBookID.Name = "lblBookID";
|
||||||
|
lblBookID.Size = new Size(71, 20);
|
||||||
|
lblBookID.TabIndex = 8;
|
||||||
|
lblBookID.Text = "ID книги:";
|
||||||
|
//
|
||||||
|
// txtBookID
|
||||||
|
//
|
||||||
|
txtBookID.Location = new Point(137, 177);
|
||||||
|
txtBookID.Name = "txtBookID";
|
||||||
|
txtBookID.ReadOnly = true;
|
||||||
|
txtBookID.Size = new Size(200, 27);
|
||||||
|
txtBookID.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
btnSave.Location = new Point(20, 222);
|
||||||
|
btnSave.Name = "btnSave";
|
||||||
|
btnSave.Size = new Size(100, 30);
|
||||||
|
btnSave.TabIndex = 10;
|
||||||
|
btnSave.Text = "Сохранить";
|
||||||
|
btnSave.Click += btnSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel_Click
|
||||||
|
//
|
||||||
|
buttonCancel_Click.Location = new Point(237, 222);
|
||||||
|
buttonCancel_Click.Name = "buttonCancel_Click";
|
||||||
|
buttonCancel_Click.Size = new Size(100, 30);
|
||||||
|
buttonCancel_Click.TabIndex = 11;
|
||||||
|
buttonCancel_Click.Text = "Отмена";
|
||||||
|
buttonCancel_Click.Click += buttonCancel_Click_Click;
|
||||||
|
//
|
||||||
|
// FOrders
|
||||||
|
//
|
||||||
|
ClientSize = new Size(400, 300);
|
||||||
|
Controls.Add(buttonCancel_Click);
|
||||||
|
Controls.Add(lblOrderID);
|
||||||
|
Controls.Add(txtOrderID);
|
||||||
|
Controls.Add(lblOrderDate);
|
||||||
|
Controls.Add(txtOrderDate);
|
||||||
|
Controls.Add(lblReturnDate);
|
||||||
|
Controls.Add(txtReturnDate);
|
||||||
|
Controls.Add(lblReaderID);
|
||||||
|
Controls.Add(txtReaderID);
|
||||||
|
Controls.Add(lblBookID);
|
||||||
|
Controls.Add(txtBookID);
|
||||||
|
Controls.Add(btnSave);
|
||||||
|
Name = "FOrders";
|
||||||
|
Text = "Заказы";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button buttonCancel_Click;
|
||||||
|
}
|
||||||
|
}
|
56
ProjectLibrary/Forms/FOrders.cs
Normal file
56
ProjectLibrary/Forms/FOrders.cs
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ProjectLibrary.Entites;
|
||||||
|
|
||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
public partial class FOrders : Form
|
||||||
|
{
|
||||||
|
private Orders _order;
|
||||||
|
private Book_Orders _bookOrder;
|
||||||
|
|
||||||
|
public FOrders(Orders order, Book_Orders bookOrder)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_order = order;
|
||||||
|
_bookOrder = bookOrder;
|
||||||
|
LoadOrderData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadOrderData()
|
||||||
|
{
|
||||||
|
txtOrderID.Text = _order.Id.ToString();
|
||||||
|
txtOrderDate.Text = _order.OrderDate.ToString();
|
||||||
|
txtReturnDate.Text = _order.ReturnDate.ToString();
|
||||||
|
txtReaderID.Text = _order.ReaderID.ToString();
|
||||||
|
txtBookID.Text = _bookOrder.BookID.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Создание обновленных данных
|
||||||
|
var updatedOrder = Orders.CreateEntity(
|
||||||
|
int.Parse(txtOrderID.Text),
|
||||||
|
int.Parse(txtOrderDate.Text),
|
||||||
|
int.Parse(txtReturnDate.Text),
|
||||||
|
int.Parse(txtReaderID.Text)
|
||||||
|
);
|
||||||
|
|
||||||
|
var updatedBookOrder = Book_Orders.CreateEntity(
|
||||||
|
int.Parse(txtBookID.Text),
|
||||||
|
int.Parse(txtOrderID.Text)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Обновление объектов
|
||||||
|
_order = updatedOrder;
|
||||||
|
_bookOrder = updatedBookOrder;
|
||||||
|
|
||||||
|
MessageBox.Show("Данные успешно сохранены!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectLibrary/Forms/FOrders.resx
Normal file
120
ProjectLibrary/Forms/FOrders.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>
|
144
ProjectLibrary/Forms/FReader.Designer.cs
generated
Normal file
144
ProjectLibrary/Forms/FReader.Designer.cs
generated
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
partial class FReader
|
||||||
|
{
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
private Label lblId;
|
||||||
|
private TextBox txtId;
|
||||||
|
private Label lblName;
|
||||||
|
private TextBox txtName;
|
||||||
|
private Label lblReaderTicket;
|
||||||
|
private TextBox txtReaderTicket;
|
||||||
|
private Label lblRegistrationDate;
|
||||||
|
private TextBox txtRegistrationDate;
|
||||||
|
private Button btnSave;
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
lblId = new Label();
|
||||||
|
txtId = new TextBox();
|
||||||
|
lblName = new Label();
|
||||||
|
txtName = new TextBox();
|
||||||
|
lblReaderTicket = new Label();
|
||||||
|
txtReaderTicket = new TextBox();
|
||||||
|
lblRegistrationDate = new Label();
|
||||||
|
txtRegistrationDate = new TextBox();
|
||||||
|
btnSave = new Button();
|
||||||
|
buttonCancel_Click = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblId
|
||||||
|
//
|
||||||
|
lblId.AutoSize = true;
|
||||||
|
lblId.Location = new Point(20, 20);
|
||||||
|
lblId.Name = "lblId";
|
||||||
|
lblId.Size = new Size(27, 20);
|
||||||
|
lblId.TabIndex = 0;
|
||||||
|
lblId.Text = "ID:";
|
||||||
|
//
|
||||||
|
// txtId
|
||||||
|
//
|
||||||
|
txtId.Location = new Point(177, 20);
|
||||||
|
txtId.Name = "txtId";
|
||||||
|
txtId.ReadOnly = true;
|
||||||
|
txtId.Size = new Size(200, 27);
|
||||||
|
txtId.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// lblName
|
||||||
|
//
|
||||||
|
lblName.AutoSize = true;
|
||||||
|
lblName.Location = new Point(20, 60);
|
||||||
|
lblName.Name = "lblName";
|
||||||
|
lblName.Size = new Size(42, 20);
|
||||||
|
lblName.TabIndex = 2;
|
||||||
|
lblName.Text = "Имя:";
|
||||||
|
//
|
||||||
|
// txtName
|
||||||
|
//
|
||||||
|
txtName.Location = new Point(177, 60);
|
||||||
|
txtName.Name = "txtName";
|
||||||
|
txtName.Size = new Size(200, 27);
|
||||||
|
txtName.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// lblReaderTicket
|
||||||
|
//
|
||||||
|
lblReaderTicket.AutoSize = true;
|
||||||
|
lblReaderTicket.Location = new Point(20, 100);
|
||||||
|
lblReaderTicket.Name = "lblReaderTicket";
|
||||||
|
lblReaderTicket.Size = new Size(151, 20);
|
||||||
|
lblReaderTicket.TabIndex = 4;
|
||||||
|
lblReaderTicket.Text = "Читательский билет:";
|
||||||
|
//
|
||||||
|
// txtReaderTicket
|
||||||
|
//
|
||||||
|
txtReaderTicket.Location = new Point(177, 100);
|
||||||
|
txtReaderTicket.Name = "txtReaderTicket";
|
||||||
|
txtReaderTicket.Size = new Size(200, 27);
|
||||||
|
txtReaderTicket.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// lblRegistrationDate
|
||||||
|
//
|
||||||
|
lblRegistrationDate.AutoSize = true;
|
||||||
|
lblRegistrationDate.Location = new Point(20, 140);
|
||||||
|
lblRegistrationDate.Name = "lblRegistrationDate";
|
||||||
|
lblRegistrationDate.Size = new Size(137, 20);
|
||||||
|
lblRegistrationDate.TabIndex = 6;
|
||||||
|
lblRegistrationDate.Text = "Дата регистрации:";
|
||||||
|
//
|
||||||
|
// txtRegistrationDate
|
||||||
|
//
|
||||||
|
txtRegistrationDate.Location = new Point(177, 140);
|
||||||
|
txtRegistrationDate.Name = "txtRegistrationDate";
|
||||||
|
txtRegistrationDate.Size = new Size(200, 27);
|
||||||
|
txtRegistrationDate.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
btnSave.Location = new Point(20, 181);
|
||||||
|
btnSave.Name = "btnSave";
|
||||||
|
btnSave.Size = new Size(100, 30);
|
||||||
|
btnSave.TabIndex = 8;
|
||||||
|
btnSave.Text = "Сохранить";
|
||||||
|
btnSave.Click += btnSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel_Click
|
||||||
|
//
|
||||||
|
buttonCancel_Click.Location = new Point(277, 181);
|
||||||
|
buttonCancel_Click.Name = "buttonCancel_Click";
|
||||||
|
buttonCancel_Click.Size = new Size(100, 30);
|
||||||
|
buttonCancel_Click.TabIndex = 10;
|
||||||
|
buttonCancel_Click.Text = "Отмена";
|
||||||
|
buttonCancel_Click.Click += buttonCancel_Click_Click;
|
||||||
|
//
|
||||||
|
// FReader
|
||||||
|
//
|
||||||
|
ClientSize = new Size(400, 250);
|
||||||
|
Controls.Add(buttonCancel_Click);
|
||||||
|
Controls.Add(lblId);
|
||||||
|
Controls.Add(txtId);
|
||||||
|
Controls.Add(lblName);
|
||||||
|
Controls.Add(txtName);
|
||||||
|
Controls.Add(lblReaderTicket);
|
||||||
|
Controls.Add(txtReaderTicket);
|
||||||
|
Controls.Add(lblRegistrationDate);
|
||||||
|
Controls.Add(txtRegistrationDate);
|
||||||
|
Controls.Add(btnSave);
|
||||||
|
Name = "FReader";
|
||||||
|
Text = "Читатель";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button buttonCancel_Click;
|
||||||
|
}
|
||||||
|
}
|
48
ProjectLibrary/Forms/FReader.cs
Normal file
48
ProjectLibrary/Forms/FReader.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using ProjectLibrary.Entities;
|
||||||
|
|
||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
public partial class FReader : Form
|
||||||
|
{
|
||||||
|
private Reader _reader;
|
||||||
|
|
||||||
|
public FReader(Reader reader)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_reader = reader;
|
||||||
|
LoadReaderData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadReaderData()
|
||||||
|
{
|
||||||
|
txtId.Text = _reader.Id.ToString();
|
||||||
|
txtName.Text = _reader.Name;
|
||||||
|
txtReaderTicket.Text = _reader.ReaderTicket.ToString();
|
||||||
|
txtRegistrationDate.Text = _reader.RegistrationDateRT.ToShortDateString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Создание новой сущности с обновленными данными
|
||||||
|
var updatedReader = Reader.CreateEntity(
|
||||||
|
int.Parse(txtId.Text),
|
||||||
|
txtName.Text,
|
||||||
|
int.Parse(txtReaderTicket.Text),
|
||||||
|
DateTime.Parse(txtRegistrationDate.Text)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Обновление внутренней переменной
|
||||||
|
_reader = updatedReader;
|
||||||
|
|
||||||
|
MessageBox.Show("Данные успешно сохранены!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectLibrary/Forms/FReader.resx
Normal file
120
ProjectLibrary/Forms/FReader.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>
|
145
ProjectLibrary/Forms/FTicket_Extension.Designer.cs
generated
Normal file
145
ProjectLibrary/Forms/FTicket_Extension.Designer.cs
generated
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
partial class FTicket_Extension
|
||||||
|
{
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
private Label lblReaderID;
|
||||||
|
private TextBox txtReaderID;
|
||||||
|
private Label lblExtensionID;
|
||||||
|
private TextBox txtExtensionID;
|
||||||
|
private Label lblLastUpdateDate;
|
||||||
|
private TextBox txtLastUpdateDate;
|
||||||
|
private Label lblNextUpdateDate;
|
||||||
|
private TextBox txtNextUpdateDate;
|
||||||
|
private Button btnSave;
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
lblReaderID = new Label();
|
||||||
|
txtReaderID = new TextBox();
|
||||||
|
lblExtensionID = new Label();
|
||||||
|
txtExtensionID = new TextBox();
|
||||||
|
lblLastUpdateDate = new Label();
|
||||||
|
txtLastUpdateDate = new TextBox();
|
||||||
|
lblNextUpdateDate = new Label();
|
||||||
|
txtNextUpdateDate = new TextBox();
|
||||||
|
btnSave = new Button();
|
||||||
|
buttonCancel_Click = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// lblReaderID
|
||||||
|
//
|
||||||
|
lblReaderID.AutoSize = true;
|
||||||
|
lblReaderID.Location = new Point(20, 20);
|
||||||
|
lblReaderID.Name = "lblReaderID";
|
||||||
|
lblReaderID.Size = new Size(92, 20);
|
||||||
|
lblReaderID.TabIndex = 0;
|
||||||
|
lblReaderID.Text = "ID читателя:";
|
||||||
|
//
|
||||||
|
// txtReaderID
|
||||||
|
//
|
||||||
|
txtReaderID.Location = new Point(255, 13);
|
||||||
|
txtReaderID.Name = "txtReaderID";
|
||||||
|
txtReaderID.ReadOnly = true;
|
||||||
|
txtReaderID.Size = new Size(200, 27);
|
||||||
|
txtReaderID.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// lblExtensionID
|
||||||
|
//
|
||||||
|
lblExtensionID.AutoSize = true;
|
||||||
|
lblExtensionID.Location = new Point(20, 60);
|
||||||
|
lblExtensionID.Name = "lblExtensionID";
|
||||||
|
lblExtensionID.Size = new Size(110, 20);
|
||||||
|
lblExtensionID.TabIndex = 2;
|
||||||
|
lblExtensionID.Text = "ID Продления:";
|
||||||
|
//
|
||||||
|
// txtExtensionID
|
||||||
|
//
|
||||||
|
txtExtensionID.Location = new Point(255, 57);
|
||||||
|
txtExtensionID.Name = "txtExtensionID";
|
||||||
|
txtExtensionID.ReadOnly = true;
|
||||||
|
txtExtensionID.Size = new Size(200, 27);
|
||||||
|
txtExtensionID.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// lblLastUpdateDate
|
||||||
|
//
|
||||||
|
lblLastUpdateDate.AutoSize = true;
|
||||||
|
lblLastUpdateDate.Location = new Point(20, 100);
|
||||||
|
lblLastUpdateDate.Name = "lblLastUpdateDate";
|
||||||
|
lblLastUpdateDate.Size = new Size(219, 20);
|
||||||
|
lblLastUpdateDate.TabIndex = 4;
|
||||||
|
lblLastUpdateDate.Text = "Дата последнего обновления:";
|
||||||
|
//
|
||||||
|
// txtLastUpdateDate
|
||||||
|
//
|
||||||
|
txtLastUpdateDate.Location = new Point(255, 100);
|
||||||
|
txtLastUpdateDate.Name = "txtLastUpdateDate";
|
||||||
|
txtLastUpdateDate.Size = new Size(200, 27);
|
||||||
|
txtLastUpdateDate.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// lblNextUpdateDate
|
||||||
|
//
|
||||||
|
lblNextUpdateDate.AutoSize = true;
|
||||||
|
lblNextUpdateDate.Location = new Point(20, 140);
|
||||||
|
lblNextUpdateDate.Name = "lblNextUpdateDate";
|
||||||
|
lblNextUpdateDate.Size = new Size(223, 20);
|
||||||
|
lblNextUpdateDate.TabIndex = 6;
|
||||||
|
lblNextUpdateDate.Text = "Дата следующего обновления:";
|
||||||
|
//
|
||||||
|
// txtNextUpdateDate
|
||||||
|
//
|
||||||
|
txtNextUpdateDate.Location = new Point(255, 140);
|
||||||
|
txtNextUpdateDate.Name = "txtNextUpdateDate";
|
||||||
|
txtNextUpdateDate.Size = new Size(200, 27);
|
||||||
|
txtNextUpdateDate.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
btnSave.Location = new Point(20, 178);
|
||||||
|
btnSave.Name = "btnSave";
|
||||||
|
btnSave.Size = new Size(100, 30);
|
||||||
|
btnSave.TabIndex = 8;
|
||||||
|
btnSave.Text = "Сохранить";
|
||||||
|
btnSave.Click += btnSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel_Click
|
||||||
|
//
|
||||||
|
buttonCancel_Click.Location = new Point(355, 178);
|
||||||
|
buttonCancel_Click.Name = "buttonCancel_Click";
|
||||||
|
buttonCancel_Click.Size = new Size(100, 30);
|
||||||
|
buttonCancel_Click.TabIndex = 9;
|
||||||
|
buttonCancel_Click.Text = "Отмена";
|
||||||
|
buttonCancel_Click.Click += buttonCancel_Click_Click;
|
||||||
|
//
|
||||||
|
// FTicket_Extension
|
||||||
|
//
|
||||||
|
ClientSize = new Size(560, 250);
|
||||||
|
Controls.Add(buttonCancel_Click);
|
||||||
|
Controls.Add(lblReaderID);
|
||||||
|
Controls.Add(txtReaderID);
|
||||||
|
Controls.Add(lblExtensionID);
|
||||||
|
Controls.Add(txtExtensionID);
|
||||||
|
Controls.Add(lblLastUpdateDate);
|
||||||
|
Controls.Add(txtLastUpdateDate);
|
||||||
|
Controls.Add(lblNextUpdateDate);
|
||||||
|
Controls.Add(txtNextUpdateDate);
|
||||||
|
Controls.Add(btnSave);
|
||||||
|
Name = "FTicket_Extension";
|
||||||
|
Text = "Продление билета";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button buttonCancel_Click;
|
||||||
|
}
|
||||||
|
}
|
48
ProjectLibrary/Forms/FTicket_Extension.cs
Normal file
48
ProjectLibrary/Forms/FTicket_Extension.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ProjectLibrary.Entites;
|
||||||
|
using ProjectLibrary.Entities;
|
||||||
|
|
||||||
|
namespace ProjectLibrary.Forms
|
||||||
|
{
|
||||||
|
public partial class FTicket_Extension : Form
|
||||||
|
{
|
||||||
|
private TicketExtensions _ticketExtensions;
|
||||||
|
|
||||||
|
public FTicket_Extension(TicketExtensions ticketExtensions)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_ticketExtensions = ticketExtensions;
|
||||||
|
LoadTicketExtensionData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadTicketExtensionData()
|
||||||
|
{
|
||||||
|
txtReaderID.Text = _ticketExtensions.ReaderID.ToString();
|
||||||
|
txtExtensionID.Text = _ticketExtensions.ExtensionID.ToString();
|
||||||
|
txtLastUpdateDate.Text = _ticketExtensions.LastUpdateDate.ToShortDateString();
|
||||||
|
txtNextUpdateDate.Text = _ticketExtensions.NextUpdateDate.ToShortDateString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Создание новой сущности с обновленными данными
|
||||||
|
var updatedTicketExtensions = TicketExtensions.CreateEntity(
|
||||||
|
int.Parse(txtReaderID.Text),
|
||||||
|
int.Parse(txtExtensionID.Text),
|
||||||
|
DateTime.Parse(txtLastUpdateDate.Text),
|
||||||
|
DateTime.Parse(txtNextUpdateDate.Text)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Обновление внутренней переменной
|
||||||
|
_ticketExtensions = updatedTicketExtensions;
|
||||||
|
|
||||||
|
MessageBox.Show("Данные успешно сохранены!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCancel_Click_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectLibrary/Forms/FTicket_Extension.resx
Normal file
120
ProjectLibrary/Forms/FTicket_Extension.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>
|
@ -12,4 +12,19 @@
|
|||||||
<PackageReference Include="Unity" Version="5.11.10" />
|
<PackageReference Include="Unity" Version="5.11.10" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<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>
|
73
ProjectLibrary/Properties/Resources.Designer.cs
generated
Normal file
73
ProjectLibrary/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Этот код создан программой.
|
||||||
|
// Исполняемая версия:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||||
|
// повторной генерации кода.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ProjectLibrary.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||||
|
/// </summary>
|
||||||
|
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||||
|
// с помощью такого средства, как ResGen или Visual Studio.
|
||||||
|
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||||
|
// с параметром /str или перестройте свой проект VS.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
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>
|
||||||
|
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||||
|
/// </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("ProjectLibrary.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||||
|
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Снимок_экрана_2024_11_19_132940 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Снимок экрана 2024-11-19 132940", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
124
ProjectLibrary/Properties/Resources.resx
Normal file
124
ProjectLibrary/Properties/Resources.resx
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?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="Снимок экрана 2024-11-19 132940" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Снимок экрана 2024-11-19 132940.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
public interface IBookLibraryRepository
|
public interface IBookLibraryRepository
|
||||||
{
|
{
|
||||||
IEnumerable<BookLibrary> ReadBookLibraries(int? bookId = null, int? libraryId = null);
|
IEnumerable<Book_Library> ReadBookLibraries(int? bookId = null, int? libraryId = null);
|
||||||
void CreateBookLibrary(BookLibrary bookLibrary);
|
void CreateBookLibrary(Book_Library bookLibrary);
|
||||||
void DeleteBookLibrary(int bookId, int libraryId);
|
void DeleteBookLibrary(int bookId, int libraryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
public interface IBookOrdersRepository
|
public interface IBookOrdersRepository
|
||||||
{
|
{
|
||||||
IEnumerable<BookOrders> ReadBookOrders(int? bookId = null, int? orderId = null);
|
IEnumerable<Book_Orders> ReadBookOrders(int? bookId = null, int? orderId = null);
|
||||||
void CreateBookOrder(BookOrders bookOrder);
|
void CreateBookOrder(Book_Orders bookOrder);
|
||||||
void DeleteBookOrder(int bookId, int orderId);
|
void DeleteBookOrder(int bookId, int orderId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ namespace ProjectLibrary.Repositories.Implementations
|
|||||||
public class BookLibraryRepository : IBookLibraryRepository
|
public class BookLibraryRepository : IBookLibraryRepository
|
||||||
{
|
{
|
||||||
// Эмулируем базу данных в виде списка
|
// Эмулируем базу данных в виде списка
|
||||||
private readonly List<BookLibrary> _bookLibraries = new List<BookLibrary>();
|
private readonly List<Book_Library> _bookLibraries = new List<Book_Library>();
|
||||||
|
|
||||||
public void CreateBookLibrary(BookLibrary bookLibrary)
|
public void CreateBookLibrary(Book_Library bookLibrary)
|
||||||
{
|
{
|
||||||
// Логика для добавления связи книги и библиотеки
|
// Логика для добавления связи книги и библиотеки
|
||||||
_bookLibraries.Add(bookLibrary);
|
_bookLibraries.Add(bookLibrary);
|
||||||
@ -27,7 +27,7 @@ namespace ProjectLibrary.Repositories.Implementations
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<BookLibrary> ReadBookLibraries(int? bookId = null, int? libraryId = null)
|
public IEnumerable<Book_Library> ReadBookLibraries(int? bookId = null, int? libraryId = null)
|
||||||
{
|
{
|
||||||
// Логика для получения всех связей книг и библиотек с возможностью фильтрации по bookId и libraryId
|
// Логика для получения всех связей книг и библиотек с возможностью фильтрации по bookId и libraryId
|
||||||
return _bookLibraries.Where(bl =>
|
return _bookLibraries.Where(bl =>
|
||||||
@ -35,7 +35,7 @@ namespace ProjectLibrary.Repositories.Implementations
|
|||||||
(!libraryId.HasValue || bl.LibraryID == libraryId));
|
(!libraryId.HasValue || bl.LibraryID == libraryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateBookLibrary(BookLibrary bookLibrary)
|
public void UpdateBookLibrary(Book_Library bookLibrary)
|
||||||
{
|
{
|
||||||
// Логика для обновления информации о связи книги и библиотеки
|
// Логика для обновления информации о связи книги и библиотеки
|
||||||
var existingBookLibrary = _bookLibraries.FirstOrDefault(bl => bl.BookID == bookLibrary.BookID && bl.LibraryID == bookLibrary.LibraryID);
|
var existingBookLibrary = _bookLibraries.FirstOrDefault(bl => bl.BookID == bookLibrary.BookID && bl.LibraryID == bookLibrary.LibraryID);
|
||||||
|
@ -9,9 +9,9 @@ namespace ProjectLibrary.Repositories.Implementations
|
|||||||
public class BookOrdersRepository : IBookOrdersRepository
|
public class BookOrdersRepository : IBookOrdersRepository
|
||||||
{
|
{
|
||||||
// Эмулируем базу данных в виде списка
|
// Эмулируем базу данных в виде списка
|
||||||
private readonly List<BookOrders> _bookOrders = new List<BookOrders>();
|
private readonly List<Book_Orders> _bookOrders = new List<Book_Orders>();
|
||||||
|
|
||||||
public void CreateBookOrder(BookOrders bookOrder)
|
public void CreateBookOrder(Book_Orders bookOrder)
|
||||||
{
|
{
|
||||||
// Логика для добавления связи книги и заказа
|
// Логика для добавления связи книги и заказа
|
||||||
_bookOrders.Add(bookOrder);
|
_bookOrders.Add(bookOrder);
|
||||||
@ -27,7 +27,7 @@ namespace ProjectLibrary.Repositories.Implementations
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<BookOrders> ReadBookOrders(int? bookId = null, int? orderId = null)
|
public IEnumerable<Book_Orders> ReadBookOrders(int? bookId = null, int? orderId = null)
|
||||||
{
|
{
|
||||||
// Логика для получения всех связей книг и заказов с возможностью фильтрации по bookId и orderId
|
// Логика для получения всех связей книг и заказов с возможностью фильтрации по bookId и orderId
|
||||||
return _bookOrders.Where(bo =>
|
return _bookOrders.Where(bo =>
|
||||||
|
BIN
ProjectLibrary/Resources/Снимок экрана 2024-11-19 132940.png
Normal file
BIN
ProjectLibrary/Resources/Снимок экрана 2024-11-19 132940.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 596 KiB |
Loading…
x
Reference in New Issue
Block a user