Sub BindRecieveToGridview1(ByVal gridview As GridView)
conn.Connect() 'name_staff เอาแต่ driver
Mysql = "SELECT t.RN,t.StateSend,p.Name,c.carlicense,s.name_staff,t.insideSendTime,t.Date_Refer,t.Time_Refer FROM transrefer_table t,carrefer_table c,staff_table s,staffsending_table ss,patient_table p WHERE "
Mysql &= "(t.acceptType_acceptHos='1' AND t.acceptType_acceptBar='1')AND(t.CID=p.CID)AND(t.id_car=c.id_car)AND((t.RN=ss.RN)AND(ss.id_staff=s.id_staff)AND(s.type_staff='1'))AND(t.Status_SendPatientDouble='0')"
Dim cmm As New Mysql.Data.MySqlClient.MySqlCommand(Mysql, conn.myConnection)
conn.MyReader = cmm.ExecuteReader
If conn.MyReader.HasRows Then
gridview.Visible = True
gridview.DataSource = conn.MyReader
gridview.DataBind()
conn.MyReader.Close()
Else
MsgBox(" ไม่มีข้อมูล ", MsgBoxStyle.Critical, "asdf")
End If
End Sub
Public Function BindToListbox(ByVal VRN)
conn.MyReader.Close()
Mysql = "SELECT s.name_staff FROM staffsending_table ss,staff_table s WHERE ss.RN='" & VRN & "' AND ss.id_staff=s.id_staff AND s.type_staff='2'"
Dim cmm2 As New Mysql.Data.MySqlClient.MySqlCommand(Mysql, conn.myConnection)
conn.MyReader = cmm2.ExecuteReader
Return conn.MyReader
End Function