Trờng đại học bách khoa Hà Nội
khoa công nghê thông tin
Bài tập thực tập chuyên ngành
đề tài quản lý bệnh xá của một trờng đại học
Giáo viên hớng dẫn:
Sinh viên:
Form ®iÒu trÞ bÖnh nh©n :
Cho biÕt toµn bé th«ng tin bÖnh nh©n vµ c¸ch ®iÒu trÞ
Private Sub cmdback_Click()
On Error Resume Next
Adodc1.Recordset.MovePrevious
End Sub
Private Sub cmdhuy_Click()
On Error Resume Next
Adodc1.Refresh
Adodc1.Recordset.Cancel
Adodc1.Recordset.CancelUpdate
Frame2.Visible = True
End Sub
Private Sub cmdluu_Click()
Adodc1.Recordset.Update
Adodc1.Recordset.UpdateBatch
Frame2.Visible = True
End Sub
Private Sub cmdnext_Click()
On Error Resume Next
Adodc1.Recordset.MoveNext
End Sub
Private Sub cmdthem_Click()
Adodc1.Recordset.AddNew
Frame2.Visible = False
End Sub
Private Sub cmdthoat_Click()
Unload Me
End Sub
Private Sub cmdxoa_Click()
On Error Resume Next
Adodc1.Recordset.Delete
End Sub
Private Sub Form_Load()
End Sub
Form Danh muc Bac si
Lu gi÷ th«ng tin vÒ c¸c b¸c sÜ hiÖn cã cña bÖnh x¸
Private Sub cmdback_Click()
On Error Resume Next
Adodc1.Recordset.MovePrevious
End Sub
Private Sub cmdcuoi_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub cmddau_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub cmdhuy_Click()
On Error Resume Next
Adodc1.Refresh
Adodc1.Recordset.Cancel
Adodc1.Recordset.CancelUpdate
End Sub
Private Sub cmdluu_Click()
Adodc1.Recordset.Update
Adodc1.Recordset.UpdateBatch
Frame2.Visible = True
End Sub
Private Sub cmdnext_Click()
On Error Resume Next
Adodc1.Recordset.MoveNext
End Sub
Private Sub cmdsua_Click()
bokhoa
End Sub
Private Sub cmdthem_Click()
bokhoa
Adodc1.Recordset.AddNew
Frame2.Visible = False
End Sub
Private Sub cmdthoat_Click()
Unload Me
End Sub
Private Sub cmdxoa_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub Form_Load()
khoa
End Sub
Private Sub khoa()
txtchucvu.Locked = True
txtten.Locked = True
txtngaysinh.Locked = True
txtgioitinh.Locked = True
txtma.Locked = True
End Sub
Private Sub bokhoa()
txtchucvu.Locked = False
txtten.Locked = False
txtngaysinh.Locked = False
txtgioitinh.Locked = False
txtma.Locked = False
End Sub
Form Danh muc Giang Vien
Lu th«ng tin gi¶ng viªn cña trêng ®Ó nhËn biÕt gi¸o viªn cña trêng ®Õn bÖnh x¸ nh»m t¹o
c¸c u tiªn giµnh riªng cho gi¸o viªn.
Private Sub cmdback_Click()
On Error Resume Next
Adodc1.Recordset.MovePrevious
End Sub
Private Sub cmdcuoi_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub cmddau_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub cmdhuy_Click()
On Error Resume Next
Adodc1.Refresh
Adodc1.Recordset.Cancel
Adodc1.Recordset.CancelUpdate
Frame2.Visible = True
End Sub
Private Sub cmdluu_Click()
Adodc1.Recordset.Update
Adodc1.Recordset.UpdateBatch
Frame2.Visible = True
End Sub
Private Sub cmdnext_Click()
On Error Resume Next
Adodc1.Recordset.MoveNext
End Sub
Private Sub khoa()
txtma.Locked = True
txtten.Locked = True
txtngaysinh.Locked = True
txtgioitinh.Locked = True
txtdiachi.Locked = True
txtkhoa.Locked = True
txtbomon.Locked = True
End Sub
Private Sub bokhoa()
txtma.Locked = False
txtten.Locked = False
txtngaysinh.Locked = False
txtgioitinh.Locked = False
txtdiachi.Locked = False
txtkhoa.Locked = False
txtbomon.Locked = False
End Sub
Private Sub cmdsua_Click()
khoa
End Sub
Private Sub cmdthem_Click()
bokhoa
Adodc1.Recordset.AddNew
Frame2.Visible = False
End Sub
Private Sub cmdthoat_Click()
Unload Me
End Sub
Private Sub cmdxoa_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub Form_Load()
khoa
cmdthem.Enabled = False
End Sub
Th«ng tin vÒ thuèc
Private Sub cmdback_Click()
On Error Resume Next
Adodc1.Recordset.MovePrevious
End Sub
Private Sub cmdhuy_Click()
On Error Resume Next
Adodc1.Refresh
Adodc1.Recordset.Cancel
Adodc1.Recordset.CancelUpdate
Frame2.Visible = True
End Sub
Private Sub cmdluu_Click()
Adodc1.Recordset.Update
Adodc1.Recordset.UpdateBatch
Frame2.Visible = True
End Sub
Danh môc thuèc
Private Sub cmdnext_Click()
On Error Resume Next
Adodc1.Recordset.MoveNext
End Sub
Private Sub cmdthem_Click()
Adodc1.Recordset.AddNew
Frame2.Visible = False
End Sub
Private Sub cmdthoat_Click()
Unload Me
End Sub
Private Sub cmdxoa_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub Form_Load()
End Sub
Kh¸m bÖnh
®©y lµ form dïng thêng xuyªn nhÊt ®Ó cËp nhËt kiÓm tra bÖnh nh©n ®Õn bÖnh x¸
Private Sub cmdhuy_Click()
On Error Resume Next
Adodc1.Refresh
Adodc1.Recordset.Cancel
Adodc1.Recordset.CancelUpdate
Frame2.Visible = True
End Sub
Private Sub cmdluu_Click()
Adodc1.Recordset.Update
Adodc1.Recordset.UpdateBatch
Frame2.Visible = True
End Sub
Private Sub cmdsua_Click()
bokhoa
End Sub
Private Sub cmdthem_Click()
bokhoa
Adodc1.Recordset.AddNew
Frame2.Visible = False
End Sub
Private Sub cmdthoat_Click()
Unload Me
End Sub
Private Sub cmdxoa_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub Command1_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub Command3_Click()
On Error Resume Next
Adodc1.Recordset.MovePrevious
End Sub
Private Sub Command4_Click()
On Error Resume Next
Adodc1.Recordset.MoveNext
End Sub
Private Sub khoa()
txtdoituong.Locked = True
txtma.Locked = True
txtten.Locked = True
txtkhoa.Locked = True
txtkhoahoc.Locked = True
txtlop.Locked = True
txtgioitinh.Locked = True
txtngaykham.Locked = True
txttrieuchung.Locked = True
txtketluan.Locked = True
End Sub
Private Sub bokhoa()
txtdoituong.Locked = False
txtma.Locked = False
txtten.Locked = False
txtkhoa.Locked = False
txtkhoahoc.Locked = False
txtlop.Locked = False
txtgioitinh.Locked = False
txtngaykham.Locked = False
txttrieuchung.Locked = False
txtketluan.Locked = False
End Sub
Private Sub Form_Load()
khoa
End Sub
Private Sub txtmabs_LostFocus()
AdoBS.Recordset.MoveFirst
AdoBS.Recordset.Find "mabacsy='" & Trim(txtmabs.Text) & "'"
If AdoBS.Recordset.EOF Then
MsgBox "Ban khong duoc nhap moi"
Else
txttenBS.Text = AdoBS.Recordset.Fields("tenbacsy")
End If
End Sub
Tìm kiếm
Tìm kiếm các bệnh nhân đến đã khám ở bệnh xá nhằm cho các mục đích riêng biệt theo
nhu cầu.Tìm kiếm có thể theo mã, theo ngày,theo tên hay theo khoa.
Private Sub TabStrip1_Click()
End Sub
Private Sub cmdin1_Click()
De1.rsKhambenh.Filter = "ma='" & Trim(txtloc1.Text) & "'"
RPT_KhamBenh.Show
End Sub
Private Sub cmdin2_Click()
De1.rsKhambenh.Filter = "ngaykham=#" & (txtloc2.Text) & "#"
RPT_KhamBenh.Show
End Sub
Private Sub cmdin3_Click()
De1.rsKhambenh.Filter = "ten='" & Trim(txtloc3.Text) & "'"
RPT_KhamBenh.Show
End Sub
Private Sub cmdin4_Click()
De1.rsKhambenh.Filter = "khoa='" & Trim(txtloc4.Text) & "'"
RPT_KhamBenh.Show
End Sub
Private Sub cmdthuchien1_Click()
Adodc1.RecordSource = "Select * from khambenh where ma='" & Trim(txtloc1.Text) &
"'"
Adodc1.Refresh
End Sub
Private Sub cmdthuchien2_Click()
Adodc1.RecordSource = "Select * from khambenh where ngaykham=#" & (txtloc2.Text)
& "#"
Adodc1.Refresh
End Sub
Private Sub cmdthuchien3_Click()
Adodc1.RecordSource = "Select * from khambenh where ten='" & Trim(txtloc3.Text) &
"'"
Adodc1.Refresh
End Sub
Private Sub cmdthuchien4_Click()
Adodc1.RecordSource = "Select * from khambenh where khoa='" & Trim(txtloc4.Text) &
"'"
Adodc1.Refresh
End Sub
Private Sub Command2_Click()
Adodc1.RecordSource = "Select * from khambenh"
Adodc1.Refresh
End Sub
Private Sub Command3_Click()
Adodc1.RecordSource = "Select * from khambenh"
Adodc1.Refresh
End Sub
Private Sub Command6_Click()
Adodc1.RecordSource = "Select * from khambenh"
Adodc1.Refresh
End Sub
Private Sub Command9_Click()
Adodc1.RecordSource = "Select * from khambenh"
Adodc1.Refresh
End Sub
Private Sub Form_Load()
End Sub
Danh s¸ch sinh viªn
Lu th«ng tin vÒ sinh viªn trong trêng
Private Sub cmdback_Click()
On Error Resume Next
Adodc1.Recordset.MovePrevious
End Sub
Private Sub cmdcuoi_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub cmddau_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub cmdhuy_Click()
On Error Resume Next
Adodc1.Refresh
Adodc1.Recordset.Cancel
Adodc1.Recordset.CancelUpdate
Frame1.Visible = True
End Sub
Private Sub cmdluu_Click()
Adodc1.Recordset.Update
Adodc1.Recordset.UpdateBatch
Frame1.Visible = True
End Sub
Private Sub cmdnext_Click()
On Error Resume Next
Adodc1.Recordset.MoveNext
End Sub
Private Sub cmdsua_Click()
bokhoa
End Sub
Private Sub cmdthem_Click()
bokhoa
Adodc1.Recordset.AddNew
Frame1.Visible = False
End Sub
Private Sub cmdthoat_Click()
Unload Me
End Sub
Private Sub cmdxoa_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub khoa()
txtma.Locked = True
txtten.Locked = True
txtgioitinh.Locked = True
txtngaysinh.Locked = True
txtdiachi.Locked = True
End Sub
Private Sub bokhoa()
txtma.Locked = False
txtten.Locked = False
txtgioitinh.Locked = False
txtngaysinh.Locked = False
txtdiachi.Locked = False
End Sub
Private Sub Form_Load()
khoa
cmdthem.Enabled = False
End Sub
Dïng dataEnvironment ®Ó t¹o truy vÊn cho b¸o c¸o
B¸o c¸o vÒ th«ng tin sinh viªn
B¸o c¸o vÒ th«ng tin kh¸m bÖnh ®Ó in