diff --git a/SushiBar/SushiBar/FormCreateTask.cs b/SushiBar/SushiBar/FormCreateTask.cs index 9db435f..7be33c8 100644 --- a/SushiBar/SushiBar/FormCreateTask.cs +++ b/SushiBar/SushiBar/FormCreateTask.cs @@ -108,6 +108,7 @@ namespace SushiBarView { if (form.ShowDialog() == DialogResult.OK) { + if (form.MenuModel == null) { return; @@ -187,11 +188,15 @@ namespace SushiBarView PlaceId = comboBoxPlace.SelectedIndex + 1, TaskMenus = _taskMenu }; + DateTime start = DateTime.Now; + var operationResult = _id.HasValue ? _logicT.Update(model) : _logicT.Create(model); if (!operationResult) { throw new Exception("Ошибка при сохранении. Доп информация в логах"); } + DateTime stop = DateTime.Now; + MessageBox.Show((stop - start).ToString(), "Test", MessageBoxButtons.OK); MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; Close(); diff --git a/SushiBar/SushiBar/FormMain.cs b/SushiBar/SushiBar/FormMain.cs index 90a0cae..13d893a 100644 --- a/SushiBar/SushiBar/FormMain.cs +++ b/SushiBar/SushiBar/FormMain.cs @@ -69,7 +69,12 @@ namespace SushiBarView private void LoadData() { + DateTime start = DateTime.Now; + + var _list = _logic.ReadList(null); + DateTime stop = DateTime.Now; + MessageBox.Show((stop - start).ToString(), "Test", MessageBoxButtons.OK); if (_list != null) { dataGridView.DataSource = _list; @@ -168,20 +173,16 @@ namespace SushiBarView private void buttonTest_Click(object sender, EventArgs e) { - CookBindingModel model = new CookBindingModel() + TaskBindingModel model = new TaskBindingModel() { - Id = 2, - CookName = "Иван", - CookSurname = "dssfsdfs", - Experience = 2, - PhoneNumber = "+79054324312", - Passport = "123124" + Id = 1 }; DateTime start = DateTime.Now; - _CLogic.Delete(model); + _logic.Delete(model); + DateTime stop = DateTime.Now; - MessageBox.Show((start - stop).ToString(), "Test", MessageBoxButtons.OK); + MessageBox.Show((stop - start).ToString(), "Test", MessageBoxButtons.OK); } } } diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/CookLogic.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/CookLogic.cs index 7bfa486..4bfc022 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/CookLogic.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/CookLogic.cs @@ -56,7 +56,6 @@ namespace SushiBarBusinessLogic.BusinessLogics public bool Delete(CookBindingModel model) { - CheckModel(model, false); if (_cookStorage.Delete(model) == null) { return false;