правочка
This commit is contained in:
parent
cb96c3be39
commit
0d657d919f
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
|
||||
public bool Delete(CookBindingModel model)
|
||||
{
|
||||
CheckModel(model, false);
|
||||
if (_cookStorage.Delete(model) == null)
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user