Ejemplo n.º 1
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            TourDTO tourDTO = new TourDTO();

            tourDTO.ID         = tbID.Text;
            tourDTO.Ten        = tbName.Text;
            tourDTO.DacDiem    = tbCharacteristic.Text;
            tourDTO.GiaTour    = Double.Parse(tbMoney.Text);
            tourDTO.IDLoaiHinh = cbType.SelectedValue.ToString();

            Result result = tourBUS.Insert(tourDTO);

            if (result.Flag)
            {
                MessageBox.Show("Thêm tour mới thành công", "Information", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                ResetField();
            }

            else
            {
                MessageBox.Show("Thêm tour mới thất bại\n Error: " + result.Message, "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }