Exemplo n.º 1
0
        //Setting the RFID to the new Visitor
        public void SetRfidToUser(object sender, RFIDTagEventArgs args)
        {
            rfidCode = args.Tag;
            myRfid.Close();
            var dh = new Datahelper();

            lblRfidSt.Text = dh.GetUserFirstNameWithRfid(rfidCode);
            //Setting the visitors id
            dh.userId = UserIdForSettingRfid;
            //Giving the rfid chip to the visitor
            var status = dh.GiveRfid(rfidCode);

            lbCheckStatus.Text = status;
            lblRfidSt.Text     = "";
            if (status == "There is already a user with that RFID" || status == "Error Assigning RFID" ||
                status == "Error!")
            {
                lbCheckStatus.ForeColor = Color.Red;
                CheckedIn = "yes";
            }
            else
            {
                lbCheckStatus.ForeColor = Color.Green;
                lbRegisterStatus.Text   = "";
                CheckedIn = "no";
            }
        }
Exemplo n.º 2
0
        //Only displaying the chip
        public void CheckUserRfid(object sender, RFIDTagEventArgs args)
        {
            rfidCode = args.Tag;
            var dh       = new Datahelper();
            var userName = dh.GetUserFirstNameWithRfid(rfidCode);

            if (userName != "")
            {
                lblRfidSt.Text = userName;
            }
            else
            {
                lblRfidSt.Text = rfidCode;
            }
            myRfid.Close();
        }