Protected Sub btn_add_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_add.Click
Dim xcls As New ClsView
If xcls Is Nothing Then xcls = New ClsView
Dim Prompt As String = "Insert data complete!"
Dim Prompt1 As String = "Please insert data !!"
If Me.txtadd.Text <> "" Then
If Linkbank.Text = "ตั้งค่าลิสต์ธนาคาร" Then
xcls.RunSQL("Insert Into post_bank(bank_name,bank_active) Values('" & Me.txtadd.Text & "'," & "1" & ")")
txtadd.Text = ""
grd_set.DataSource = xcls.Tbl
grd_set.DataBind()
ElseIf Linkpost.Text = "ตั้งค่าลิสต์รายละเอียด" Then
xcls.RunSQL("Insert Into post_type(ptype_name,ptype_active) Values('" & Me.txtadd.Text & "'," & "1" & ")")
txtadd.Text = ""
grd_set.DataSource = xcls.Tbl
grd_set.DataBind()
Else : xcls.RunSQL("Insert Into file_datatype(dtype_name,dtype_active) Values('" & Me.txtadd.Text & "'," & "1" & ")")
txtadd.Text = ""
grd_set.DataSource = xcls.Tbl
grd_set.DataBind()
End If
MsgBox(Prompt, , "Information")
Else : MsgBox(Prompt1, , "Information")