Public Class frmIVFmed

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        Try
            sql = "INSERT INTO `tblivfrecord` " & _
            " (`CASENUM`, `ADDMITINGID`,`IVFDATE`, `BOTTLENUM`, `KINDOFSOLUTION`, `IVFAMOUNT`, `MEDICATIONADDERT`, `IVFRATE`, `STARTEDTIME`, `STARTNURSE`, `ENDEDTIME`, `ENDNURSE`, `ENDDATE`, `IVFREMARKS`) " & _
            " VALUES ('" & lblCaseNum.Text & "','" & lblAdmitting.Text & "','" & DISPLAYDATE(Now(), "yyyy-MM-dd") & "','" & txtBottle.Text & "','" & txtKindSol.Text & _
            "','" & txtIVFamount.Text & "','" & txtMedication.Text & "','" & txtIVrate.Text & _
            "','" & Format(dtpStartTime.Value, "HH:mm:ss") & "','" & txtNurse1.Text & "','" & Format(dtpEndTime.Value, "HH:mm:ss") & _
            "','" & txtnurse2.Text & "','" & INSERTMYSQLDATE(dtpDate, "yyyy-MM-dd") & "','" & txtivfRemarks.Text & "')"
            result = CUD(sql)
            If result = False Then
                MsgBox("", MsgBoxStyle.Exclamation)
            Else
                MsgBox("New record has been saved.")




                showStationList(frmStation1)
            End If

            
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
        Try
            sql = "UPDATE `tblivfrecord` " & _
           " SET `ENDEDTIME`='" & Format(dtpEndTime.Value, "HH:mm:ss") & _
           "', `ENDNURSE`='" & txtnurse2.Text & "', `ENDDATE`='" & INSERTMYSQLDATE(dtpDate, "yyyy-MM-dd") & _
           "', `IVFREMARKS` ='" & txtivfRemarks.Text & "' WHERE IVFID= " & lblIVFID.Text
            result = CUD(sql)
            If result = False Then
                MsgBox("", MsgBoxStyle.Exclamation)
            Else
                MsgBox("Record has been saved.")


                showStationList(frmStation1)
            End If
        Catch ex As Exception

        End Try
    End Sub
     
    Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclose.Click
        Me.Close()
    End Sub

    Private Sub frmIVFmed_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        showStationList(frmStation1)
    End Sub

    Private Sub frmIVFmed_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class