diff --git a/project/ProjectTourAgency/Forms/FormClientTour.Designer.cs b/project/ProjectTourAgency/Forms/FormClientTour.Designer.cs index 756c404..f6cd115 100644 --- a/project/ProjectTourAgency/Forms/FormClientTour.Designer.cs +++ b/project/ProjectTourAgency/Forms/FormClientTour.Designer.cs @@ -103,6 +103,7 @@ buttonCancel.TabIndex = 10; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += buttonCancel_Click; // // buttonSave // diff --git a/project/ProjectTourAgency/Forms/FormClientTour.cs b/project/ProjectTourAgency/Forms/FormClientTour.cs index 20f78f1..05576cf 100644 --- a/project/ProjectTourAgency/Forms/FormClientTour.cs +++ b/project/ProjectTourAgency/Forms/FormClientTour.cs @@ -55,16 +55,18 @@ namespace ProjectTourAgency.Forms private List CreateListClientTourFromDataGrid() { var list = new List(); - foreach(DataGridViewRow row in dataGridViewReceipts.Rows) + foreach (DataGridViewRow row in dataGridViewReceipts.Rows) { if (row.Cells["ColumnTour"].Value == null || row.Cells["ColumnReceipt"].Value == null) { continue; } - - list.Add(Receipt.CreateEntity((int)comboBoxClientId.SelectedValue!,Convert.ToInt32(ColumnTour.ValueMember),0,0)); + + list.Add(Receipt.CreateEntity((int)comboBoxClientId.SelectedValue!, Convert.ToInt32(ColumnTour.ValueMember), 0, 0)); } return list; } + + private void buttonCancel_Click(object sender, EventArgs e) => Close(); } }