Foxtable(狐表)用户栏目专家坐堂 → [求助]求助于狐爸啊,还是读卡写卡的问题


  共有7347人关注过本帖树形打印复制链接

主题:[求助]求助于狐爸啊,还是读卡写卡的问题

帅哥哟,离线,有人找我吗?
狐狸爸爸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/4/2 11:42:00 [显示全部帖子]

Protected Sub btnxieka_Click(sender As Object, e As EventArgs)
 If Xieka() Then
  myLib.PublicModule.Javascript.AlertAndRedirect("写卡成功!", "CardList2.aspx")
 Else
  myLib.PublicModule.Javascript.Alert("写入失败!", True)
  Return
 End If
End Sub


Private Function Xieka() As Boolean
 '写入磁卡的内容(业主ID,业主姓名,卡号,卡号ID)
 Dim ownerid As String = Me.txtOwnerID.Value


 Dim cardnumber As String = Me.txtCardNumber.Text


 Dim cardguid As String = Me.ViewStateCardGuid


 Dim key As String = ownerid & "," & cardnumber & "," & cardguid


 Dim b As Boolean = DUKa.WriteIn(key)


 Return b
End Function

 

 

 

Private Sub Button3_Click(sender As Object, e As EventArgs)
 Try
  Dim msg As String = ""
  Dim b As Boolean = DUKa.ReadCard("", msg)
  'D8读卡
  If b Then
   Dim cardlist As String() = msg.Split(","C)
   '三个参数:业主id,卡号,卡号id

   Dim dtable As New DataTable()


   dtable = bll.GetOwnerInfo(Convert.ToInt32(cardlist(0)))


   If dtable IsNot Nothing Then
    Me.txtCardNumber.Text = cardlist(1).ToString()
    Me.txtOwnerName.Text = dtable.Rows(0)("OwnerName").ToString()
    Me.cardid = Convert.ToInt32(cardlist(2).ToString())
    Me.ownerid = Convert.ToInt32(cardlist(0).ToString())


   End If
  Else
   MessageBox.Show("读卡失败")
  End If
 Catch
  MessageBox.Show("读卡失败")
 End Try
End Sub


 回到顶部