医生处方系统论文
Throw ex
End Try
Dispose(Conn)
Return ds
End Function
''' <summary>
''' 事务Sql 2个sql
''' </summary>
''' <param name="sql1"></param>
''' <param name="sql2"></param>
''' <remarks></remarks>
Public Function TRunsql(ByVal sql1 As String, ByVal sql2 As String) As String
Dim Message As String = ""
Dim Conn As SqlConnection
Dim traName As String = "ST"
Conn = New SqlConnection(connStr)
Conn.Open()
Dim cmd As New SqlCommand
Dim myTrans As SqlTransaction
myTrans = Conn.BeginTransaction(IsolationLevel.ReadCommitted, traName)
cmd.Connection = Conn
cmd.Transaction = myTrans
Try
cmd.CommandText = sql1
cmd.ExecuteNonQuery()
cmd.CommandText = sql2
cmd.ExecuteNonQuery()
myTrans.Commit()
Catch ex As Exception
myTrans.Rollback(traName)
Message += ex.Message
Finally
Conn.Close()
myTrans = Nothing
Conn = Nothing
cmd = Nothing
End Try
Return Message
End Function
''' <summary>
''' 事务sql 3个sql
''' </summary>
''' <param name="sql1"></param>
''' <param name="sql2"></param>
''' <param name="sql3"></param>
''' <remarks></remarks>
Public Function TRunsql1(ByVal sql1 As String, ByVal sql2 As String, ByVal sql3 As String) As String
Dim Message As String = ""
Dim Conn As SqlConnection
Dim traName As String = "ST"
Conn = New SqlConnection(connStr)
Conn.Open()
Dim cmd As New SqlCommand
Dim myTrans As SqlTransaction
myTrans = Conn.BeginTransaction(IsolationLevel.ReadCommitted, traName)
cmd.Connection = Conn
cmd.Transaction = myTrans
Try
cmd.CommandText = sql1
cmd.ExecuteNonQuery()
cmd.CommandText = sql2
cmd.ExecuteNonQuery()
cmd.CommandText = sql3
cmd.ExecuteNonQuery()
myTrans.Commit()
Catch ex As Exception
myTrans.Rollback(traName)
Message += ex.Message
Finally
Conn.Close()
myTrans = Nothing
Conn = Nothing
cmd = Nothing
End Try
Return Message
End Function
''' <summary>
''' 事务sql 4个sql
''' </summary>
''' <param name="sql1"></param>
''' <param name="sql2"></param>
''' <param name="sql3"></param>
''' <param name="sql4"></param>
''' <remarks></remarks>
Public Function TRunsql2(ByVal sql1 As String, ByVal sql2 As String, ByVal sql3 As String, ByVal sql4 As String) As String
Dim Conn As SqlConnection
Dim Message As String = ""
Dim traName As String = "ST"
Conn = New SqlConnection(connStr)
Conn.Open()
Dim cmd As New SqlCommand
Dim myTrans As SqlTransaction
myTrans = Conn.BeginTransaction(IsolationLevel.ReadCommitted, traName)
cmd.Connection = Conn
cmd.Transaction = myTrans
Try
cmd.CommandText = sql1
cmd.ExecuteNonQuery()
cmd.CommandText = sql2
cmd.ExecuteNonQuery()
cmd.CommandText = sql2
cmd.ExecuteNonQuery()
cmd.CommandText = sql3
cmd.ExecuteNonQuery()
cmd.CommandText = sql4
cmd.ExecuteNonQuery()
myTrans.Commit()
Catch ex As Exception
myTrans.Rollback(traName)
Message += ex.Message
Finally
Conn.Close()
myTrans = Nothing
Conn = Nothing
cmd = Nothing
End Try
Return Message
End Function
End Class
End Namespace
代码2主窗体代码事件
public Class FormMain
Private Sub miIllBioSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miIllBioSearch.Click
FormBiographySearch.Show()
End Sub
Private Sub miIllnessSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miIllnessSearch.Click
FormIllnessSearch.Show()
End Sub
Private Sub miIllnessSet_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles miIllnessSet.Click
FormIllnessSet.Show()
End Sub
Private Sub imClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles imClose.Click
Dim myReturn As DialogResult
myReturn = Windows.Forms.MessageBox.Show("确定要退出系统吗?", "退出系统", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
If myReturn = Windows.Forms.DialogResult.OK Then
Application.Exit()
End If
www.751com.cn sender As Object, ByVal e As System.EventArgs) Handles imYear.Click
FormYear.Show()
End Sub
Private Sub imDrugInster_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles imDrugInster.Click
FormDrug.Show()
End Sub
Private Sub imPrescription_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles imPrescription.Click
FormDrughelp.Show()
End Sub
Private Sub imDrugSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles imDrugSearch.Click
FormTreatment.Show()
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>
医生处方系统论文+源程序 第19页下载如图片无法显示或论文不完整,请联系qq752018766