ПИбд-23 Захаров Ростислав Андреевич Лабораторная работа №5 усложненная #15

Closed
Zakharov_Rostislav wants to merge 34 commits from lab-5-hard into lab-5
2 changed files with 4 additions and 22 deletions
Showing only changes of commit 3afd79ecf8 - Show all commits

View File

@ -75,32 +75,14 @@ namespace BlacksmithWorkshop
}
private OrderBindingModel CreateBindingModel(int id, bool isDone = false)
{
String? status = dataGridView.SelectedRows[0].Cells["Status"].Value.ToString();
String? sum = dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString();
String? dateCreate = dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString();
if (status == null)
{
MessageBox.Show("Ошибка при создании модели");
throw new ArgumentNullException(nameof(status));
}
if (sum == null)
{
MessageBox.Show("Ошибка при создании модели");
throw new ArgumentNullException(nameof(sum));
}
if (dateCreate == null)
{
MessageBox.Show("Ошибка при создании модели");
throw new ArgumentNullException(nameof(dateCreate));
}
return new OrderBindingModel
{
Id = id,
ManufactureId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["ManufactureId"].Value),
Status = Enum.Parse<OrderStatus>(status),
Status = Enum.Parse<OrderStatus>(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(sum),
DateCreate = DateTime.Parse(dateCreate),
Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
};
}
private void TakeInWorkButton_Click(object sender, EventArgs e)

View File

@ -37,10 +37,10 @@ namespace BlacksmithWorkshop
services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IManufactureStorage, ManufactureStorage>();
services.AddTransient<IShopStorage, ShopStorage>();
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IManufactureLogic, ManufactureLogic>();
services.AddTransient<IShopStorage, ShopStorage>();
services.AddTransient<IShopLogic, ShopLogic>();
services.AddTransient<FormMain>();
services.AddTransient<FormComponent>();