예제 #1
0
        private void btnAddTour_Click(object sender, EventArgs e)
        {
            var dialog = new TourDetailDialog(_unitOfWork, null, _locations, _tourTypes);
            var check  = dialog.ShowDialog();

            if (check.Equals(DialogResult.OK))
            {
                MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadTours();
                SearchTour();
                LoadTourGridView(_selectedIndex);
            }
            dialog.Dispose();
        }
예제 #2
0
        private void btnEditTour_Click(object sender, EventArgs e)
        {
            var tour = _tours.Where(m => m.Id.Equals(Int32.Parse(gridViewTour.SelectedRows[0].Cells[0].Value.ToString()))).First();

            using (var dialog = new TourDetailDialog(_unitOfWork, tour, _locations, _tourTypes))
            {
                var check = dialog.ShowDialog();

                if (check.Equals(DialogResult.OK))
                {
                    MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LoadTours();
                    SearchTour();
                    LoadTourGridView(_selectedIndex);
                }
                dialog.Dispose();
            }
        }