Exemplo n.º 1
0
        private void bntThemDV_Click(object sender, EventArgs e)
        {
            DichVuDTO dichVuDTO = new DichVuDTO();

            dichVuDTO._Ma           = int.Parse(gridDV.CurrentRow.Cells[0].Value.ToString());
            dichVuDTO._Ten          = txtTenDV.Text;
            dichVuDTO._Donvitinh    = txtDonvi.Text;
            dichVuDTO._Maloaidichvu = int.Parse(cbmLoai.SelectedValue.ToString());
            dichVuDTO._Gia          = float.Parse(txtGia.Text);
            DichVuBUS dichVuBUS = new DichVuBUS();

            if (dichVuBUS.ThemDV(dichVuDTO))
            {
                MessageBoxDS m = new MessageBoxDS();
                MessageBoxDS.thongbao = "Thêm dịch vụ thành công";
                MessageBoxDS.maHinh   = 1;
                m.ShowDialog();
                DichVuvaLoaiDichVu_Load(sender, e);
            }
            else
            {
                MessageBoxDS m = new MessageBoxDS();
                MessageBoxDS.thongbao = "Thêm dịch vụ thất bại";
                MessageBoxDS.maHinh   = 3;
                m.ShowDialog();
            }
        }