Example #1
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            string   maBN     = txtMaBN.Text;
            string   tenBN    = txtHoTen.Text;
            DateTime ngaySinh = dtpNgaySinh.Value;
            string   gioiTinh = "";

            if (radNam.Checked == true)
            {
                gioiTinh = "Nam";
            }
            else
            {
                gioiTinh = "Nữ";
            }
            string maBHXH = txtBHXH.Text;
            string maKhoa = cboKhoa.SelectedValue.ToString();

            BenhNhan bn = new BenhNhan(maBN, tenBN, ngaySinh, gioiTinh, maBHXH, maKhoa);

            BenhNhanBUL bnBUL = new BenhNhanBUL();

            if (bnBUL.Them(bn))
            {
                MessageBox.Show("Thêm bản ghi thành công!");
            }
            else
            {
                MessageBox.Show("Thêm bản ghi thất bại!");
            }
            ReLoad();
        }
Example #2
0
        private void btnBenhNhan_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Form form = IsActive(typeof(BenhNhan));

            if (form == null)
            {
                BenhNhan fm = new BenhNhan();
                fm.MdiParent = this;
                fm.Show();
            }
            else
            {
                form.Activate();
            }
        }