diff --git a/LawFirm/LawFirm/FormMain.Designer.cs b/LawFirm/LawFirm/FormMain.Designer.cs index 6a92ac0..a32ae7a 100644 --- a/LawFirm/LawFirm/FormMain.Designer.cs +++ b/LawFirm/LawFirm/FormMain.Designer.cs @@ -28,20 +28,21 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); - toolStrip1 = new ToolStrip(); - toolStripDropDownButton1 = new ToolStripDropDownButton(); - компонентыToolStripMenuItem = new ToolStripMenuItem(); - ПутёвкиToolStripMenuItem = new ToolStripMenuItem(); - buttonCreateOrder = new Button(); - buttonTakeOrderInWork = new Button(); - buttonOrderReady = new Button(); - buttonIssuedOrder = new Button(); - buttonRef = new Button(); - dataGridView = new DataGridView(); - toolStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); - SuspendLayout(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.toolStripMenuItemCatalogs = new System.Windows.Forms.ToolStripMenuItem(); + this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.пакетыДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.buttonCreateOrder = new System.Windows.Forms.Button(); + this.buttonTakeOrderInWork = new System.Windows.Forms.Button(); + this.buttonOrderReady = new System.Windows.Forms.Button(); + this.buttonIssuedOrder = new System.Windows.Forms.Button(); + this.buttonRef = new System.Windows.Forms.Button(); + this.магазиныToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.buttonSupplyShop = new System.Windows.Forms.Button(); + this.menuStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); // // menuStrip1 // @@ -55,13 +56,13 @@ // // toolStripMenuItemCatalogs // - toolStripDropDownButton1.DisplayStyle = ToolStripItemDisplayStyle.Text; - toolStripDropDownButton1.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, ПутёвкиToolStripMenuItem }); - toolStripDropDownButton1.Image = (Image)resources.GetObject("toolStripDropDownButton1.Image"); - toolStripDropDownButton1.ImageTransparentColor = Color.Magenta; - toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - toolStripDropDownButton1.Size = new Size(88, 22); - toolStripDropDownButton1.Text = "Справочник"; + this.toolStripMenuItemCatalogs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.компонентыToolStripMenuItem, + this.пакетыДокументовToolStripMenuItem, + this.магазиныToolStripMenuItem}); + this.toolStripMenuItemCatalogs.Name = "toolStripMenuItemCatalogs"; + this.toolStripMenuItemCatalogs.Size = new System.Drawing.Size(94, 20); + this.toolStripMenuItemCatalogs.Text = "Справочники"; // // компонентыToolStripMenuItem // @@ -128,46 +129,54 @@ // // buttonRef // - buttonRef.Location = new Point(800, 222); - buttonRef.Name = "buttonRef"; - buttonRef.Size = new Size(141, 24); - buttonRef.TabIndex = 5; - buttonRef.Text = "Обновить список"; - buttonRef.UseVisualStyleBackColor = true; - buttonRef.Click += buttonRef_Click; + this.buttonRef.Location = new System.Drawing.Point(742, 158); + this.buttonRef.Name = "buttonRef"; + this.buttonRef.Size = new System.Drawing.Size(156, 23); + this.buttonRef.TabIndex = 6; + this.buttonRef.Text = "Обновить список"; + this.buttonRef.UseVisualStyleBackColor = true; + this.buttonRef.Click += new System.EventHandler(this.buttonRef_Click); // - // dataGridView + // магазиныToolStripMenuItem // - dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridView.Location = new Point(0, 26); - dataGridView.Name = "dataGridView"; - dataGridView.ReadOnly = true; - dataGridView.RowHeadersWidth = 51; - dataGridView.RowTemplate.Height = 24; - dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; - dataGridView.Size = new Size(763, 435); - dataGridView.TabIndex = 6; + this.магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; + this.магазиныToolStripMenuItem.Size = new System.Drawing.Size(183, 22); + this.магазиныToolStripMenuItem.Text = "Магазины"; + this.магазиныToolStripMenuItem.Click += new System.EventHandler(this.магазиныToolStripMenuItem_Click); + // + // buttonSupplyShop + // + this.buttonSupplyShop.Location = new System.Drawing.Point(742, 187); + this.buttonSupplyShop.Name = "buttonSupplyShop"; + this.buttonSupplyShop.Size = new System.Drawing.Size(156, 23); + this.buttonSupplyShop.TabIndex = 7; + this.buttonSupplyShop.Text = "Пополнение магазина"; + this.buttonSupplyShop.UseVisualStyleBackColor = true; + this.buttonSupplyShop.Click += new System.EventHandler(this.buttonSupplyShop_Click); // // FormMain // - AutoScaleDimensions = new SizeF(7F, 15F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(969, 461); - Controls.Add(dataGridView); - Controls.Add(buttonRef); - Controls.Add(buttonIssuedOrder); - Controls.Add(buttonOrderReady); - Controls.Add(buttonTakeOrderInWork); - Controls.Add(buttonCreateOrder); - Controls.Add(toolStrip1); - Name = "FormMain"; - Text = "Юридическая фирма"; - Load += FormMain_Load; - toolStrip1.ResumeLayout(false); - toolStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); - ResumeLayout(false); - PerformLayout(); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(910, 477); + this.Controls.Add(this.buttonSupplyShop); + this.Controls.Add(this.buttonRef); + this.Controls.Add(this.buttonIssuedOrder); + this.Controls.Add(this.buttonOrderReady); + this.Controls.Add(this.buttonTakeOrderInWork); + this.Controls.Add(this.buttonCreateOrder); + this.Controls.Add(this.dataGridView); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Name = "FormMain"; + this.Text = "FormMain"; + this.Load += new System.EventHandler(this.FormMain_Load); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion @@ -182,9 +191,7 @@ private Button buttonOrderReady; private Button buttonIssuedOrder; private Button buttonRef; - private DataGridView dataGridView; - private ToolStripDropDownButton toolStripDropDownButton1; - private ToolStripMenuItem компонентыToolStripMenuItem; - private ToolStripMenuItem ПутёвкиToolStripMenuItem; + private ToolStripMenuItem магазиныToolStripMenuItem; + private Button buttonSupplyShop; } } \ No newline at end of file diff --git a/LawFirm/LawFirm/FormMain.cs b/LawFirm/LawFirm/FormMain.cs index 9b26e73..bcfbaf6 100644 --- a/LawFirm/LawFirm/FormMain.cs +++ b/LawFirm/LawFirm/FormMain.cs @@ -164,5 +164,35 @@ namespace LawFirmView { LoadData(); } + private OrderBindingModel CreateBindingModel(int id, bool isDone = false) + { + return new OrderBindingModel + { + Id = id, + DocumentId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["DocumentId"].Value), + Status = Enum.Parse(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), + Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value), + Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), + DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), + }; + } + + private void buttonSupplyShop_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormShopSupply)); + if (service is FormShopSupply form) + { + form.ShowDialog(); + } + } + + private void магазиныToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormShops)); + if (service is FormShops form) + { + form.ShowDialog(); + } + } } } diff --git a/LawFirm/LawFirm/Program.cs b/LawFirm/LawFirm/Program.cs index afdb8d6..33bc432 100644 --- a/LawFirm/LawFirm/Program.cs +++ b/LawFirm/LawFirm/Program.cs @@ -36,17 +36,22 @@ namespace LawFirmView }); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } } diff --git a/LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs b/LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs index 74b3d30..c556131 100644 --- a/LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs +++ b/LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs @@ -6,16 +6,9 @@ using System.Threading.Tasks; namespace LawFirmContracts.SearchModels { -<<<<<<<< HEAD:LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs - public class ShopSearchModel - { - public int? Id { get; set; } - public string? ShopName { get; set; } -======== public class DocumentSearchModel { public int? Id { get; set; } public string? DocumentName { get; set; } ->>>>>>>> lab1:LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs } } diff --git a/LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs b/LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs index 74b3d30..fa7522f 100644 --- a/LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs +++ b/LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs @@ -6,16 +6,9 @@ using System.Threading.Tasks; namespace LawFirmContracts.SearchModels { -<<<<<<<< HEAD:LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs public class ShopSearchModel { public int? Id { get; set; } public string? ShopName { get; set; } -======== - public class DocumentSearchModel - { - public int? Id { get; set; } - public string? DocumentName { get; set; } ->>>>>>>> lab1:LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs } } diff --git a/LawFirm/LawFirmListImplement/DataListSingleton.cs b/LawFirm/LawFirmListImplement/DataListSingleton.cs index 22abdaf..427f093 100644 --- a/LawFirm/LawFirmListImplement/DataListSingleton.cs +++ b/LawFirm/LawFirmListImplement/DataListSingleton.cs @@ -12,12 +12,14 @@ namespace LawFirmListImplement private static DataListSingleton? _instance; public List Components { get; set; } public List Orders { get; set; } - public List Laws { get; set; } + public List Documents { get; set; } + public List Shops { get; set; } private DataListSingleton() { Components = new List(); Orders = new List(); - Laws = new List(); + Documents = new List(); + Shops = new List(); } public static DataListSingleton GetInstance() {