diff --git a/LibraryDBproject/LDBproj/AdditionalForms/BookF.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/BookF.Designer.cs
new file mode 100644
index 0000000..e6fc721
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/BookF.Designer.cs
@@ -0,0 +1,190 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class BookF
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/BookF.cs b/LibraryDBproject/LDBproj/AdditionalForms/BookF.cs
new file mode 100644
index 0000000..355d389
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/BookF.cs
@@ -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; }
+}
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/BookF.resx b/LibraryDBproject/LDBproj/AdditionalForms/BookF.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/BookF.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/BookListF.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.Designer.cs
new file mode 100644
index 0000000..9629475
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.Designer.cs
@@ -0,0 +1,134 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class BookListF
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/BookListF.cs b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.cs
new file mode 100644
index 0000000..a6d9f5f
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.cs
@@ -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().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 ]", "",
+ 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();
+ form.ID = findID;
+ form.ShowDialog();
+ ReloadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Book List Form [ Error while updating element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+}
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/BookListF.resx b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.Designer.cs
new file mode 100644
index 0000000..7119bc6
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.Designer.cs
@@ -0,0 +1,131 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class CustomerF
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.cs b/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.cs
new file mode 100644
index 0000000..80b2a3d
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.cs
@@ -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; }
+}
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.resx b/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/CustomerF.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.Designer.cs
new file mode 100644
index 0000000..fbb70b5
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.Designer.cs
@@ -0,0 +1,132 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class CustomerListF
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.cs b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.cs
new file mode 100644
index 0000000..3a8cf6c
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.cs
@@ -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().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 ]", "",
+ 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();
+ form.ID = findID;
+ form.ShowDialog();
+ ReloadList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Customer List Form [ Error while updating element ]", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+}
+
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.resx b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.Designer.cs
new file mode 100644
index 0000000..6d3b89c
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.Designer.cs
@@ -0,0 +1,129 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class EmployeeF
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.cs b/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.cs
new file mode 100644
index 0000000..d505054
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.cs
@@ -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; }
+}
+
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.resx b/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/EmployeeF.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.Designer.cs
new file mode 100644
index 0000000..6519ef0
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.Designer.cs
@@ -0,0 +1,128 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class EmployeesF
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.cs b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.cs
new file mode 100644
index 0000000..ea47543
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.cs
@@ -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().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();
+ 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 ]", "",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+
+ id = Convert.ToInt32(DataGV.SelectedRows[0].Cells["CardID"].Value);
+ return true;
+ }
+}
+
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.resx b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.Designer.cs
new file mode 100644
index 0000000..1463d2f
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.Designer.cs
@@ -0,0 +1,112 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class OrderRegistrations
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.cs b/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.cs
new file mode 100644
index 0000000..ad9fe83
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.cs
@@ -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().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 ]", "",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+
+ id = Convert.ToInt32(DataGV.SelectedRows[0].Cells["OrderID"].Value);
+ return true;
+ }
+}
+
+
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.resx b/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/OrderRegistrations.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/RegOrder.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/RegOrder.Designer.cs
new file mode 100644
index 0000000..b24be4d
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/RegOrder.Designer.cs
@@ -0,0 +1,188 @@
+namespace LDBproject.AdditionalForms
+{
+ partial class RegOrder
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ 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;
+ }
+}
\ No newline at end of file
diff --git a/LibraryDBproject/LDBproj/AdditionalForms/RegOrder.cs b/LibraryDBproject/LDBproj/AdditionalForms/RegOrder.cs
new file mode 100644
index 0000000..a2915a7
--- /dev/null
+++ b/LibraryDBproject/LDBproj/AdditionalForms/RegOrder.cs
@@ -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