Заказы готовы, максимум осталось дату завершения добавить
This commit is contained in:
parent
c87d686110
commit
ac6ab33e2c
13
WinFormsApp/FormMain.Designer.cs
generated
13
WinFormsApp/FormMain.Designer.cs
generated
@ -34,6 +34,7 @@
|
||||
товарыToolStripMenuItem = new ToolStripMenuItem();
|
||||
поставщикиToolStripMenuItem = new ToolStripMenuItem();
|
||||
buttonSupplyStatusArriving = new Button();
|
||||
buttonSupplyStatusCompleted = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
menuStrip1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
@ -90,11 +91,22 @@
|
||||
buttonSupplyStatusArriving.UseVisualStyleBackColor = true;
|
||||
buttonSupplyStatusArriving.Click += buttonSupplyStatusArriving_Click;
|
||||
//
|
||||
// buttonSupplyStatusCompleted
|
||||
//
|
||||
buttonSupplyStatusCompleted.Location = new Point(707, 125);
|
||||
buttonSupplyStatusCompleted.Name = "buttonSupplyStatusCompleted";
|
||||
buttonSupplyStatusCompleted.Size = new Size(154, 23);
|
||||
buttonSupplyStatusCompleted.TabIndex = 4;
|
||||
buttonSupplyStatusCompleted.Text = "Поставка завершена";
|
||||
buttonSupplyStatusCompleted.UseVisualStyleBackColor = true;
|
||||
buttonSupplyStatusCompleted.Click += buttonSupplyStatusCompleted_Click;
|
||||
//
|
||||
// FormMain
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(901, 384);
|
||||
Controls.Add(buttonSupplyStatusCompleted);
|
||||
Controls.Add(buttonSupplyStatusArriving);
|
||||
Controls.Add(buttonCreateSupply);
|
||||
Controls.Add(dataGridView);
|
||||
@ -118,5 +130,6 @@
|
||||
private ToolStripMenuItem товарыToolStripMenuItem;
|
||||
private ToolStripMenuItem поставщикиToolStripMenuItem;
|
||||
private Button buttonSupplyStatusArriving;
|
||||
private Button buttonSupplyStatusCompleted;
|
||||
}
|
||||
}
|
@ -96,7 +96,35 @@ namespace WinFormsApp
|
||||
}, SupplyStatus.Arriving);
|
||||
if (!operationResult)
|
||||
{
|
||||
//throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
||||
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
||||
}
|
||||
LoadData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка передачи заказа в работу");
|
||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonSupplyStatusCompleted_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
Guid id = (Guid)dataGridView.SelectedRows[0].Cells["Id"].Value;
|
||||
_logger.LogInformation("Поставка No{id}. Меняется статус", id);
|
||||
try
|
||||
{
|
||||
var operationResult = _supplyLogic.StatusUpdate(new SupplyBindingModel
|
||||
{
|
||||
Id = id,
|
||||
Status = (SupplyStatus)dataGridView.SelectedRows[0].Cells["Status"].Value
|
||||
}, SupplyStatus.Completed);
|
||||
if (!operationResult)
|
||||
{
|
||||
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
||||
}
|
||||
LoadData();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user