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

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

更新时间:2009-5-21:  来源:毕业论文
医生处方系统论文
 dbobj.ReturnDataSet(strSql, ds)
        Me.DataGridView1.DataSource = ds.Tables(0)
    End Sub

    Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        Dim dbobj As New ConnSqlServer.db
        Dim Strno As String = txtNo.Text
        Dim sql As String = "Delete from Strdrug where Strno='" & Strno & "'"
        Dim strSql As String = "select * from Strdrug"
        Dim ds As New DataSet
        Dim strSql1 As String = "select Strno from Strdrug where Strno = '" & Me.txtNo.Text & "'"
        Dim myReturn As DialogResult
        Dim dr As System.Data.SqlClient.SqlDataReader
        dr = dbobj.DataReader(strSql1)
        If dr.Read() Then
                If txtNo.Text <> "" Then
                myReturn = Windows.Forms.MessageBox.Show("确定要删除资料吗?", "删除资料", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
                If myReturn = Windows.Forms.DialogResult.OK Then
                    dbobj.RunSql(sql)
                    MessageBox.Show("删除成功")
                    dbobj.ReturnDataSet(strSql, ds)
                    Me.DataGridView1.DataSource = ds.Tables(0)
                    Me.txtName.Text = ""
                    Me.txtNo.Text = ""
                    Me.txtAddress.Text = ""
                    Me.txtPrice.Text = ""
                    Me.txtNumber.Text = ""
                    Me.txtFun.Text = ""
                    Me.txtType.Text = ""
                End If
            Else
                MessageBox.Show("编号不能为空!")
            End If
        Else
            MessageBox.Show("无此编号")
        End If
    End Sub

    Private Sub btnUpdata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdata.Click
        Dim dbobj As New ConnSqlServer.db
        Dim Strno As String = txtNo.Text
        Dim sql As String = "Update Strdrug Set Strname='" & Me.txtName.Text & "', Strfun='" & Me.txtFun.Text & "', Strnumber='" & Me.txtNumber.Text & "', Strprice='" & Me.txtPrice.Text & "',Strtype='" & Me.txtType.Text & "',Straddress='" & Me.txtAddress.Text & "' where Strno='" & Strno & "'"
        Dim dr As System.Data.SqlClient.SqlDataReader
        Dim myReturn As DialogResult
        Dim ds As New DataSet
        dr = dbobj.DataReader(sql)
        Dim strSql As String = "select * from Strdrug"
        Dim strSql1 As String = "select Strno from Strdrug where Strno = '" & Me.txtNo.Text & "'"
        dr = dbobj.DataReader(strSql1)
        If dr.Read() Then
                If txtNo.Text <> "" And txtName.Text <> "" Then
                myReturn = Windows.Forms.MessageBox.Show("确定要修改资料吗?", "修改资料", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
                If myReturn = Windows.Forms.DialogResult.OK Then
                    dbobj.RunSql(sql)
                    MessageBox.Show("修改成功")
                    dbobj.ReturnDataSet(strSql, ds)
                    Me.DataGridView1.DataSource = ds.Tables(0)
                End If
            Else
                MessageBox.Show("编号和药品名称不能为空!")
            End If
        Else
            MessageBox.Show("无此编号")
        End If
    End Sub

    Private Sub btnCancle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancle.Click
        Me.txtName.Text = ""
        Me.txtNo.Text = ""
        Me.txtFun.Text = ""
        Me.txtNumber.Text = ""
        Me.txtPrice.Text = ""
        Me.txtType.Text = ""
        Me.txtAddress.Text = ""
    End Sub

    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim strSql As String = "select * from Strdrug where Strname like '%" & Me.txtName.Text & "%'"
        Dim ds As New DataSet
        Dim dbobj As New ConnSqlServer.db
        Dim dr As System.Data.SqlClient.SqlDataReader
        dr = dbobj.DataReader(strSql)
        If dr.Read() And Me.txtName.Text <> "" Then
            dbobj.ReturnDataSet(strSql, ds)
            Me.DataGridView1.DataSource = ds.Tables(0)
 
www.751com.cn

    Private Sub DataGridView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseClick
        Dim i As Integer
        i = Me.DataGridView1.CurrentRow.Index
        Me.txtNo.Text = Trim(DataGridView1.Item(0, i).Value)
        Me.txtName.Text = Trim(DataGridView1.Item(1, i).Value)
        Me.txtFun.Text = Trim(DataGridView1.Item(2, i).Value)
        Me.txtNumber.Text = Trim(DataGridView1.Item(3, i).Value)
        Me.txtPrice.Text = Trim(DataGridView1.Item(4, i).Value)
        Me.txtType.Text = Trim(DataGridView1.Item(5, i).Value)
        Me.txtAddress.Text = Trim(DataGridView1.Item(6, i).Value)
    End Sub

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        Dim dbobj As New ConnSqlServer.db
        Dim sql As String = "Insert into Strdrug Values('" & Me.txtNo.Text & "','" & Me.txtName.Text & "','" & Me.txtFun.Text & "','" & Me.txtNumber.Text & "','" & Me.txtPrice.Text & "','" & Me.txtType.Text & "','" & Me.txtAddress.Text & "')"
        Dim strSql1 As String = "select Strno from Strdrug where Strno = '" & Me.txtNo.Text & "'"
        Dim myReturn As DialogResult
        Dim ds As New DataSet
        Dim dr As System.Data.SqlClient.SqlDataReader
        dr = dbobj.DataReader(strSql1)
        If Not dr.Read() Then
            If txtNo.Text <> "" And txtName.Text <> "" Then
                myReturn = Windows.Forms.MessageBox.Show("确定要添加资料吗?", "添加资料", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
                If myReturn = Windows.Forms.DialogResult.OK Then
                    dbobj.RunSql(sql)
                    MessageBox.Show("添加成功")
                    strSql1 = "select * from Strdrug"
                    dbobj.ReturnDataSet(strSql1, ds)
                    Me.DataGridView1.DataSource = ds.Tables(0)
                End If
            Else
                MessageBox.Show("编号或药品名称不能为空!")
            End If
        Else
            MessageBox.Show("此编号已存在")
        End If
    End Sub
End Class

 << 上一页  [21] [22] 

医生处方系统论文+源程序 第22页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

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