2(1/1). Forms created, base logic done

This commit is contained in:
Inna Pruidze 2024-12-20 20:09:17 +04:00
parent f48e29260f
commit 0bd35aa6c1
67 changed files with 7597 additions and 40 deletions

View File

@ -0,0 +1,190 @@
namespace LDBproject.AdditionalForms
{
partial class BookF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
Titlelabel = new Label();
Authorlabel = new Label();
PrintYlabel = new Label();
Genrelabel = new Label();
Statlabel = new Label();
TitleTb = new TextBox();
AuthorTb = new TextBox();
YearNud = new NumericUpDown();
SaveBtn = new Button();
DiscardBtn = new Button();
StatusCbox = new ComboBox();
GenresChBoxList = new CheckedListBox();
((System.ComponentModel.ISupportInitialize)YearNud).BeginInit();
SuspendLayout();
//
// Titlelabel
//
Titlelabel.AutoSize = true;
Titlelabel.Location = new Point(27, 32);
Titlelabel.Name = "Titlelabel";
Titlelabel.Size = new Size(48, 25);
Titlelabel.TabIndex = 1;
Titlelabel.Text = "Title:";
//
// Authorlabel
//
Authorlabel.AutoSize = true;
Authorlabel.Location = new Point(27, 68);
Authorlabel.Name = "Authorlabel";
Authorlabel.Size = new Size(71, 25);
Authorlabel.TabIndex = 2;
Authorlabel.Text = "Author:";
//
// PrintYlabel
//
PrintYlabel.AutoSize = true;
PrintYlabel.Location = new Point(25, 104);
PrintYlabel.Name = "PrintYlabel";
PrintYlabel.Size = new Size(112, 25);
PrintYlabel.TabIndex = 3;
PrintYlabel.Text = "Year of print:";
//
// Genrelabel
//
Genrelabel.AutoSize = true;
Genrelabel.Location = new Point(27, 185);
Genrelabel.Name = "Genrelabel";
Genrelabel.Size = new Size(70, 25);
Genrelabel.TabIndex = 4;
Genrelabel.Text = "Genres:";
//
// Statlabel
//
Statlabel.AutoSize = true;
Statlabel.Location = new Point(27, 147);
Statlabel.Name = "Statlabel";
Statlabel.Size = new Size(126, 25);
Statlabel.TabIndex = 5;
Statlabel.Text = "Current status:";
//
// TitleTb
//
TitleTb.Location = new Point(163, 29);
TitleTb.Name = "TitleTb";
TitleTb.Size = new Size(452, 31);
TitleTb.TabIndex = 7;
//
// AuthorTb
//
AuthorTb.Location = new Point(163, 65);
AuthorTb.Name = "AuthorTb";
AuthorTb.Size = new Size(452, 31);
AuthorTb.TabIndex = 8;
//
// YearNud
//
YearNud.Location = new Point(163, 102);
YearNud.Maximum = new decimal(new int[] { 2025, 0, 0, 0 });
YearNud.Minimum = new decimal(new int[] { 1980, 0, 0, 0 });
YearNud.Name = "YearNud";
YearNud.Size = new Size(127, 31);
YearNud.TabIndex = 9;
YearNud.Value = new decimal(new int[] { 1980, 0, 0, 0 });
//
// SaveBtn
//
SaveBtn.Location = new Point(27, 241);
SaveBtn.Name = "SaveBtn";
SaveBtn.Size = new Size(110, 68);
SaveBtn.TabIndex = 13;
SaveBtn.Text = "Save";
SaveBtn.UseVisualStyleBackColor = true;
SaveBtn.Click += SaveBtn_Click;
//
// DiscardBtn
//
DiscardBtn.Location = new Point(27, 315);
DiscardBtn.Name = "DiscardBtn";
DiscardBtn.Size = new Size(110, 70);
DiscardBtn.TabIndex = 14;
DiscardBtn.Text = "Discard";
DiscardBtn.UseVisualStyleBackColor = true;
DiscardBtn.Click += DiscardBtn_Click;
//
// StatusCbox
//
StatusCbox.FormattingEnabled = true;
StatusCbox.Location = new Point(163, 139);
StatusCbox.Name = "StatusCbox";
StatusCbox.Size = new Size(211, 33);
StatusCbox.TabIndex = 15;
//
// GenresChBoxList
//
GenresChBoxList.FormattingEnabled = true;
GenresChBoxList.Location = new Point(163, 185);
GenresChBoxList.Name = "GenresChBoxList";
GenresChBoxList.Size = new Size(211, 200);
GenresChBoxList.TabIndex = 16;
//
// BookF
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(647, 412);
Controls.Add(GenresChBoxList);
Controls.Add(StatusCbox);
Controls.Add(DiscardBtn);
Controls.Add(SaveBtn);
Controls.Add(YearNud);
Controls.Add(AuthorTb);
Controls.Add(TitleTb);
Controls.Add(Statlabel);
Controls.Add(Genrelabel);
Controls.Add(PrintYlabel);
Controls.Add(Authorlabel);
Controls.Add(Titlelabel);
Name = "BookF";
Text = "Book";
((System.ComponentModel.ISupportInitialize)YearNud).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label Titlelabel;
private Label Authorlabel;
private Label PrintYlabel;
private Label Genrelabel;
private Label Statlabel;
private TextBox IDtb;
private TextBox TitleTb;
private TextBox AuthorTb;
private NumericUpDown YearNud;
private Button SaveBtn;
private Button DiscardBtn;
private ComboBox StatusCbox;
private CheckedListBox GenresChBoxList;
}
}

View File

@ -0,0 +1,60 @@
namespace LDBproject.AdditionalForms;
public partial class BookF : Form
{
private int? _bookID;
public BookF()
{
InitializeComponent();
}
public int ID
{
set
{
try
{
_bookID = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "BookF [ Error : wrong data ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
private void SaveBtn_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(TitleTb.Text)
|| GenresChBoxList.CheckedItems.Count == 0
|| StatusCbox.SelectedIndex < 1)
{
throw new Exception("BookF [ Blank spaces were left, not enough information ]");
}
if (_bookID.HasValue)
{
}
else
{
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "BookF [ Error : while saving ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DiscardBtn_Click(object sender, EventArgs e) => Close();
private object CreateBook(int id) { return null; }
}

View 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>

View File

@ -0,0 +1,134 @@
namespace LDBproject.AdditionalForms
{
partial class BookListF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
PanelWithOperations = new Panel();
DelBtn = new Button();
AddBtn = new Button();
UpdBtn = new Button();
DataGV = new DataGridView();
PanelWithOperations.SuspendLayout();
((System.ComponentModel.ISupportInitialize)DataGV).BeginInit();
SuspendLayout();
//
// PanelWithOperations
//
PanelWithOperations.BackColor = Color.Transparent;
PanelWithOperations.Controls.Add(DelBtn);
PanelWithOperations.Controls.Add(AddBtn);
PanelWithOperations.Controls.Add(UpdBtn);
PanelWithOperations.Dock = DockStyle.Right;
PanelWithOperations.Location = new Point(623, 0);
PanelWithOperations.Name = "PanelWithOperations";
PanelWithOperations.Size = new Size(154, 396);
PanelWithOperations.TabIndex = 0;
//
// DelBtn
//
DelBtn.BackColor = Color.DarkSlateBlue;
DelBtn.BackgroundImage = Properties.Resources.DelImg;
DelBtn.BackgroundImageLayout = ImageLayout.Stretch;
DelBtn.ForeColor = Color.Transparent;
DelBtn.Location = new Point(23, 207);
DelBtn.Name = "DelBtn";
DelBtn.Size = new Size(78, 71);
DelBtn.TabIndex = 4;
DelBtn.UseVisualStyleBackColor = false;
DelBtn.Click += DelBtn_Click;
//
// AddBtn
//
AddBtn.BackColor = Color.DarkSlateBlue;
AddBtn.BackgroundImage = Properties.Resources.AddImg;
AddBtn.BackgroundImageLayout = ImageLayout.Stretch;
AddBtn.ForeColor = Color.Transparent;
AddBtn.Location = new Point(23, 53);
AddBtn.Name = "AddBtn";
AddBtn.Size = new Size(78, 71);
AddBtn.TabIndex = 3;
AddBtn.UseVisualStyleBackColor = false;
AddBtn.Click += AddBtn_Click;
//
// UpdBtn
//
UpdBtn.BackColor = Color.DarkSlateBlue;
UpdBtn.BackgroundImage = Properties.Resources.OperationImg;
UpdBtn.BackgroundImageLayout = ImageLayout.Stretch;
UpdBtn.ForeColor = Color.Transparent;
UpdBtn.Location = new Point(23, 130);
UpdBtn.Name = "UpdBtn";
UpdBtn.Size = new Size(78, 71);
UpdBtn.TabIndex = 1;
UpdBtn.UseVisualStyleBackColor = false;
UpdBtn.Click += UpdBtn_Click;
//
// DataGV
//
DataGV.AllowUserToResizeColumns = false;
DataGV.AllowUserToResizeRows = false;
DataGV.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
DataGV.BackgroundColor = Color.DarkSlateBlue;
DataGV.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
DataGV.GridColor = Color.GreenYellow;
DataGV.Location = new Point(25, 101);
DataGV.Name = "DataGV";
DataGV.RowHeadersVisible = false;
DataGV.RowHeadersWidth = 62;
DataGV.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
DataGV.Size = new Size(583, 259);
DataGV.TabIndex = 1;
//
// BookListF
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources.BookListFrameCover;
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(777, 396);
Controls.Add(DataGV);
Controls.Add(PanelWithOperations);
DoubleBuffered = true;
Name = "BookListF";
StartPosition = FormStartPosition.CenterParent;
Text = "BookListF";
Load += BookListF_Load;
PanelWithOperations.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)DataGV).EndInit();
ResumeLayout(false);
}
#endregion
private Panel PanelWithOperations;
private Button AddBtn;
private Button UpdBtn;
private Button DelBtn;
private DataGridView DataGV;
}
}

