diff --git a/LibraryDBproject/LDBproj/AdditionalForms/BookListF.Designer.cs b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.Designer.cs index 9629475..7193ade 100644 --- a/LibraryDBproject/LDBproj/AdditionalForms/BookListF.Designer.cs +++ b/LibraryDBproject/LDBproj/AdditionalForms/BookListF.Designer.cs @@ -44,9 +44,10 @@ PanelWithOperations.Controls.Add(AddBtn); PanelWithOperations.Controls.Add(UpdBtn); PanelWithOperations.Dock = DockStyle.Right; - PanelWithOperations.Location = new Point(623, 0); + PanelWithOperations.Location = new Point(1155, 0); + PanelWithOperations.Margin = new Padding(4, 4, 4, 4); PanelWithOperations.Name = "PanelWithOperations"; - PanelWithOperations.Size = new Size(154, 396); + PanelWithOperations.Size = new Size(200, 718); PanelWithOperations.TabIndex = 0; // // DelBtn @@ -55,9 +56,10 @@ DelBtn.BackgroundImage = Properties.Resources.DelImg; DelBtn.BackgroundImageLayout = ImageLayout.Stretch; DelBtn.ForeColor = Color.Transparent; - DelBtn.Location = new Point(23, 207); + DelBtn.Location = new Point(40, 364); + DelBtn.Margin = new Padding(4, 4, 4, 4); DelBtn.Name = "DelBtn"; - DelBtn.Size = new Size(78, 71); + DelBtn.Size = new Size(101, 91); DelBtn.TabIndex = 4; DelBtn.UseVisualStyleBackColor = false; DelBtn.Click += DelBtn_Click; @@ -68,9 +70,10 @@ AddBtn.BackgroundImage = Properties.Resources.AddImg; AddBtn.BackgroundImageLayout = ImageLayout.Stretch; AddBtn.ForeColor = Color.Transparent; - AddBtn.Location = new Point(23, 53); + AddBtn.Location = new Point(40, 167); + AddBtn.Margin = new Padding(4, 4, 4, 4); AddBtn.Name = "AddBtn"; - AddBtn.Size = new Size(78, 71); + AddBtn.Size = new Size(101, 91); AddBtn.TabIndex = 3; AddBtn.UseVisualStyleBackColor = false; AddBtn.Click += AddBtn_Click; @@ -81,9 +84,10 @@ UpdBtn.BackgroundImage = Properties.Resources.OperationImg; UpdBtn.BackgroundImageLayout = ImageLayout.Stretch; UpdBtn.ForeColor = Color.Transparent; - UpdBtn.Location = new Point(23, 130); + UpdBtn.Location = new Point(40, 265); + UpdBtn.Margin = new Padding(4, 4, 4, 4); UpdBtn.Name = "UpdBtn"; - UpdBtn.Size = new Size(78, 71); + UpdBtn.Size = new Size(101, 91); UpdBtn.TabIndex = 1; UpdBtn.UseVisualStyleBackColor = false; UpdBtn.Click += UpdBtn_Click; @@ -96,24 +100,26 @@ DataGV.BackgroundColor = Color.DarkSlateBlue; DataGV.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; DataGV.GridColor = Color.GreenYellow; - DataGV.Location = new Point(25, 101); + DataGV.Location = new Point(39, 166); + DataGV.Margin = new Padding(4, 4, 4, 4); DataGV.Name = "DataGV"; DataGV.RowHeadersVisible = false; DataGV.RowHeadersWidth = 62; DataGV.SelectionMode = DataGridViewSelectionMode.FullRowSelect; - DataGV.Size = new Size(583, 259); + DataGV.Size = new Size(1090, 488); DataGV.TabIndex = 1; // // BookListF // - AutoScaleDimensions = new SizeF(10F, 25F); + AutoScaleDimensions = new SizeF(13F, 32F); AutoScaleMode = AutoScaleMode.Font; BackgroundImage = Properties.Resources.BookListFrameCover; BackgroundImageLayout = ImageLayout.Stretch; - ClientSize = new Size(777, 396); + ClientSize = new Size(1355, 718); Controls.Add(DataGV); Controls.Add(PanelWithOperations); DoubleBuffered = true; + Margin = new Padding(4, 4, 4, 4); Name = "BookListF"; StartPosition = FormStartPosition.CenterParent; Text = "BookListF"; diff --git a/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.cs b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.cs index 956b7cb..a9a22ba 100644 --- a/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.cs +++ b/LibraryDBproject/LDBproj/AdditionalForms/CustomerListF.cs @@ -67,6 +67,7 @@ public partial class CustomerListF : Form { DataGV.DataSource = _custR.GetCards(); DataGV.Columns["FIO"].Visible = false; + DataGV.Columns["CardID"].Visible = false; } private bool GetIDFromRow(out int id) diff --git a/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.cs b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.cs index f470eb3..3cb0fe3 100644 --- a/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.cs +++ b/LibraryDBproject/LDBproj/AdditionalForms/EmployeesF.cs @@ -86,7 +86,7 @@ public partial class EmployeesF : Form private void ReloadList() { DataGV.DataSource = _libR.GetCards(); - // DataGV.Columns["CardID"].Visible = false; + DataGV.Columns["CardID"].Visible = false; } private bool GetiDFromRow(out int id) diff --git a/LibraryDBproject/LDBproj/AdditionalForms/OrdersF.cs b/LibraryDBproject/LDBproj/AdditionalForms/OrdersF.cs index 9a8fd7d..455bc0f 100644 --- a/LibraryDBproject/LDBproj/AdditionalForms/OrdersF.cs +++ b/LibraryDBproject/LDBproj/AdditionalForms/OrdersF.cs @@ -66,8 +66,7 @@ public partial class OrdersF : Form private void ReloadList() { DataGV.DataSource = _regR.GetOrdersInfo(); - DataGV.Columns["OrderID"].Visible = false; - DataGV.Columns["BorrowDate"].DefaultCellStyle.Format = "dd MMMM yyyy hh:mm"; + // DataGV.Columns["BorrowDate"].DefaultCellStyle.Format = "dd MMMM yyyy hh:mm"; } private bool GetIDFromRow(out int id) diff --git a/LibraryDBproject/LDBproj/Entities/Book.cs b/LibraryDBproject/LDBproj/Entities/Book.cs index b0475f2..8c3baad 100644 --- a/LibraryDBproject/LDBproj/Entities/Book.cs +++ b/LibraryDBproject/LDBproj/Entities/Book.cs @@ -7,14 +7,14 @@ public class Book { public int BookID { get; private set; } + public string MainBookInfo => $"<<{Title}>>; {Author}"; + [DisplayName("< title >")] public string Title { get; private set; } [DisplayName("< author >")] public string Author { get; private set; } + [DisplayName("< year of print >")] - - public string MainBookInfo => $"<<{Title}>>; {Author}"; - public int PublishYear { get; private set; } [DisplayName("< current position >")] public BookStat Status { get; private set; } diff --git a/LibraryDBproject/LDBproj/Entities/CustomerCard.cs b/LibraryDBproject/LDBproj/Entities/CustomerCard.cs index ebe924b..a79b401 100644 --- a/LibraryDBproject/LDBproj/Entities/CustomerCard.cs +++ b/LibraryDBproject/LDBproj/Entities/CustomerCard.cs @@ -4,7 +4,6 @@ namespace LDBproject.Entities; public class CustomerCard { - [DisplayName("Reader's index")] public int CardID { get; private set; } [DisplayName("Reader's full name")] diff --git a/LibraryDBproject/LDBproj/Entities/Order.cs b/LibraryDBproject/LDBproj/Entities/Order.cs index 0f70304..94f7598 100644 --- a/LibraryDBproject/LDBproj/Entities/Order.cs +++ b/LibraryDBproject/LDBproj/Entities/Order.cs @@ -37,18 +37,6 @@ public class Order }; } - public static Order NewOrder(TemprOrderReg order, IEnumerable regs) - { - return new Order - { - OrderID = order.OrderID, - CardID = order.CardID, - LibrarianID = order.LibrarianID, - Registrations = regs, - BorrowDate = order.BorrowDate - }; - } - public void SetRegs(IEnumerable regs) { if (regs != null && regs.Any()) diff --git a/LibraryDBproject/LDBproj/Repositories/Implementations/OrderR.cs b/LibraryDBproject/LDBproj/Repositories/Implementations/OrderR.cs index 816a8c7..58682fc 100644 --- a/LibraryDBproject/LDBproj/Repositories/Implementations/OrderR.cs +++ b/LibraryDBproject/LDBproj/Repositories/Implementations/OrderR.cs @@ -140,15 +140,15 @@ public class OrderR : IOrderRep var querySelectAll = @"SELECT orders.*, - lc.FIO as 'EmployeeName', + lc.FIO as EmployeeName, CONCAT(books.Title, ' ', books.Author) as BookInfo, - CONCAT(cc.FIO, ' ', cc.AnimalNickName) as ReaderName, + CONCAT(cc.CardID, ' ', cc.FIO) as ReaderName, regs.BookID, regs.Note FROM Orders orders LEFT JOIN LibrarianCards lc ON lc.CardID = orders.LibrarianID LEFT JOIN CustomerCards cc ON cc.CardID = orders.CardID INNER JOIN Registrations regs ON regs.OrderID = orders.OrderID - LEFT JOIN Books books ON books.BookID = orders.BookID"; + LEFT JOIN Books books ON books.BookID = regs.BookID"; var regsDict = new Dictionary>(); var orders = connection.Query(querySelectAll, (order, orders) => diff --git a/LibraryDBproject/LDBproj/Repositories/Implementations/UpdateR.cs b/LibraryDBproject/LDBproj/Repositories/Implementations/UpdateR.cs index 14b6b94..0a671b9 100644 --- a/LibraryDBproject/LDBproj/Repositories/Implementations/UpdateR.cs +++ b/LibraryDBproject/LDBproj/Repositories/Implementations/UpdateR.cs @@ -79,11 +79,11 @@ public class UpdateR : IUpdateRep var querySelectAll = @"SELECT upd.*, - lc.FIO as 'EmployeeName', + lc.FIO as EmployeeName, CONCAT(cc.CardID, ' ', cc.FIO) as ReaderName FROM Updates upd - LEFT JOIN LibrarianCards lc ON lc.CardID = orders.LibrarianID - LEFT JOIN CustomerCards cc ON cc.CardID = orders.CardID"; + LEFT JOIN LibrarianCards lc ON lc.CardID = upd.LibrarianID + LEFT JOIN CustomerCards cc ON cc.CardID = upd.CardID"; var upds = connection.Query(querySelectAll); _logger.LogDebug("Aimed objects: {json}", JsonConvert.SerializeObject(upds));