毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 医学论文 >> 正文

医生处方系统论文+源程序 第19页

更新时间:2009-5-21:  来源:毕业论文
医生处方系统论文
 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
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。