ПИбд-23 Захаров Ростислав Андреевич Лабораторная работа №5 усложненная #15
@ -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)
|
||||
|
@ -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>();
|
||||
|
Loading…
Reference in New Issue
Block a user