View File

@ -0,0 +1,96 @@
using Unity;
namespace LDBproject.AdditionalForms;
public partial class BookListF : Form
{
private readonly IUnityContainer _container;
public BookListF(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void BookListF_Load(object sender, EventArgs e)
{
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Book List Form [ Error while saving ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void AddBtn_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<BookF>().ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Book List Form [ Error while adding element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DelBtn_Click(object sender, EventArgs e)
{
if (!GetIDFromRow(out var foundID))
{
return;
}
if (MessageBox.Show("Remove element?", "Deleting", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Book List Form [ Error while removing element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ReloadList() { }
private bool GetIDFromRow(out int id)
{
id = 0;
if (DataGV.SelectedRows.Count < 1)
{
MessageBox.Show("[ Error : Book doesn't exist ]", "<ERROR>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
id = Convert.ToInt32(DataGV.SelectedRows[0].Cells["BookID"].Value);
return true;
}
private void UpdBtn_Click(object sender, EventArgs e)
{
if (!GetIDFromRow(out var findID))
{
return;
}
try
{
var form = _container.Resolve<BookF>();
form.ID = findID;
form.ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Book List Form [ Error while updating element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}

View 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>

View File

@ -0,0 +1,131 @@
namespace LDBproject.AdditionalForms
{
partial class CustomerF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
CancelBtn = new Button();
SaveBtn = new Button();
FIOEnterTb = new TextBox();
FullNameLabel = new Label();
BDlabel = new Label();
BirthdayDTPicker = new DateTimePicker();
SuspendLayout();
//
// CancelBtn
//
CancelBtn.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
CancelBtn.ForeColor = Color.DarkSlateBlue;
CancelBtn.Location = new Point(495, 70);
CancelBtn.Name = "CancelBtn";
CancelBtn.Size = new Size(102, 34);
CancelBtn.TabIndex = 8;
CancelBtn.Text = "Cancel";
CancelBtn.UseVisualStyleBackColor = true;
CancelBtn.Click += CancelBtn_Click;
//
// SaveBtn
//
SaveBtn.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
SaveBtn.ForeColor = Color.DarkSlateBlue;
SaveBtn.Location = new Point(404, 70);
SaveBtn.Name = "SaveBtn";
SaveBtn.Size = new Size(81, 34);
SaveBtn.TabIndex = 7;
SaveBtn.Text = "Save";
SaveBtn.UseVisualStyleBackColor = true;
SaveBtn.Click += SaveBtn_Click;
//
// FIOEnterTb
//
FIOEnterTb.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
FIOEnterTb.ForeColor = Color.MidnightBlue;
FIOEnterTb.Location = new Point(173, 27);
FIOEnterTb.Name = "FIOEnterTb";
FIOEnterTb.Size = new Size(424, 31);
FIOEnterTb.TabIndex = 6;
//
// FullNameLabel
//
FullNameLabel.AutoSize = true;
FullNameLabel.Location = new Point(29, 30);
FullNameLabel.Name = "FullNameLabel";
FullNameLabel.Size = new Size(138, 25);
FullNameLabel.TabIndex = 9;
FullNameLabel.Text = "Full Name (FIO):";
//
// BDlabel
//
BDlabel.AutoSize = true;
BDlabel.Location = new Point(29, 75);
BDlabel.Name = "BDlabel";
BDlabel.Size = new Size(159, 25);
BDlabel.TabIndex = 10;
BDlabel.Text = "Birth day and year:";
//
// BirthdayDTPicker
//
BirthdayDTPicker.CalendarForeColor = Color.GreenYellow;
BirthdayDTPicker.CalendarMonthBackground = Color.DarkSlateBlue;
BirthdayDTPicker.CalendarTitleBackColor = Color.MidnightBlue;
BirthdayDTPicker.CalendarTitleForeColor = Color.DarkSlateBlue;
BirthdayDTPicker.CalendarTrailingForeColor = Color.GreenYellow;
BirthdayDTPicker.Location = new Point(194, 73);
BirthdayDTPicker.Name = "BirthdayDTPicker";
BirthdayDTPicker.Size = new Size(193, 31);
BirthdayDTPicker.TabIndex = 12;
BirthdayDTPicker.Value = new DateTime(2024, 11, 15, 12, 40, 0, 0);
//
// CustomerF
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.DarkSlateBlue;
ClientSize = new Size(631, 130);
Controls.Add(BirthdayDTPicker);
Controls.Add(BDlabel);
Controls.Add(FullNameLabel);
Controls.Add(CancelBtn);
Controls.Add(SaveBtn);
Controls.Add(FIOEnterTb);
ForeColor = Color.GreenYellow;
Name = "CustomerF";
Text = "CustomerF";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button CancelBtn;
private Button SaveBtn;
private TextBox FIOEnterTb;
private Label FullNameLabel;
private Label BDlabel;
private DateTimePicker BirthdayDTPicker;
}
}

View File

@ -0,0 +1,59 @@
namespace LDBproject.AdditionalForms;
public partial class CustomerF : Form
{
private int? _custID;
public CustomerF()
{
InitializeComponent();
}
public int ID
{
set
{
try
{
_custID = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "CustomerF [ Error : wrong data ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
private void SaveBtn_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(FIOEnterTb.Text)
|| BirthdayDTPicker.Value.Year < 1940)
{
throw new Exception("CustomerF [ Blank spaces were left, not enough information ]");
}
if (_custID.HasValue)
{
}
else
{
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "CustomerF [ Error : while saving ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void CancelBtn_Click(object sender, EventArgs e) => Close();
private object CreateCustomer(int id) { return null; }
}

View 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>

View File

@ -0,0 +1,132 @@
namespace LDBproject.AdditionalForms
{
partial class CustomerListF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
panel1 = new Panel();
DelBtn = new Button();
UpdBtn = new Button();
AddBtn = new Button();
DataGV = new DataGridView();
panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)DataGV).BeginInit();
SuspendLayout();
//
// panel1
//
panel1.BackColor = Color.Transparent;
panel1.Controls.Add(DelBtn);
panel1.Controls.Add(UpdBtn);
panel1.Controls.Add(AddBtn);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(603, 0);
panel1.Name = "panel1";
panel1.Size = new Size(163, 404);
panel1.TabIndex = 3;
//
// -
//
//
// DelBtn
//
DelBtn.BackColor = Color.DarkSlateBlue;
DelBtn.BackgroundImage = Properties.Resources.DelImg;
DelBtn.BackgroundImageLayout = ImageLayout.Stretch;
DelBtn.ForeColor = Color.Transparent;
DelBtn.Location = new Point(27, 218);
DelBtn.Name = "DelBtn";
DelBtn.Size = new Size(78, 71);
DelBtn.TabIndex = 6;
DelBtn.UseVisualStyleBackColor = false;
DelBtn.Click += DelBtn_Click;
//
// UpdBtn
//
UpdBtn.BackColor = Color.DarkSlateBlue;
UpdBtn.BackgroundImage = Properties.Resources.OperationImg;
UpdBtn.BackgroundImageLayout = ImageLayout.Stretch;
UpdBtn.ForeColor = Color.Transparent;
UpdBtn.Location = new Point(27, 141);
UpdBtn.Name = "UpdBtn";
UpdBtn.Size = new Size(78, 71);
UpdBtn.TabIndex = 5;
UpdBtn.UseVisualStyleBackColor = false;
UpdBtn.Click += UpdBtn_Click;
//
// AddBtn
//
AddBtn.BackColor = Color.DarkSlateBlue;
AddBtn.BackgroundImage = Properties.Resources.AddImg;
AddBtn.BackgroundImageLayout = ImageLayout.Stretch;
AddBtn.ForeColor = Color.Transparent;
AddBtn.Location = new Point(27, 64);
AddBtn.Name = "AddBtn";
AddBtn.Size = new Size(78, 71);
AddBtn.TabIndex = 4;
AddBtn.UseVisualStyleBackColor = false;
AddBtn.Click += AddBtn_Click;
//
// DataGV
//
DataGV.BackgroundColor = Color.DarkSlateBlue;
DataGV.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
DataGV.GridColor = Color.GreenYellow;
DataGV.Location = new Point(15, 100);
DataGV.Name = "DataGV";
DataGV.RowHeadersWidth = 62;
DataGV.Size = new Size(550, 273);
DataGV.TabIndex = 2;
//
// CustomerListF
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources.ReadersFrameCover;
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(766, 404);
Controls.Add(panel1);
Controls.Add(DataGV);
DoubleBuffered = true;
Name = "CustomerListF";
Text = "CustomerListF";
Load += CustomerListF_Load;
panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)DataGV).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panel1;
private Button DelBtn;
private Button UpdBtn;
private Button AddBtn;
private DataGridView DataGV;
}
}

View File

@ -0,0 +1,97 @@
using Unity;
namespace LDBproject.AdditionalForms;
public partial class CustomerListF : Form
{
private readonly IUnityContainer _container;
public CustomerListF(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void CustomerListF_Load(object sender, EventArgs e)
{
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Customer List Form [ Error while saving ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void AddBtn_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<CustomerF>().ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Customer List Form [ Error while adding element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DelBtn_Click(object sender, EventArgs e)
{
if (!GetIDFromRow(out var foundID))
{
return;
}
if (MessageBox.Show("Remove element?", "Deleting", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Customer List Form [ Error while removing element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ReloadList() { }
private bool GetIDFromRow(out int id)
{
id = 0;
if (DataGV.SelectedRows.Count < 1)
{
MessageBox.Show("[ Error : Customer doesn't exist ]", "<ERROR>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
id = Convert.ToInt32(DataGV.SelectedRows[0].Cells["CardID"].Value);
return true;
}
private void UpdBtn_Click(object sender, EventArgs e)
{
if (!GetIDFromRow(out var findID))
{
return;
}
try
{
var form = _container.Resolve<CustomerF>();
form.ID = findID;
form.ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Customer List Form [ Error while updating element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}

View 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>

View File

@ -0,0 +1,129 @@
namespace LDBproject.AdditionalForms
{
partial class EmployeeF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
FullNameLabel = new Label();
FIOEnterTb = new TextBox();
GenreLabel = new Label();
SaveBtn = new Button();
CancelBtn = new Button();
GenresCheckedBL = new CheckedListBox();
SuspendLayout();
//
// FullNameLabel
//
FullNameLabel.AutoSize = true;
FullNameLabel.Location = new Point(23, 25);
FullNameLabel.Name = "FullNameLabel";
FullNameLabel.Size = new Size(138, 25);
FullNameLabel.TabIndex = 0;
FullNameLabel.Text = "Full Name (FIO):";
//
// FIOEnterTb
//
FIOEnterTb.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
FIOEnterTb.ForeColor = Color.MidnightBlue;
FIOEnterTb.Location = new Point(167, 22);
FIOEnterTb.Name = "FIOEnterTb";
FIOEnterTb.Size = new Size(456, 31);
FIOEnterTb.TabIndex = 1;
//
// GenreLabel
//
GenreLabel.AutoSize = true;
GenreLabel.Location = new Point(23, 77);
GenreLabel.Name = "GenreLabel";
GenreLabel.Size = new Size(70, 25);
GenreLabel.TabIndex = 2;
GenreLabel.Text = "Genres:";
//
// SaveBtn
//
SaveBtn.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
SaveBtn.ForeColor = Color.DarkSlateBlue;
SaveBtn.Location = new Point(379, 131);
SaveBtn.Name = "SaveBtn";
SaveBtn.Size = new Size(112, 34);
SaveBtn.TabIndex = 4;
SaveBtn.Text = "Save";
SaveBtn.UseVisualStyleBackColor = true;
SaveBtn.Click += SaveBtn_Click;
//
// CancelBtn
//
CancelBtn.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
CancelBtn.ForeColor = Color.DarkSlateBlue;
CancelBtn.Location = new Point(497, 131);
CancelBtn.Name = "CancelBtn";
CancelBtn.Size = new Size(126, 34);
CancelBtn.TabIndex = 5;
CancelBtn.Text = "Cancel";
CancelBtn.UseVisualStyleBackColor = true;
CancelBtn.Click += CancelBtn_Click;
//
// GenresCheckedBL
//
GenresCheckedBL.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
GenresCheckedBL.ForeColor = Color.MidnightBlue;
GenresCheckedBL.FormattingEnabled = true;
GenresCheckedBL.Location = new Point(99, 77);
GenresCheckedBL.Name = "GenresCheckedBL";
GenresCheckedBL.Size = new Size(251, 88);
GenresCheckedBL.TabIndex = 7;
//
// EmployeeF
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.DarkSlateBlue;
ClientSize = new Size(653, 191);
Controls.Add(GenresCheckedBL);
Controls.Add(CancelBtn);
Controls.Add(SaveBtn);
Controls.Add(GenreLabel);
Controls.Add(FIOEnterTb);
Controls.Add(FullNameLabel);
ForeColor = Color.GreenYellow;
Name = "EmployeeF";
Text = "EmployeeF";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label FullNameLabel;
private TextBox FIOEnterTb;
private Label GenreLabel;
private Button SaveBtn;
private Button CancelBtn;
private ComboBox GenreCbox;
private CheckedListBox GenresCheckedBL;
}
}

View File

@ -0,0 +1,59 @@
namespace LDBproject.AdditionalForms;
public partial class EmployeeF : Form
{
private int? _librarianID;
public EmployeeF()
{
InitializeComponent();
}
public int ID
{
set
{
try
{
_librarianID = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "EmployeeF [ Error : while setting ID ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
private void SaveBtn_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(FIOEnterTb.Text)
|| GenresCheckedBL.CheckedItems.Count == 0)
{
throw new Exception("EmployeeF [ Blank spaces were left, not enough information ]");
}
if (_librarianID.HasValue)
{
}
else
{
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "EmployeeF [ Error : while saving data ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void CancelBtn_Click(object sender, EventArgs e) => Close();
private object CreateWorker(int id) { return null; }
}

View 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>

View File

@ -0,0 +1,128 @@
namespace LDBproject.AdditionalForms
{
partial class EmployeesF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
DataGV = new DataGridView();
panel1 = new Panel();
DelBtn = new Button();
UpdBtn = new Button();
AddBtn = new Button();
((System.ComponentModel.ISupportInitialize)DataGV).BeginInit();
panel1.SuspendLayout();
SuspendLayout();
//
// DataGV
//
DataGV.BackgroundColor = Color.DarkSlateBlue;
DataGV.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
DataGV.GridColor = Color.GreenYellow;
DataGV.Location = new Point(30, 100);
DataGV.Name = "DataGV";
DataGV.RowHeadersWidth = 62;
DataGV.Size = new Size(550, 273);
DataGV.TabIndex = 0;
//
// panel1
//
panel1.BackColor = Color.Transparent;
panel1.Controls.Add(DelBtn);
panel1.Controls.Add(UpdBtn);
panel1.Controls.Add(AddBtn);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(586, 0);
panel1.Name = "panel1";
panel1.Size = new Size(163, 407);
panel1.TabIndex = 1;
//
// DelBtn
//
DelBtn.BackColor = Color.DarkSlateBlue;
DelBtn.BackgroundImage = Properties.Resources.DelImg;
DelBtn.BackgroundImageLayout = ImageLayout.Stretch;
DelBtn.ForeColor = Color.Transparent;
DelBtn.Location = new Point(27, 218);
DelBtn.Name = "DelBtn";
DelBtn.Size = new Size(78, 71);
DelBtn.TabIndex = 6;
DelBtn.UseVisualStyleBackColor = false;
DelBtn.Click += DelBtn_Click;
//
// UpdBtn
//
UpdBtn.BackColor = Color.DarkSlateBlue;
UpdBtn.BackgroundImage = Properties.Resources.OperationImg;
UpdBtn.BackgroundImageLayout = ImageLayout.Stretch;
UpdBtn.ForeColor = Color.Transparent;
UpdBtn.Location = new Point(27, 141);
UpdBtn.Name = "UpdBtn";
UpdBtn.Size = new Size(78, 71);
UpdBtn.TabIndex = 5;
UpdBtn.UseVisualStyleBackColor = false;
UpdBtn.Click += UpdBtn_Click;
//
// AddBtn
//
AddBtn.BackColor = Color.DarkSlateBlue;
AddBtn.BackgroundImage = Properties.Resources.AddImg;
AddBtn.BackgroundImageLayout = ImageLayout.Stretch;
AddBtn.ForeColor = Color.Transparent;
AddBtn.Location = new Point(27, 64);
AddBtn.Name = "AddBtn";
AddBtn.Size = new Size(78, 71);
AddBtn.TabIndex = 4;
AddBtn.UseVisualStyleBackColor = false;
AddBtn.Click += AddBtn_Click;
//
// EmployeesF
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources.EmployeesFrameCover;
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(749, 407);
Controls.Add(panel1);
Controls.Add(DataGV);
DoubleBuffered = true;
Name = "EmployeesF";
Text = "EmployeesF";
Load += EmployeesF_Load;
((System.ComponentModel.ISupportInitialize)DataGV).EndInit();
panel1.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView DataGV;
private Panel panel1;
private Button AddBtn;
private Button UpdBtn;
private Button DelBtn;
}
}

View File

@ -0,0 +1,97 @@
using Unity;
namespace LDBproject.AdditionalForms;
public partial class EmployeesF : Form
{
private readonly IUnityContainer _container;
public EmployeesF(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void EmployeesF_Load(object sender, EventArgs e)
{
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while saving ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void AddBtn_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<EmployeeF>().ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while adding element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void UpdBtn_Click(object sender, EventArgs e)
{
if (!GetiDFromRow(out var findID))
{
return;
}
try
{
var form = _container.Resolve<EmployeeF>();
form.ID = findID;
form.ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while updating element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DelBtn_Click(object sender, EventArgs e)
{
if (!GetiDFromRow(out var foundID))
{
return;
}
if (MessageBox.Show("Remove element?", "Deleting", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while removing element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ReloadList() { }
private bool GetiDFromRow(out int id)
{
id = 0;
if (DataGV.SelectedRows.Count < 1)
{
MessageBox.Show("[ Error : element doesn't exist ]", "<ERROR>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
id = Convert.ToInt32(DataGV.SelectedRows[0].Cells["CardID"].Value);
return true;
}
}

View 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>

View File

@ -0,0 +1,112 @@
namespace LDBproject.AdditionalForms
{
partial class OrderRegistrations
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
panel1 = new Panel();
DelBtn = new Button();
AddBtn = new Button();
DataGV = new DataGridView();
panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)DataGV).BeginInit();
SuspendLayout();
//
// panel1
//
panel1.BackColor = Color.Transparent;
panel1.Controls.Add(DelBtn);
panel1.Controls.Add(AddBtn);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(430, 0);
panel1.Name = "panel1";
panel1.Size = new Size(246, 364);
panel1.TabIndex = 4;
//
// DelBtn
//
DelBtn.BackColor = Color.DarkSlateBlue;
DelBtn.BackgroundImage = Properties.Resources.DelImg;
DelBtn.BackgroundImageLayout = ImageLayout.Stretch;
DelBtn.ForeColor = Color.Transparent;
DelBtn.Location = new Point(129, 34);
DelBtn.Name = "DelBtn";
DelBtn.Size = new Size(78, 71);
DelBtn.TabIndex = 6;
DelBtn.UseVisualStyleBackColor = false;
DelBtn.Click += DelBtn_Click;
//
// AddBtn
//
AddBtn.BackColor = Color.DarkSlateBlue;
AddBtn.BackgroundImage = Properties.Resources.AddImg;
AddBtn.BackgroundImageLayout = ImageLayout.Stretch;
AddBtn.ForeColor = Color.Transparent;
AddBtn.Location = new Point(24, 34);
AddBtn.Name = "AddBtn";
AddBtn.Size = new Size(78, 71);
AddBtn.TabIndex = 4;
AddBtn.UseVisualStyleBackColor = false;
AddBtn.Click += AddBtn_Click;
//
// DataGV
//
DataGV.BackgroundColor = Color.DarkSlateBlue;
DataGV.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
DataGV.GridColor = Color.GreenYellow;
DataGV.Location = new Point(28, 86);
DataGV.Name = "DataGV";
DataGV.RowHeadersWidth = 62;
DataGV.Size = new Size(357, 245);
DataGV.TabIndex = 5;
//
// OrderRegistrations
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources.RegistrationsFrameCover;
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(676, 364);
Controls.Add(DataGV);
Controls.Add(panel1);
DoubleBuffered = true;
Name = "OrderRegistrations";
Text = "OrderRegistrations";
Load += RegistrationsF_Load;
panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)DataGV).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panel1;
private Button DelBtn;
private Button AddBtn;
private DataGridView DataGV;
}
}

View File

@ -0,0 +1,78 @@
using Unity;
namespace LDBproject.AdditionalForms;
public partial class OrderRegistrations : Form
{
private readonly IUnityContainer _container;
public OrderRegistrations(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void RegistrationsF_Load(object sender, EventArgs e)
{
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while saving ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void AddBtn_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<RegOrder>().ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while adding element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DelBtn_Click(object sender, EventArgs e)
{
if (!GetIDFromRow(out var foundID))
{
return;
}
if (MessageBox.Show("Remove element?", "Deleting", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while removing element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ReloadList() { }
private bool GetIDFromRow(out int id)
{
id = 0;
if (DataGV.SelectedRows.Count < 1)
{
MessageBox.Show("[ Error : element doesn't exist ]", "<ERROR>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
id = Convert.ToInt32(DataGV.SelectedRows[0].Cells["OrderID"].Value);
return true;
}
}

View 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>

View File

@ -0,0 +1,188 @@
namespace LDBproject.AdditionalForms
{
partial class RegOrder
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
LibrarianCBox = new ComboBox();
LibLabel = new Label();
DateLabel = new Label();
ReturnDTPicker = new DateTimePicker();
groupBox1 = new GroupBox();
DataGV = new DataGridView();
BookColumnCBox = new DataGridViewComboBoxColumn();
AuthorColumn = new DataGridViewTextBoxColumn();
SaveBtn = new Button();
BackBtn = new Button();
ReaderLabel = new Label();
CardCBox = new ComboBox();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)DataGV).BeginInit();
SuspendLayout();
//
// LibrarianCBox
//
LibrarianCBox.FormattingEnabled = true;
LibrarianCBox.Location = new Point(119, 21);
LibrarianCBox.Name = "LibrarianCBox";
LibrarianCBox.Size = new Size(182, 33);
LibrarianCBox.TabIndex = 0;
//
// LibLabel
//
LibLabel.AutoSize = true;
LibLabel.Location = new Point(30, 24);
LibLabel.Name = "LibLabel";
LibLabel.Size = new Size(83, 25);
LibLabel.TabIndex = 1;
LibLabel.Text = "Librarian:";
//
// DateLabel
//
DateLabel.AutoSize = true;
DateLabel.Location = new Point(30, 128);
DateLabel.Name = "DateLabel";
DateLabel.Size = new Size(107, 25);
DateLabel.TabIndex = 2;
DateLabel.Text = "Return date:";
//
// ReturnDTPicker
//
ReturnDTPicker.Location = new Point(37, 163);
ReturnDTPicker.Name = "ReturnDTPicker";
ReturnDTPicker.Size = new Size(264, 31);
ReturnDTPicker.TabIndex = 3;
//
// groupBox1
//
groupBox1.Controls.Add(DataGV);
groupBox1.Location = new Point(334, 24);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(423, 266);
groupBox1.TabIndex = 4;
groupBox1.TabStop = false;
groupBox1.Text = "BookListGBox";
//
// DataGV
//
DataGV.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
DataGV.Columns.AddRange(new DataGridViewColumn[] { BookColumnCBox, AuthorColumn });
DataGV.Location = new Point(6, 41);
DataGV.Name = "DataGV";
DataGV.RowHeadersWidth = 62;
DataGV.Size = new Size(411, 206);
DataGV.TabIndex = 0;
//
// BookColumnCBox
//
BookColumnCBox.HeaderText = "Book's title";
BookColumnCBox.MinimumWidth = 8;
BookColumnCBox.Name = "BookColumnCBox";
BookColumnCBox.Width = 150;
//
// AuthorColumn
//
AuthorColumn.HeaderText = "Author";
AuthorColumn.MinimumWidth = 8;
AuthorColumn.Name = "AuthorColumn";
AuthorColumn.Width = 150;
//
// SaveBtn
//
SaveBtn.Location = new Point(37, 216);
SaveBtn.Name = "SaveBtn";
SaveBtn.Size = new Size(264, 34);
SaveBtn.TabIndex = 5;
SaveBtn.Text = "Save and give out";
SaveBtn.UseVisualStyleBackColor = true;
SaveBtn.Click += SaveBtn_Click;
//
// BackBtn
//
BackBtn.Location = new Point(37, 256);
BackBtn.Name = "BackBtn";
BackBtn.Size = new Size(264, 34);
BackBtn.TabIndex = 6;
BackBtn.Text = "Go back";
BackBtn.UseVisualStyleBackColor = true;
BackBtn.Click += BackBtn_Click;
//
// ReaderLabel
//
ReaderLabel.AutoSize = true;
ReaderLabel.Location = new Point(30, 65);
ReaderLabel.Name = "ReaderLabel";
ReaderLabel.Size = new Size(66, 50);
ReaderLabel.TabIndex = 7;
ReaderLabel.Text = "Reader\r\ncard:";
//
// CardCBox
//
CardCBox.FormattingEnabled = true;
CardCBox.Location = new Point(119, 82);
CardCBox.Name = "CardCBox";
CardCBox.Size = new Size(182, 33);
CardCBox.TabIndex = 8;
//
// RegOrder
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(785, 314);
Controls.Add(CardCBox);
Controls.Add(ReaderLabel);
Controls.Add(BackBtn);
Controls.Add(SaveBtn);
Controls.Add(groupBox1);
Controls.Add(ReturnDTPicker);
Controls.Add(DateLabel);
Controls.Add(LibLabel);
Controls.Add(LibrarianCBox);
Name = "RegOrder";
Text = "RegOrder";
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)DataGV).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private ComboBox LibrarianCBox;
private Label LibLabel;
private Label DateLabel;
private DateTimePicker ReturnDTPicker;
private GroupBox groupBox1;
private DataGridView DataGV;
private Button SaveBtn;
private Button BackBtn;
private Label ReaderLabel;
private ComboBox CardCBox;
private DataGridViewComboBoxColumn BookColumnCBox;
private DataGridViewTextBoxColumn AuthorColumn;
}
}

View File

@ -0,0 +1,50 @@
namespace LDBproject.AdditionalForms;
public partial class RegOrder : Form
{
public RegOrder()
{
InitializeComponent();
LibrarianCBox.DisplayMember = "FIO";
LibrarianCBox.ValueMember = "CardID";
CardCBox.DisplayMember = "FIO";
CardCBox.ValueMember = "CardID";
BookColumnCBox.DisplayMember = "Title";
BookColumnCBox.ValueMember = "BookID";
}
private void SaveBtn_Click(object sender, EventArgs e)
{
try
{
if (DataGV.RowCount < 1 || LibrarianCBox.SelectedIndex < 0)
{
throw new Exception("[ Blanck space left ]");
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Saving error ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void BackBtn_Click(object sender, EventArgs e) => Close();
private List<object> CreateBookListFromDG()
{
var list = new List<object>();
foreach (DataGridViewRow row in DataGV.Rows)
{
if (row.Cells["BookColumn"].Value == null)
{
continue;
}
}
return list;
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="BookColumnCBox.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="AuthorColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,198 @@
namespace LDBproject.AdditionalForms
{
partial class UpdateF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
LibLabel = new Label();
LibrarianCBox = new ComboBox();
LastUpdLabel = new Label();
NextUpdLabel = new Label();
UpdDTPicker = new DateTimePicker();
NextUpdDTPicker = new DateTimePicker();
ConfirmBtn = new Button();
CancelBtn = new Button();
CardCBox = new ComboBox();
CardLbl = new Label();
NoteTb = new TextBox();
NoteLbl = new Label();
SuspendLayout();
//
// LibLabel
//
LibLabel.AutoSize = true;
LibLabel.Location = new Point(27, 91);
LibLabel.Margin = new Padding(4, 0, 4, 0);
LibLabel.Name = "LibLabel";
LibLabel.Size = new Size(118, 32);
LibLabel.TabIndex = 0;
LibLabel.Text = "By whom:";
//
// LibrarianCBox
//
LibrarianCBox.FormattingEnabled = true;
LibrarianCBox.Location = new Point(152, 87);
LibrarianCBox.Margin = new Padding(4, 4, 4, 4);
LibrarianCBox.Name = "LibrarianCBox";
LibrarianCBox.Size = new Size(515, 40);
LibrarianCBox.TabIndex = 1;
//
// LastUpdLabel
//
LastUpdLabel.AutoSize = true;
LastUpdLabel.Location = new Point(27, 213);
LastUpdLabel.Margin = new Padding(4, 0, 4, 0);
LastUpdLabel.Name = "LastUpdLabel";
LastUpdLabel.Size = new Size(74, 32);
LastUpdLabel.TabIndex = 2;
LastUpdLabel.Text = "From:";
//
// NextUpdLabel
//
NextUpdLabel.AutoSize = true;
NextUpdLabel.Location = new Point(27, 266);
NextUpdLabel.Margin = new Padding(4, 0, 4, 0);
NextUpdLabel.Name = "NextUpdLabel";
NextUpdLabel.Size = new Size(50, 32);
NextUpdLabel.TabIndex = 3;
NextUpdLabel.Text = "Till:";
//
// UpdDTPicker
//
UpdDTPicker.Location = new Point(110, 213);
UpdDTPicker.Margin = new Padding(4, 4, 4, 4);
UpdDTPicker.Name = "UpdDTPicker";
UpdDTPicker.Size = new Size(389, 39);
UpdDTPicker.TabIndex = 4;
//
// NextUpdDTPicker
//
NextUpdDTPicker.Location = new Point(110, 266);
NextUpdDTPicker.Margin = new Padding(4, 4, 4, 4);
NextUpdDTPicker.Name = "NextUpdDTPicker";
NextUpdDTPicker.Size = new Size(389, 39);
NextUpdDTPicker.TabIndex = 5;
//
// ConfirmBtn
//
ConfirmBtn.Location = new Point(523, 213);
ConfirmBtn.Margin = new Padding(4, 4, 4, 4);
ConfirmBtn.Name = "ConfirmBtn";
ConfirmBtn.Size = new Size(146, 44);
ConfirmBtn.TabIndex = 6;
ConfirmBtn.Text = "Confirm";
ConfirmBtn.UseVisualStyleBackColor = true;
ConfirmBtn.Click += ConfirmBtn_Click;
//
// CancelBtn
//
CancelBtn.Location = new Point(523, 266);
CancelBtn.Margin = new Padding(4, 4, 4, 4);
CancelBtn.Name = "CancelBtn";
CancelBtn.Size = new Size(146, 44);
CancelBtn.TabIndex = 7;
CancelBtn.Text = "Cancel";
CancelBtn.UseVisualStyleBackColor = true;
CancelBtn.Click += CancelBtn_Click;
//
// CardCBox
//
CardCBox.FormattingEnabled = true;
CardCBox.Location = new Point(222, 26);
CardCBox.Margin = new Padding(4, 4, 4, 4);
CardCBox.Name = "CardCBox";
CardCBox.Size = new Size(445, 40);
CardCBox.TabIndex = 9;
//
// CardLbl
//
CardLbl.AutoSize = true;
CardLbl.Location = new Point(27, 29);
CardLbl.Margin = new Padding(4, 0, 4, 0);
CardLbl.Name = "CardLbl";
CardLbl.Size = new Size(188, 32);
CardLbl.TabIndex = 8;
CardLbl.Text = "Card to prolong:";
//
// NoteTb
//
NoteTb.Location = new Point(110, 150);
NoteTb.Margin = new Padding(4);
NoteTb.Name = "NoteTb";
NoteTb.Size = new Size(557, 39);
NoteTb.TabIndex = 10;
//
// NoteLbl
//
NoteLbl.AutoSize = true;
NoteLbl.Location = new Point(27, 152);
NoteLbl.Margin = new Padding(4, 0, 4, 0);
NoteLbl.Name = "NoteLbl";
NoteLbl.Size = new Size(72, 32);
NoteLbl.TabIndex = 11;
NoteLbl.Text = "Note:";
//
// UpdateF
//
AutoScaleDimensions = new SizeF(13F, 32F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(706, 345);
Controls.Add(NoteLbl);
Controls.Add(NoteTb);
Controls.Add(CardCBox);
Controls.Add(CardLbl);
Controls.Add(CancelBtn);
Controls.Add(ConfirmBtn);
Controls.Add(NextUpdDTPicker);
Controls.Add(UpdDTPicker);
Controls.Add(NextUpdLabel);
Controls.Add(LastUpdLabel);
Controls.Add(LibrarianCBox);
Controls.Add(LibLabel);
Margin = new Padding(4, 4, 4, 4);
Name = "UpdateF";
Text = "UpdateF";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label LibLabel;
private ComboBox LibrarianCBox;
private Label LastUpdLabel;
private Label NextUpdLabel;
private DateTimePicker UpdDTPicker;
private DateTimePicker NextUpdDTPicker;
private Button ConfirmBtn;
private Button CancelBtn;
private ComboBox CardCBox;
private Label CardLbl;
private TextBox NoteTb;
private Label NoteLbl;
}
}

View File

@ -0,0 +1,35 @@
namespace LDBproject.AdditionalForms;
public partial class UpdateF : Form
{
public UpdateF()
{
InitializeComponent();
LibrarianCBox.DisplayMember = "FIO";
LibrarianCBox.ValueMember = "CardID";
CardCBox.DisplayMember = "FIO";
CardCBox.DisplayMember = "CardID";
CardCBox.ValueMember = "CardID";
}
private void ConfirmBtn_Click(object sender, EventArgs e)
{
try
{
if (LibrarianCBox.SelectedIndex < 0 || CardCBox.SelectedIndex < 0)
{
throw new Exception("[ Blanck space left ]");
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Saving error ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void CancelBtn_Click(object sender, EventArgs e) => Close();
}

View 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>

View File

@ -0,0 +1,112 @@
namespace LDBproject.AdditionalForms
{
partial class UpdatesListF
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
panel1 = new Panel();
DelBtn = new Button();
AddBtn = new Button();
DataGV = new DataGridView();
panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)DataGV).BeginInit();
SuspendLayout();
//
// panel1
//
panel1.BackColor = Color.Transparent;
panel1.Controls.Add(DelBtn);
panel1.Controls.Add(AddBtn);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(546, 0);
panel1.Name = "panel1";
panel1.Size = new Size(163, 360);
panel1.TabIndex = 3;
//
// DelBtn
//
DelBtn.BackColor = Color.DarkSlateBlue;
DelBtn.BackgroundImage = Properties.Resources.DelImg;
DelBtn.BackgroundImageLayout = ImageLayout.Stretch;
DelBtn.ForeColor = Color.Transparent;
DelBtn.Location = new Point(27, 218);
DelBtn.Name = "DelBtn";
DelBtn.Size = new Size(78, 71);
DelBtn.TabIndex = 6;
DelBtn.UseVisualStyleBackColor = false;
DelBtn.Click += DelBtn_Click;
//
// AddBtn
//
AddBtn.BackColor = Color.DarkSlateBlue;
AddBtn.BackgroundImage = Properties.Resources.AddImg;
AddBtn.BackgroundImageLayout = ImageLayout.Stretch;
AddBtn.ForeColor = Color.Transparent;
AddBtn.Location = new Point(27, 126);
AddBtn.Name = "AddBtn";
AddBtn.Size = new Size(78, 71);
AddBtn.TabIndex = 4;
AddBtn.UseVisualStyleBackColor = false;
AddBtn.Click += AddBtn_Click;
//
// DataGV
//
DataGV.BackgroundColor = Color.DarkSlateBlue;
DataGV.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
DataGV.GridColor = Color.GreenYellow;
DataGV.Location = new Point(30, 90);
DataGV.Name = "DataGV";
DataGV.RowHeadersWidth = 62;
DataGV.Size = new Size(489, 245);
DataGV.TabIndex = 2;
//
// CardUpdatesF
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources.UpdListFrameCover;
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(709, 360);
Controls.Add(panel1);
Controls.Add(DataGV);
DoubleBuffered = true;
Name = "CardUpdatesF";
Text = "CardUpdatesF";
Load += CardUpdatesF_Load;
panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)DataGV).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panel1;
private Button DelBtn;
private Button AddBtn;
private DataGridView DataGV;
}
}

View File

@ -0,0 +1,76 @@
using Unity;
namespace LDBproject.AdditionalForms;
public partial class UpdatesListF : Form
{
private readonly IUnityContainer _container;
public UpdatesListF(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void CardUpdatesF_Load(object sender, EventArgs e)
{
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while saving ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void AddBtn_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<UpdateF>().ShowDialog();
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while adding element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DelBtn_Click(object sender, EventArgs e)
{
if (!GetIDFromRow(out var foundID))
{
return;
}
if (MessageBox.Show("Remove element?", "Deleting", MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
ReloadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Error while removing element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ReloadList() { }
private bool GetIDFromRow(out int id)
{
id = 0;
if (DataGV.SelectedRows.Count < 1)
{
MessageBox.Show("[ Error : element doesn't exist ]", "<ERROR>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
id = Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value);
return true;
}
}

View 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>

View File

@ -0,0 +1,201 @@
-- Insert data into Genres
INSERT INTO Genres (GenreName) VALUES
('None'), ('Adventure'), ('Fantasy'), ('Mystery'), ('Fiction'), ('Suspense'), ('Romance'), ('Crime'), ('Talent'), ('Realism'), ('Horror'), ('Historical');
-- Insert data into Books (with updated GenreIDs and Status)
INSERT INTO Books (Title, Author, PublishYear, Status, GenreMask) VALUES
('The Hobbit', 'J.R.R. Tolkien', 1937, 3, 1024), -- On Stock, Fantasy
('Pride and Prejudice', 'Jane Austen', 1813, 3, 2 | 128), -- On Stock, Romance | Realism
('The Da Vinci Code', 'Dan Brown', 2003, 4, 4 | 16), -- Borrowed, Mystery | Suspense
('1984', 'George Orwell', 1949, 3, 8 | 128), -- On Stock, Fiction | Realism
('To Kill a Mockingbird', 'Harper Lee', 1960, 4, 8 | 128), -- Borrowed, Fiction | Realism
('The Great Gatsby', 'F. Scott Fitzgerald', 1925, 3, 2 | 128), -- On Stock, Romance | Realism
('The Time Traveler''s Wife', 'Audrey Niffenegger', 2003, 4, 2 | 1024), -- Borrowed, Romance | Fantasy
('The Secret Garden', 'Frances Hodgson Burnett', 1911, 2, 1), -- in IDassignment state, Adventure
('Gone Girl', 'Gillian Flynn', 2012, 1, 4 | 16 | 32), -- Ordered, Mystery | Suspense | Crime
('A Game of Thrones', 'George R.R. Martin', 1996, 3, 1 | 1024 | 8), -- On Stock, Adventure | Fantasy | Fiction
('Harry Potter and the Sorcerer''s Stone', 'J.K. Rowling', 1997, 3, 1 | 8 | 1024), -- On Stock, Adventure | Fiction | Fantasy
('The Martian', 'Andy Weir', 2011, 3, 1 | 8), -- On Stock, Adventure | Fiction
('Little Women', 'Louisa May Alcott', 1868, 5, 2), -- Debited, Romance
('The Seven Husbands of Evelyn Hugo', 'Taylor Jenkins Reid', 2017, 3, 2 | 128); -- On Stock, Romance | Realism
-- ('Where the Crawdads Sing', 'Delia Owens', 2018, ); -- Fiction, Borrowed
-- ('The Lord of the Rings', 'J.R.R. Tolkien', 1954, ), -- Fantasy, Unable
-- ('The Nightingale', 'Kristin Hannah', 2015, ), -- Romance, Borrowed
-- ('The Book Thief', 'Markus Zusak', 2005, ), -- Fiction, On Stock
-- ('The Help', 'Kathryn Stockett', 2009, ), -- Fiction, Borrowed
-- ('The Girl on the Train', 'Paula Hawkins', 2015, ), -- Suspense, On Stock
-- ('The Girl with the Dragon Tattoo', 'Stieg Larsson', 2005, ), -- Suspense, On Stock
-- ('The Catcher in the Rye', 'J.D. Salinger', 1951, ), -- Fiction, Unable
-- ('The Hunger Games', 'Suzanne Collins', 2008, ), -- Suspense, Borrowed
-- ('The Silent Patient', 'Alex Michaelides', 2019, ), -- Mystery, Unable
-- ('And Then There Were None', 'Agatha Christie', 1939, ), -- Mystery, Unable
-- Insert data into LibrarianCards (reference existing GenreIDs)
INSERT INTO LibrarianCards (FIO, GenreMask) VALUES
('Carla R.E.', 4 | 16 | 32),
('Bonnet D.P.', 2 | 128),
('Gabriel W.T.', 1 | 1024 | 8);
-- Insert data into CustomerCards
INSERT INTO CustomerCards (FIO, AgeBirthday) VALUES
('Winsent G.P.', '2000-01-15'),
('Quincy P.R.', '2005-05-20'),
('Emily Y.N.', '2009-11-10'),
('Frank A.K.', '2007-07-25'),
('Marinett J.C.', '2004-03-01'),
('Alice B.T.', '2002-08-10'),
('Bob C.L.', '1998-03-25'),
('Charlie D.M.', '2011-06-18'),
('Diana E.S.', '1995-12-05'),
('Eve F.W.', '2007-09-30');
-- Insert more data into Orders
INSERT INTO Orders (CardID, LibrarianID, BorrowDate) VALUES
(6, 1, '2024-05-10 11:00:00'),
(1, 3, '2024-05-15 15:30:00'),
(9, 1, '2024-05-20 09:45:00'),
(3, 2, '2024-05-25 13:15:00'),
(4, 3, '2024-06-01 10:00:00'),
(5, 1, '2024-06-05 16:45:00'),
(10, 2, '2024-06-10 14:15:00'),
(1, 1, '2024-07-15 10:30:00'),
(10, 3, '2024-07-20 12:45:00'),
(7, 1, '2024-07-25 17:00:00'),
(2, 1, '2024-08-20 09:45:00'),
(8, 2, '2024-08-25 13:15:00'),
(4, 3, '2024-09-01 10:00:00'),
(5, 1, '2024-09-12 16:45:00'),
(8, 3, '2024-09-16 10:00:00'),
(6, 1, '2024-09-24 16:45:00'),
(9, 2, '2024-10-10 14:15:00'),
(1, 1, '2024-10-15 10:30:00'),
(7, 3, '2024-12-09 12:45:00'),
(3, 1, '2024-12-25 17:00:00'),
(4, 1, '2024-12-20 09:45:00');
-- Insert more data into Registrations
INSERT INTO Registrations (OrderID, BookID, Note) VALUES
(1, 6, '07-10'),
(2, 10, '07-15'),
(3, 2, '07-20'),
(4, 7, '07-25'),
(5, 11, '08-07'),
(5, 9, '08-07'),
(6, 8, '08-10'),
(7, 4, '08-15'),
(7, 5, '08-15'),
(7, 6, '08-15'),
(7, 7, '08-15'),
(8, 11, '08-18'),
(9, 9, '08-27'),
(9, 3, '08-10'),
(10, 4, '08-15'),
(11, 8, '07-25'),
(12, 10, '08-01'),
(13, 12, '08-05'),
(14, 3, '08-10'),
(14, 4, '08-15'),
(14, 5, '08-20'),
(14, 1, '08-25'),
(15, 6, '08-25'),
(16, 7, '07-25'),
(17, 8, '08-01'),
(17, 9, '08-05'),
(18, 11, '08-10'),
(18, 4, '08-15'),
(18, 7, '07-25'),
(18, 1, '08-01');
-- Insert more data into Updates Multiple updates on the same day
INSERT INTO Updates (LastUpdate, UpdBoundary, Note, LibrarianID, CardID) VALUES
('2017-05-10', '2021-03-15', 'Card Received', 3, 1),
('2022-11-22', '2025-08-20', 'Renewed card', 2, 3),
('2016-02-01', '2020-01-10', 'Card Received', 2, 2),
('2020-09-18', '2024-12-05', 'Updated address', 1, 4),
('2018-07-05', '2024-06-25', 'Card Received', 3, 5),
('2023-10-26', '2024-04-15', 'Lost card, reissued', 1, 1),
('2023-10-26', '2024-05-10', 'Payment overdue', 2, 5),
('2024-01-15', '2024-07-15', 'Address change', 3, 2),
('2024-03-01', '2024-09-01', 'Renewed card', 1, 4),
('2024-03-01', '2024-09-01', 'Fee payment', 1, 3), -- Multiple updates on the same day
('2024-03-10', '2025-01-10', 'Card Received', 2, 6),
('2024-04-20', '2025-02-20', 'Renewal', 3, 1),
('2024-05-10', '2025-03-10', 'New Card issued', 1, 5);
-- Drop the table if it exists -----------------------------
DROP TABLE IF EXISTS Updates;
DROP TABLE IF EXISTS Registrations;
DROP TABLE IF EXISTS Orders;
DROP TABLE IF EXISTS LibrarianCards;
DROP TABLE IF EXISTS CustomerCards;
DROP TABLE IF EXISTS Books;
DROP TABLE IF EXISTS Genres;
-- Create the Genres table [ 1 ]
CREATE TABLE Genres (
GenreID SERIAL PRIMARY KEY,
GenreName VARCHAR(255) NOT NULL UNIQUE
);
-- Create the Books table [ 2 ]
CREATE TABLE Books (
BookID SERIAL PRIMARY KEY,
Title VARCHAR(255) NOT NULL,
Author VARCHAR(255) NOT NULL,
PublishYear INTEGER,
Status INTEGER CHECK (Status IN (0, 1, 2, 3, 4, 5)),
GenreMask INTEGER DEFAULT 0
-- CountOnStock INTEGER CHECK (CountOnStock >= 0),
-- > GenreID INTEGER REFERENCES Genres(GenreID)
);
-- > ALTER TABLE Books DROP COLUMN GenreID;
-- Now, add the GenreMask column to the Books table
-- [ ! ] ALTER TABLE Books ADD COLUMN GenreMask INTEGER DEFAULT 0; -- Using INTEGER to store bitmask
-- Create the CustomerCards table [ 3 ]
CREATE TABLE CustomerCards (
CardID SERIAL PRIMARY KEY,
FIO VARCHAR(255) NOT NULL,
AgeBirthday DATE
);
-- Create the LibrarianCards table [ 4 ]
CREATE TABLE LibrarianCards (
CardID SERIAL PRIMARY KEY,
FIO VARCHAR(255) NOT NULL,
GenreMask INTEGER DEFAULT 0
-- GenreID INTEGER REFERENCES Genres(GenreID)
);
-- Create the Orders table [ 5 ]
CREATE TABLE Orders (
OrderID SERIAL PRIMARY KEY,
CardID INTEGER REFERENCES CustomerCards(CardID) NOT NULL,
LibrarianID INTEGER REFERENCES LibrarianCards(CardID) NOT NULL,
BorrowDate TIMESTAMP WITH TIME ZONE
);
-- Create the Registrations table [ 6 ]
CREATE TABLE Registrations (
ID SERIAL PRIMARY KEY,
OrderID INTEGER REFERENCES Orders(OrderID) NOT NULL,
BookID INTEGER REFERENCES Books(BookID) NOT NULL,
Note TEXT
);
-- Create the Updates table [ 7 ]
CREATE TABLE Updates (
ID SERIAL PRIMARY KEY,
LastUpdate DATE NOT NULL,
UpdBoundary DATE,
Note TEXT,
LibrarianID INTEGER REFERENCES LibrarianCards(CardID) NOT NULL,
CardID INTEGER REFERENCES CustomerCards(CardID) NOT NULL
);

View File

@ -0,0 +1,27 @@
using LDBproject.Entities.Enums;
namespace LDBproject.Entities;
public class Book
{
public int BookID { get; private set; }
public string Title { get; private set; }
public string Author { get; private set; }
public int PublishYear { get; private set; }
public BookStat Status { get; private set; }
public Genres GenreMask { get; private set; } = Genres.None;
public static Book AddBook(
int bookIndex, string title, string author, int year, Genres genres, BookStat status)
{
return new Book
{
BookID = bookIndex,
Title = title,
Author = author,
PublishYear = year,
GenreMask = genres,
Status = status
};
}
}

View File

@ -0,0 +1,21 @@
namespace LDBproject.Entities;
public class CustomerCard
{
public int CardID { get; private set; }
public string FIO { get; private set; }
public DateTime AgeBirthday { get; private set; }
public static CustomerCard AddCustomer(
int cardIndex, string fullName, DateTime year)
{
return new CustomerCard
{
CardID = cardIndex,
FIO = fullName,
AgeBirthday = year
};
}
}

View File

@ -0,0 +1,11 @@
namespace LDBproject.Entities.Enums;
public enum BookStat
{
Unable = 0,
Ordered = 1,
IDassignment = 2,
OnStock = 3,
Borrowed = 4,
Debited = 5
}

View File

@ -0,0 +1,19 @@
namespace LDBproject.Entities.Enums
{
[Flags]
public enum Genres
{
None = 0, // 00000000
Adventure = 1, // 00000001
Fantasy = 2, // 00000010
Mystery = 4, // 00000100
Fiction = 8, // 00001000
Suspense = 16, // 00010000
Romance = 32, // 00100000
Crime = 64, // 01000000
Talent = 128, // 10000000
Realism = 256, // 10000001
Horror = 512, // 10000010
Historical = 1024, // 10000011
}
}

View File

@ -0,0 +1,23 @@
using LDBproject.Entities.Enums;
namespace LDBproject.Entities;
public class LibrarianCard
{
public int CardID { get; private set; }
public string FIO { get; private set; }
public Genres GenreMask { get; private set; }
public static LibrarianCard AddWorker(
int cardIndex, string fullName, Genres genre)
{
return new LibrarianCard
{
CardID = cardIndex,
FIO = fullName,
GenreMask = genre
};
}
}

View File

@ -0,0 +1,27 @@
namespace LDBproject.Entities;
public class Order
{
public int OrderID { get; private set; }
public int CardID { get; private set; }
public DateTime BorrowDate { get; private set; }
public int LibrarianID { get; private set; }
public IEnumerable<Registration> BookList { get; set; } = [];
public static Order NewOrder(
int orderIndex, int ticketIndex, int librarian, IEnumerable<Registration> list, DateTime borrow)
{
return new Order
{
OrderID = orderIndex,
CardID = ticketIndex,
LibrarianID = librarian,
BookList = list,
BorrowDate = borrow
};
}
}

View File

@ -0,0 +1,23 @@
namespace LDBproject.Entities;
public class Registration
{
public int ID { get; private set; }
public int OrderID { get; private set; }
public int BookID { get; private set; }
public string Note { get; private set; }
public static Registration OrderReg(
int orderIndex, string notes, int bookIndex)
{
return new Registration
{
OrderID = orderIndex,
BookID = bookIndex,
Note = notes
};
}
}

View File

@ -0,0 +1,29 @@
namespace LDBproject.Entities;
public class UpdateC
{
public int ID { get; private set; }
public int CardID { get; private set; }
public int LibrarianID { get; private set; }
public DateTime LastUpdate { get; private set; }
public DateTime UpdBoundary { get; private set; }
public string Note { get; private set; }
public static UpdateC CustomerUpd(
int cardIndex, int librIndex, DateTime updDate, DateTime updToDate, string note)
{
return new UpdateC
{
CardID = cardIndex,
LastUpdate = updDate,
LibrarianID = librIndex,
UpdBoundary = updToDate,
Note = note
};
}
}

View File

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
<PackageReference Include="Unity" Version="5.11.10" />
<PackageReference Include="Unity.Container" Version="5.11.11" />
<PackageReference Include="Unity.Microsoft.Logging" Version="5.11.1" />
</ItemGroup>
</Project>

View File

@ -8,4 +8,13 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="LDBproject.csproj" />
<None Include="LDBproject.csproj.user" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Unity.Container" Version="5.11.11" />
</ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,4 @@
namespace LDBproj namespace LDBproject
{ {
partial class MainForm partial class MainForm
{ {
@ -28,12 +28,149 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; menuStrip1 = new MenuStrip();
this.ClientSize = new System.Drawing.Size(800, 450); toolStripMenuItem1 = new ToolStripMenuItem();
this.Text = "Form1"; menuStrip2 = new MenuStrip();
StaffTSMI = new ToolStripMenuItem();
EmployeeCard = new ToolStripMenuItem();
ReaderCard = new ToolStripMenuItem();
BookReg = new ToolStripMenuItem();
OperationsTSMI = new ToolStripMenuItem();
GiveOut = new ToolStripMenuItem();
Updating = new ToolStripMenuItem();
LogsTSMI = new ToolStripMenuItem();
menuStrip1.SuspendLayout();
menuStrip2.SuspendLayout();
SuspendLayout();
//
// menuStrip1
//
menuStrip1.ImageScalingSize = new Size(24, 24);
menuStrip1.Items.AddRange(new ToolStripItem[] { toolStripMenuItem1 });
menuStrip1.Location = new Point(0, 33);
menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(800, 24);
menuStrip1.TabIndex = 0;
menuStrip1.Text = "menuStrip1";
//
// toolStripMenuItem1
//
toolStripMenuItem1.Name = "toolStripMenuItem1";
toolStripMenuItem1.Size = new Size(16, 20);
//
// menuStrip2
//
menuStrip2.BackColor = Color.GreenYellow;
menuStrip2.ImageScalingSize = new Size(24, 24);
menuStrip2.Items.AddRange(new ToolStripItem[] { StaffTSMI, OperationsTSMI, LogsTSMI });
menuStrip2.Location = new Point(0, 0);
menuStrip2.Name = "menuStrip2";
menuStrip2.Size = new Size(800, 33);
menuStrip2.TabIndex = 1;
menuStrip2.Text = "menuStrip2";
//
// StaffTSMI
//
StaffTSMI.DropDownItems.AddRange(new ToolStripItem[] { EmployeeCard, ReaderCard, BookReg });
StaffTSMI.ForeColor = Color.DarkSlateBlue;
StaffTSMI.Name = "StaffTSMI";
StaffTSMI.Size = new Size(256, 29);
StaffTSMI.Text = "Персональная информация";
//
// EmployeeCard
//
EmployeeCard.BackColor = Color.DarkSlateBlue;
EmployeeCard.ForeColor = Color.GreenYellow;
EmployeeCard.Name = "EmployeeCard";
EmployeeCard.Size = new Size(273, 34);
EmployeeCard.Text = "Карта сотрудника";
EmployeeCard.Click += EmployeeCard_Click;
//
// ReaderCard
//
ReaderCard.BackColor = Color.DarkSlateBlue;
ReaderCard.ForeColor = Color.GreenYellow;
ReaderCard.Name = "ReaderCard";
ReaderCard.Size = new Size(273, 34);
ReaderCard.Text = "Читательский билет";
ReaderCard.Click += ReaderCard_Click;
//
// BookReg
//
BookReg.BackColor = Color.DarkSlateBlue;
BookReg.ForeColor = Color.GreenYellow;
BookReg.Name = "BookReg";
BookReg.Size = new Size(273, 34);
BookReg.Text = "Книга";
BookReg.Click += BookReg_Click;
//
// OperationsTSMI
//
OperationsTSMI.DropDownItems.AddRange(new ToolStripItem[] { GiveOut, Updating });
OperationsTSMI.ForeColor = Color.DarkSlateBlue;
OperationsTSMI.Name = "OperationsTSMI";
OperationsTSMI.Size = new Size(112, 29);
OperationsTSMI.Text = "Операции";
//
// GiveOut
//
GiveOut.BackColor = Color.DarkSlateBlue;
GiveOut.ForeColor = Color.GreenYellow;
GiveOut.Name = "GiveOut";
GiveOut.Size = new Size(289, 34);
GiveOut.Text = "Оформление выдачи";
GiveOut.Click += GiveOut_Click;
//
// Updating
//
Updating.BackColor = Color.DarkSlateBlue;
Updating.ForeColor = Color.GreenYellow;
Updating.Name = "Updating";
Updating.Size = new Size(289, 34);
Updating.Text = "Обновление билета";
Updating.Click += Updating_Click;
//
// LogsTSMI
//
LogsTSMI.ForeColor = Color.DarkSlateBlue;
LogsTSMI.Name = "LogsTSMI";
LogsTSMI.Size = new Size(88, 29);
LogsTSMI.Text = "Отчёты";
//
// MainForm
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(800, 450);
Controls.Add(menuStrip1);
Controls.Add(menuStrip2);
DoubleBuffered = true;
MainMenuStrip = menuStrip1;
Name = "MainForm";
Text = "WorkForm";
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
menuStrip2.ResumeLayout(false);
menuStrip2.PerformLayout();
ResumeLayout(false);
PerformLayout();
} }
#endregion #endregion
private MenuStrip menuStrip1;
private ToolStripMenuItem toolStripMenuItem1;
private MenuStrip menuStrip2;
private ToolStripMenuItem StaffTSMI;
private ToolStripMenuItem EmployeeCard;
private ToolStripMenuItem OperationsTSMI;
private ToolStripMenuItem GiveOut;
private ToolStripMenuItem LogsTSMI;
private ToolStripMenuItem ReaderCard;
private ToolStripMenuItem BookReg;
private ToolStripMenuItem Updating;
} }
} }

View File

@ -1,10 +1,82 @@
namespace LDBproj using LDBproject.AdditionalForms;
using Unity;
namespace LDBproject;
public partial class MainForm : Form
{ {
public partial class MainForm : Form private readonly IUnityContainer _container;
public MainForm(IUnityContainer container)
{ {
public MainForm() InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
}
private void EmployeeCard_Click(object sender, EventArgs e)
{
try
{ {
InitializeComponent(); _container.Resolve<EmployeesF>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Download : mistake ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ReaderCard_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<CustomerListF>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Download : mistake ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void BookReg_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<BookListF>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Download : mistake ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void GiveOut_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<OrderRegistrations>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Download : mistake ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void Updating_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<UpdatesListF>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "[ Download : mistake ]",
MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,32 @@
namespace LDBproj using LDBproject.Repositories.Implementations;
using LDBproject.Repositories;
using Unity;
namespace LDBproject
{ {
internal static class Program internal static class Program
{ {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread] [STAThread]
static void Main() static void Main()
{ {
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new MainForm()); Application.Run(CreateContainer().Resolve<MainForm>());
}
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
container.RegisterType<IBookRep, BookR>();
container.RegisterType<ICustomerCardsRep, CustomerCardR>();
container.RegisterType<ILibrarianRep, LibrarianR>();
container.RegisterType<IOrderRep, OrderR>();
container.RegisterType<IUpdateRep, UpdateR>();
return container;
} }
} }
} }

View File

@ -0,0 +1,140 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LDBproject.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("LDBproject.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 AddImg {
get {
object obj = ResourceManager.GetObject("AddImg", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap BookListFrameCover {
get {
object obj = ResourceManager.GetObject("BookListFrameCover", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap DelImg {
get {
object obj = ResourceManager.GetObject("DelImg", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap EmployeesFrameCover {
get {
object obj = ResourceManager.GetObject("EmployeesFrameCover", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap OperationImg {
get {
object obj = ResourceManager.GetObject("OperationImg", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ReadersFrameCover {
get {
object obj = ResourceManager.GetObject("ReadersFrameCover", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap RegistrationsFrameCover {
get {
object obj = ResourceManager.GetObject("RegistrationsFrameCover", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap UpdListFrameCover {
get {
object obj = ResourceManager.GetObject("UpdListFrameCover", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,145 @@
<?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="ReadersFrameCover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\ReadersFrameCover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OperationImg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\OperationImg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UpdListFrameCover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\UpdListFrameCover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AddImg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\AddImg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="DelImg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\DelImg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="BookListFrameCover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\BookListFrameCover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="EmployeesFrameCover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\EmployeesFrameCover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RegistrationsFrameCover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\RscImages\RegistrationsFrameCover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,16 @@
using LDBproject.Entities;
namespace LDBproject.Repositories;
public interface IBookRep
{
IEnumerable<Book> GetBookList();
Book GetBookByID(int id);
void AddBook(Book card);
void UpdateBook(Book card);
void DeleteBook(int id);
}

View File

@ -0,0 +1,16 @@
using LDBproject.Entities;
namespace LDBproject.Repositories;
public interface ICustomerCardsRep
{
IEnumerable<CustomerCard> GetCards();
CustomerCard GetCardByID(int id);
void AddCard(CustomerCard card);
void UpdateCard(CustomerCard card);
void DeleteCard(int id);
}

View File

@ -0,0 +1,16 @@
using LDBproject.Entities;
namespace LDBproject.Repositories;
public interface ILibrarianRep
{
IEnumerable<LibrarianCard> GetCards();
LibrarianCard GetCardByID(int id);
void AddCard(LibrarianCard card);
void ChangeCardInfo(LibrarianCard card);
void DeleteCard(int id);
}

View File

@ -0,0 +1,13 @@
using LDBproject.Entities;
namespace LDBproject.Repositories;
public interface IOrderRep
{
IEnumerable<Order> GetOrdersInfo(
int? librarianID = null, int? orderID = null, int? customerID = null);
void CreateOrder(Order order);
void DeleteOrderinfo(int orderID);
}

View File

@ -0,0 +1,15 @@
using LDBproject.Entities;
namespace LDBproject.Repositories;
public interface IUpdateRep
{
IEnumerable<UpdateC> GetUpdateList();
UpdateC GetUpdateByID(int id);
void AddUpdate(UpdateC card);
void RemoveUpd(int cardID);
}

View File

@ -0,0 +1,33 @@
using LDBproject.Entities;
namespace LDBproject.Repositories.Implementations;
public class BookR : IBookRep
{
public BookR()
{
}
public Book GetBookByID(int id)
{
return null;
}
public void AddBook(Book book)
{
}
public void UpdateBook(Book book)
{
}
public void DeleteBook(int id)
{
}
public IEnumerable<Book> GetBookList()
{
return [];
}
}

View File

@ -0,0 +1,28 @@
using LDBproject.Entities;
namespace LDBproject.Repositories.Implementations;
public class CustomerCardR : ICustomerCardsRep
{
public CustomerCard GetCardByID(int id)
{
return null;
}
public void AddCard(CustomerCard card)
{
}
public void UpdateCard(CustomerCard card)
{
}
public void DeleteCard(int id)
{
}
public IEnumerable<CustomerCard> GetCards()
{
return [];
}
}

View File

@ -0,0 +1,32 @@
using LDBproject.Entities;
namespace LDBproject.Repositories.Implementations;
internal class LibrarianR : ILibrarianRep
{
public LibrarianR()
{
}
public LibrarianCard GetCardByID(int id)
{
return null;
}
public void AddCard(LibrarianCard card)
{
}
public void ChangeCardInfo(LibrarianCard card)
{
}
public void DeleteCard(int id)
{
}
public IEnumerable<LibrarianCard> GetCards()
{
return [];
}
}

View File

@ -0,0 +1,15 @@
using LDBproject.Entities;
namespace LDBproject.Repositories.Implementations;
public class OrderR : IOrderRep
{
public void CreateOrder(Order order) {}
public void DeleteOrderinfo(int orderID) {}
public IEnumerable<Order> GetOrdersInfo(int? librarianID = null, int? orderID = null, int? customerID = null)
{
return [];
}
}

View File

@ -0,0 +1,28 @@
using LDBproject.Entities;
namespace LDBproject.Repositories.Implementations;
public class UpdateR : IUpdateRep
{
public UpdateR()
{
}
public UpdateC GetUpdateByID(int id)
{
return null;
}
public void AddUpdate(UpdateC update)
{
}
public void RemoveUpd(int Id)
{
}
public IEnumerable<UpdateC> GetUpdateList()
{
return [];
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

View File

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.8.34525.116 VisualStudioVersion = 17.8.34525.116
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LDBproj", "LDBproj\LDBproj.csproj", "{BA5F8F6F-85FF-43E6-A4B0-D8DC7F897FD6}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LDBproject", "LDBproj\LDBproject.csproj", "{BA5F8F6F-85FF-43E6-A4B0-D8DC7F897FD6}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution