Example #1
0
        private void btUpdate_Click(object sender, EventArgs e)
        {
            int currentRow = dgvTour.CurrentCellAddress.Y;

            if (-1 < currentRow && currentRow < dgvTour.RowCount)
            {
                TourDTO tourDTO = new TourDTO();
                tourDTO.ID         = tbID.Text;
                tourDTO.Ten        = tbName.Text;
                tourDTO.DacDiem    = tbDacDiem.Text;
                tourDTO.GiaTour    = Double.Parse(tbMoney.Text);
                tourDTO.IDLoaiHinh = cbLoaiHinh.SelectedValue.ToString();

                Result result = tourBUS.Update(tourDTO);
                if (result.Flag)
                {
                    MessageBox.Show("Cập nhật tour thành công", "Information", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Cập nhật tour thất bại\n Error: " + result.Message, "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }