From e939295746f8a84b5f04bae19931b414978c17e0 Mon Sep 17 00:00:00 2001 From: "nastya.girl.22@mail.ru" Date: Wed, 26 Apr 2023 09:58:57 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/OrderStorage.cs | 8 +- LawFirm/LawFirmView/FormComponent.Designer.cs | 114 ++++++------- LawFirm/LawFirmView/FormComponent.cs | 6 +- .../LawFirmView/FormCreateOrder.Designer.cs | 155 +++++++++--------- LawFirm/LawFirmView/FormCreateOrder.cs | 4 +- LawFirm/LawFirmView/FormDocument.Designer.cs | 6 +- .../FormDocumentComponent.Designer.cs | 6 +- 7 files changed, 154 insertions(+), 145 deletions(-) diff --git a/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs b/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs index 14d0d60..abec7de 100644 --- a/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs +++ b/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs @@ -18,7 +18,7 @@ namespace LawFirmFileImplement.Implements { source = DataFileSingleton.GetInstance(); } - private OrderViewModel AddManufactureName(OrderViewModel model) + private OrderViewModel AddDocumentName(OrderViewModel model) { model.DocumentName = source.Documents.SingleOrDefault(x => x.Id == model.DocumentId)?.DocumentName ?? string.Empty; return model; @@ -26,7 +26,7 @@ namespace LawFirmFileImplement.Implements public List GetFullList() { return source.Orders - .Select(x => AddManufactureName(x.GetViewModel)) + .Select(x => AddDocumentName(x.GetViewModel)) .ToList(); } public List GetFilteredList(OrderSearchModel model) @@ -37,7 +37,7 @@ namespace LawFirmFileImplement.Implements } return source.Orders .Where(x => x.Id == model.Id) - .Select(x => AddManufactureName(x.GetViewModel)) + .Select(x => AddDocumentName(x.GetViewModel)) .ToList(); } public OrderViewModel? GetElement(OrderSearchModel model) @@ -51,7 +51,7 @@ namespace LawFirmFileImplement.Implements { return null; } - return AddManufactureName(order); + return AddDocumentName(order); } public OrderViewModel? Insert(OrderBindingModel model) { diff --git a/LawFirm/LawFirmView/FormComponent.Designer.cs b/LawFirm/LawFirmView/FormComponent.Designer.cs index 42c81ad..b3fb4a7 100644 --- a/LawFirm/LawFirmView/FormComponent.Designer.cs +++ b/LawFirm/LawFirmView/FormComponent.Designer.cs @@ -28,82 +28,86 @@ /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.buttonSave = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.textBoxName = new System.Windows.Forms.TextBox(); - this.textBoxCost = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); + label1 = new Label(); + label2 = new Label(); + buttonSave = new Button(); + buttonCancel = new Button(); + textBoxName = new TextBox(); + textBoxCost = new TextBox(); + SuspendLayout(); // // label1 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 18); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(62, 15); - this.label1.TabIndex = 0; - this.label1.Text = "Название:"; + label1.AutoSize = true; + label1.Location = new Point(14, 24); + label1.Name = "label1"; + label1.Size = new Size(80, 20); + label1.TabIndex = 0; + label1.Text = "Название:"; // // label2 // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 46); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(38, 15); - this.label2.TabIndex = 1; - this.label2.Text = "Цена:"; + label2.AutoSize = true; + label2.Location = new Point(14, 61); + label2.Name = "label2"; + label2.Size = new Size(48, 20); + label2.TabIndex = 1; + label2.Text = "Цена:"; // // buttonSave // - this.buttonSave.Location = new System.Drawing.Point(181, 80); - this.buttonSave.Name = "buttonSave"; - this.buttonSave.Size = new System.Drawing.Size(75, 23); - this.buttonSave.TabIndex = 2; - this.buttonSave.Text = "Сохранить"; - this.buttonSave.UseVisualStyleBackColor = true; - this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click); + buttonSave.Location = new Point(183, 107); + buttonSave.Margin = new Padding(3, 4, 3, 4); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(99, 31); + buttonSave.TabIndex = 2; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; // // buttonCancel // - this.buttonCancel.Location = new System.Drawing.Point(262, 80); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 3; - this.buttonCancel.Text = "Отмена"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); + buttonCancel.Location = new Point(288, 107); + buttonCancel.Margin = new Padding(3, 4, 3, 4); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(97, 31); + buttonCancel.TabIndex = 3; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; // // textBoxName // - this.textBoxName.Location = new System.Drawing.Point(80, 15); - this.textBoxName.Name = "textBoxName"; - this.textBoxName.Size = new System.Drawing.Size(257, 23); - this.textBoxName.TabIndex = 4; + textBoxName.Location = new Point(91, 20); + textBoxName.Margin = new Padding(3, 4, 3, 4); + textBoxName.Name = "textBoxName"; + textBoxName.Size = new Size(293, 27); + textBoxName.TabIndex = 4; // // textBoxCost // - this.textBoxCost.Location = new System.Drawing.Point(80, 43); - this.textBoxCost.Name = "textBoxCost"; - this.textBoxCost.Size = new System.Drawing.Size(127, 23); - this.textBoxCost.TabIndex = 5; + textBoxCost.Location = new Point(91, 57); + textBoxCost.Margin = new Padding(3, 4, 3, 4); + textBoxCost.Name = "textBoxCost"; + textBoxCost.Size = new Size(145, 27); + textBoxCost.TabIndex = 5; // // FormComponent // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(356, 119); - this.Controls.Add(this.textBoxCost); - this.Controls.Add(this.textBoxName); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonSave); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Name = "FormComponent"; - this.Text = "Компонент"; - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(407, 159); + Controls.Add(textBoxCost); + Controls.Add(textBoxName); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(label2); + Controls.Add(label1); + Margin = new Padding(3, 4, 3, 4); + Name = "FormComponent"; + Text = "Компонент"; + ResumeLayout(false); + PerformLayout(); } #endregion diff --git a/LawFirm/LawFirmView/FormComponent.cs b/LawFirm/LawFirmView/FormComponent.cs index 73aec3d..7137639 100644 --- a/LawFirm/LawFirmView/FormComponent.cs +++ b/LawFirm/LawFirmView/FormComponent.cs @@ -17,11 +17,11 @@ namespace LawFirmView public partial class FormComponent : Form { private readonly ILogger _logger; - + private readonly IComponentLogic _logic; - + private int? _id; - + public int Id { set { _id = value; } } public FormComponent(ILogger logger, IComponentLogic logic) diff --git a/LawFirm/LawFirmView/FormCreateOrder.Designer.cs b/LawFirm/LawFirmView/FormCreateOrder.Designer.cs index 0743876..125ad8c 100644 --- a/LawFirm/LawFirmView/FormCreateOrder.Designer.cs +++ b/LawFirm/LawFirmView/FormCreateOrder.Designer.cs @@ -28,108 +28,113 @@ /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.comboBoxDocument = new System.Windows.Forms.ComboBox(); - this.textBoxCount = new System.Windows.Forms.TextBox(); - this.textBoxSum = new System.Windows.Forms.TextBox(); - this.buttonSave = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - this.Load += new System.EventHandler(this.FormCreateOrder_Load); + label1 = new Label(); + label2 = new Label(); + label3 = new Label(); + comboBoxDocument = new ComboBox(); + textBoxCount = new TextBox(); + textBoxSum = new TextBox(); + buttonSave = new Button(); + buttonCancel = new Button(); + SuspendLayout(); // // label1 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(56, 15); - this.label1.TabIndex = 0; - this.label1.Text = "Изделие:"; + label1.AutoSize = true; + label1.Location = new Point(14, 12); + label1.Name = "label1"; + label1.Size = new Size(71, 20); + label1.TabIndex = 0; + label1.Text = "Изделие:"; // // label2 // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 42); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(75, 15); - this.label2.TabIndex = 1; - this.label2.Text = "Количество:"; + label2.AutoSize = true; + label2.Location = new Point(14, 56); + label2.Name = "label2"; + label2.Size = new Size(93, 20); + label2.TabIndex = 1; + label2.Text = "Количество:"; // // label3 // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(12, 74); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(48, 15); - this.label3.TabIndex = 2; - this.label3.Text = "Сумма:"; + label3.AutoSize = true; + label3.Location = new Point(14, 99); + label3.Name = "label3"; + label3.Size = new Size(58, 20); + label3.TabIndex = 2; + label3.Text = "Сумма:"; // // comboBoxDocument // - this.comboBoxDocument.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxDocument.FormattingEnabled = true; - this.comboBoxDocument.Location = new System.Drawing.Point(93, 6); - this.comboBoxDocument.Name = "comboBoxDocument"; - this.comboBoxDocument.Size = new System.Drawing.Size(270, 23); - this.comboBoxDocument.TabIndex = 5; - this.comboBoxDocument.SelectedIndexChanged += new System.EventHandler(this.ComboBoxDocument_SelectedIndexChanged); + comboBoxDocument.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxDocument.FormattingEnabled = true; + comboBoxDocument.Location = new Point(106, 8); + comboBoxDocument.Margin = new Padding(3, 4, 3, 4); + comboBoxDocument.Name = "comboBoxDocument"; + comboBoxDocument.Size = new Size(308, 28); + comboBoxDocument.TabIndex = 5; + comboBoxDocument.SelectedIndexChanged += ComboBoxDocument_SelectedIndexChanged; // // textBoxCount // - this.textBoxCount.Location = new System.Drawing.Point(93, 39); - this.textBoxCount.Name = "textBoxCount"; - this.textBoxCount.Size = new System.Drawing.Size(270, 23); - this.textBoxCount.TabIndex = 4; - this.textBoxCount.TextChanged += new System.EventHandler(this.TextBoxCount_TextChanged); + textBoxCount.Location = new Point(106, 52); + textBoxCount.Margin = new Padding(3, 4, 3, 4); + textBoxCount.Name = "textBoxCount"; + textBoxCount.Size = new Size(308, 27); + textBoxCount.TabIndex = 4; + textBoxCount.TextChanged += TextBoxCount_TextChanged; // // textBoxSum // - this.textBoxSum.Location = new System.Drawing.Point(93, 71); - this.textBoxSum.Name = "textBoxSum"; - this.textBoxSum.ReadOnly = true; - this.textBoxSum.Size = new System.Drawing.Size(270, 23); - this.textBoxSum.TabIndex = 5; + textBoxSum.Location = new Point(106, 95); + textBoxSum.Margin = new Padding(3, 4, 3, 4); + textBoxSum.Name = "textBoxSum"; + textBoxSum.ReadOnly = true; + textBoxSum.Size = new Size(308, 27); + textBoxSum.TabIndex = 5; // // buttonSave // - this.buttonSave.Location = new System.Drawing.Point(207, 106); - this.buttonSave.Name = "buttonSave"; - this.buttonSave.Size = new System.Drawing.Size(75, 23); - this.buttonSave.TabIndex = 6; - this.buttonSave.Text = "Сохранить"; - this.buttonSave.UseVisualStyleBackColor = true; - this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click); + buttonSave.Location = new Point(222, 141); + buttonSave.Margin = new Padding(3, 4, 3, 4); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(93, 31); + buttonSave.TabIndex = 6; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; // // buttonCancel // - this.buttonCancel.Location = new System.Drawing.Point(288, 106); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 7; - this.buttonCancel.Text = "Отмена"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); + buttonCancel.Location = new Point(321, 141); + buttonCancel.Margin = new Padding(3, 4, 3, 4); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(94, 31); + buttonCancel.TabIndex = 7; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; // // FormCreateOrder // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(381, 141); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonSave); - this.Controls.Add(this.textBoxSum); - this.Controls.Add(this.textBoxCount); - this.Controls.Add(this.comboBoxDocument); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Name = "FormCreateOrder"; - this.Text = "Заказ"; - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(435, 188); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(textBoxSum); + Controls.Add(textBoxCount); + Controls.Add(comboBoxDocument); + Controls.Add(label3); + Controls.Add(label2); + Controls.Add(label1); + Margin = new Padding(3, 4, 3, 4); + Name = "FormCreateOrder"; + Text = "Заказ"; + Load += FormCreateOrder_Load; + ResumeLayout(false); + PerformLayout(); } #endregion diff --git a/LawFirm/LawFirmView/FormCreateOrder.cs b/LawFirm/LawFirmView/FormCreateOrder.cs index 7444f2d..afceca0 100644 --- a/LawFirm/LawFirmView/FormCreateOrder.cs +++ b/LawFirm/LawFirmView/FormCreateOrder.cs @@ -33,7 +33,7 @@ namespace LawFirmView private void FormCreateOrder_Load(object sender, EventArgs e) { _logger.LogInformation("Загрузка изделий для заказа"); - + var list = _logicD.ReadList(null); if (list != null) { @@ -118,7 +118,7 @@ namespace LawFirmView DialogResult = DialogResult.Cancel; Close(); } - + } } diff --git a/LawFirm/LawFirmView/FormDocument.Designer.cs b/LawFirm/LawFirmView/FormDocument.Designer.cs index fc9055a..3537975 100644 --- a/LawFirm/LawFirmView/FormDocument.Designer.cs +++ b/LawFirm/LawFirmView/FormDocument.Designer.cs @@ -189,10 +189,10 @@ // // buttonSave // - buttonSave.Location = new Point(431, 529); + buttonSave.Location = new Point(422, 529); buttonSave.Margin = new Padding(3, 4, 3, 4); buttonSave.Name = "buttonSave"; - buttonSave.Size = new Size(86, 31); + buttonSave.Size = new Size(95, 31); buttonSave.TabIndex = 5; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; @@ -203,7 +203,7 @@ buttonCancel.Location = new Point(523, 529); buttonCancel.Margin = new Padding(3, 4, 3, 4); buttonCancel.Name = "buttonCancel"; - buttonCancel.Size = new Size(86, 31); + buttonCancel.Size = new Size(98, 31); buttonCancel.TabIndex = 6; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; diff --git a/LawFirm/LawFirmView/FormDocumentComponent.Designer.cs b/LawFirm/LawFirmView/FormDocumentComponent.Designer.cs index f3d16ef..2b7f092 100644 --- a/LawFirm/LawFirmView/FormDocumentComponent.Designer.cs +++ b/LawFirm/LawFirmView/FormDocumentComponent.Designer.cs @@ -75,10 +75,10 @@ // // buttonSave // - buttonSave.Location = new Point(151, 108); + buttonSave.Location = new Point(140, 108); buttonSave.Margin = new Padding(3, 4, 3, 4); buttonSave.Name = "buttonSave"; - buttonSave.Size = new Size(86, 31); + buttonSave.Size = new Size(97, 31); buttonSave.TabIndex = 4; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; @@ -89,7 +89,7 @@ buttonCancel.Location = new Point(243, 108); buttonCancel.Margin = new Padding(3, 4, 3, 4); buttonCancel.Name = "buttonCancel"; - buttonCancel.Size = new Size(86, 31); + buttonCancel.Size = new Size(96, 31); buttonCancel.TabIndex = 5; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true;