Compare commits

..

No commits in common. "main" and "postgres" have entirely different histories.

3 changed files with 10 additions and 15 deletions

View File

@ -108,7 +108,6 @@ namespace SushiBarView
{ {
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
{ {
if (form.MenuModel == null) if (form.MenuModel == null)
{ {
return; return;
@ -188,15 +187,11 @@ namespace SushiBarView
PlaceId = comboBoxPlace.SelectedIndex + 1, PlaceId = comboBoxPlace.SelectedIndex + 1,
TaskMenus = _taskMenu TaskMenus = _taskMenu
}; };
DateTime start = DateTime.Now;
var operationResult = _id.HasValue ? _logicT.Update(model) : _logicT.Create(model); var operationResult = _id.HasValue ? _logicT.Update(model) : _logicT.Create(model);
if (!operationResult) if (!operationResult)
{ {
throw new Exception("Ошибка при сохранении. Доп информация в логах"); throw new Exception("Ошибка при сохранении. Доп информация в логах");
} }
DateTime stop = DateTime.Now;
MessageBox.Show((stop - start).ToString(), "Test", MessageBoxButtons.OK);
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();

View File

@ -69,12 +69,7 @@ namespace SushiBarView
private void LoadData() private void LoadData()
{ {
DateTime start = DateTime.Now;
var _list = _logic.ReadList(null); var _list = _logic.ReadList(null);
DateTime stop = DateTime.Now;
MessageBox.Show((stop - start).ToString(), "Test", MessageBoxButtons.OK);
if (_list != null) if (_list != null)
{ {
dataGridView.DataSource = _list; dataGridView.DataSource = _list;
@ -173,16 +168,20 @@ namespace SushiBarView
private void buttonTest_Click(object sender, EventArgs e) private void buttonTest_Click(object sender, EventArgs e)
{ {
TaskBindingModel model = new TaskBindingModel() CookBindingModel model = new CookBindingModel()
{ {
Id = 1 Id = 2,
CookName = "Иван",
CookSurname = "dssfsdfs",
Experience = 2,
PhoneNumber = "+79054324312",
Passport = "123124"
}; };
DateTime start = DateTime.Now; DateTime start = DateTime.Now;
_logic.Delete(model); _CLogic.Delete(model);
DateTime stop = DateTime.Now; DateTime stop = DateTime.Now;
MessageBox.Show((stop - start).ToString(), "Test", MessageBoxButtons.OK); MessageBox.Show((start - stop).ToString(), "Test", MessageBoxButtons.OK);
} }
} }
} }

View File

@ -56,6 +56,7 @@ namespace SushiBarBusinessLogic.BusinessLogics
public bool Delete(CookBindingModel model) public bool Delete(CookBindingModel model)
{ {
CheckModel(model, false);
if (_cookStorage.Delete(model) == null) if (_cookStorage.Delete(model) == null)
{ {
return false; return false;