Принятая лабораторная
This commit is contained in:
parent
11dc0231cb
commit
0daadb053c
@ -98,6 +98,5 @@ logic)
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,6 @@
|
||||
this.buttonSave = new System.Windows.Forms.Button();
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.textBoxSum = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
@ -121,23 +120,13 @@
|
||||
this.textBoxSum.ReadOnly = true;
|
||||
this.textBoxSum.Size = new System.Drawing.Size(446, 27);
|
||||
this.textBoxSum.TabIndex = 8;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(190, 217);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(94, 29);
|
||||
this.button1.TabIndex = 9;
|
||||
this.button1.Text = "button1";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
|
||||
//
|
||||
// FormCreateOrder
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(720, 257);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.textBoxSum);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.buttonSave);
|
||||
@ -148,7 +137,7 @@
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "FormCreateOrder";
|
||||
this.Text = "FormCreateOrder";
|
||||
this.Text = "Создание заказа";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -165,6 +154,5 @@
|
||||
private Button buttonSave;
|
||||
private Button buttonCancel;
|
||||
private TextBox textBoxSum;
|
||||
private Button button1;
|
||||
}
|
||||
}
|
@ -45,8 +45,7 @@ namespace BlacksmithWorkshop
|
||||
comboBoxManufacture.ValueMember = "Id";
|
||||
comboBoxManufacture.DataSource = _list;
|
||||
comboBoxManufacture.SelectedItem = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private void CalcSum()
|
||||
|
@ -151,7 +151,7 @@
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "FormMain";
|
||||
this.Text = "FormMain";
|
||||
this.Text = "Магазин кузнечных изделий";
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
|
@ -150,8 +150,7 @@ namespace BlacksmithWorkshop
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка отметки о готовности заказа");
|
||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,7 +199,6 @@ MessageBoxIcon.Error);
|
||||
LoadData();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,7 @@
|
||||
//
|
||||
this.textBoxPrice.Location = new System.Drawing.Point(156, 71);
|
||||
this.textBoxPrice.Name = "textBoxPrice";
|
||||
this.textBoxPrice.ReadOnly = true;
|
||||
this.textBoxPrice.Size = new System.Drawing.Size(204, 27);
|
||||
this.textBoxPrice.TabIndex = 3;
|
||||
//
|
||||
@ -203,7 +204,7 @@
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "FormManufacture";
|
||||
this.Text = "FormManufacture";
|
||||
this.Text = "Создание изделия";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
@ -167,7 +167,6 @@ pc.Value.Item1.ComponentName, pc.Value.Item2 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void ButtonRef_Click(object sender, EventArgs e)
|
||||
@ -240,6 +239,5 @@ MessageBoxIcon.Error);
|
||||
return Math.Round(price * 1.1, 2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@
|
||||
this.Controls.Add(this.buttonAdd);
|
||||
this.Controls.Add(this.dataGridView);
|
||||
this.Name = "FormManufactures";
|
||||
this.Text = "FormManufactures";
|
||||
this.Text = "Список изделий";
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
@ -60,14 +60,13 @@ namespace BlacksmithWorkshop
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ButtonUpd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
var service =
|
||||
Program.ServiceProvider?.GetService(typeof(FormComponent));
|
||||
if (service is FormComponent form)
|
||||
Program.ServiceProvider?.GetService(typeof(FormManufacture));
|
||||
if (service is FormManufacture form)
|
||||
{
|
||||
form.Id =
|
||||
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
|
@ -77,8 +77,8 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
|
||||
CheckModel(model);
|
||||
if(model.Status + 1 != newStatus)
|
||||
{
|
||||
|
||||
_logger.LogWarning("Status incorrected");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
@ -103,10 +103,8 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
|
||||
{
|
||||
|
||||
return UpdateStatus(model, OrderStatus.Выполняется);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void CheckModel(OrderBindingModel model, bool withParams =
|
||||
true)
|
||||
{
|
||||
@ -132,8 +130,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
|
||||
throw new ArgumentNullException("Неккоректный id изделия", nameof(model.Sum));
|
||||
}
|
||||
_logger.LogInformation("Order. OrderID:{ Id}, Count:{ Count}. Sum: { sum} ", model.Id, model.Count, model.Sum);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
namespace BlacksmithWorkshopBusinessLogic
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace BlacksmithWorkshopContracts
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace BlacksmithWorkshopDataModel
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace BlacksmithWorkshopListImplement
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user