Exemple #1
-1
        public void VisitorCheckedStatus(object sender, RFIDTagEventArgs args)
        {
            rfid = args.Tag;
            mdh  = new MysqlDataHelper();
            string firstName = mdh.GetUserNameWithRfid(rfid);

            if (firstName != "")
            {
                lblVisitorName.Text = firstName + " :";
                string status = mdh.GetCamping_StatusWithRfid(rfid);
                if (status == "in")
                {
                    lb_visitorStatus.Text = "The Visitor is in the capming terrain";
                }
                else if (status == "out")
                {
                    lb_visitorStatus.Text = "The Visitor is out of  the capming terrain";
                }
                else if (status == "The camp does not exist")
                {
                    lb_visitorStatus.Text = "No camping spot booked by the visitor";
                }
                else if (status == "somthing wrong happened!!!")
                {
                    lb_visitorStatus.Text = "somthing wrong happened!!!";
                }
                else
                {
                    lb_visitorStatus.Text = status;
                }
            }
            else
            {
                lb_visitorStatus.Text = "";
                lblStatus.Text        = "There is no user assigned to this rfid";
            }
            Rfid.Close();
        }
Exemple #2
-1
        public void UserCheckingForRegistration(object sender, RFIDTagEventArgs args)
        {
            rfid = args.Tag;
            mdh  = new MysqlDataHelper();
            string firstName = mdh.GetUserNameWithRfid(rfid);

            if (firstName != "")
            {
                if (lblUser1Name.Text != "")
                {
                    if (lblUser2Name.Text != "")
                    {
                        if (lblUser3Name.Text != "")
                        {
                            if (lblUser4Name.Text != "")
                            {
                                if (lblUser5Name.Text != "")
                                {
                                    if (lblUser6Name.Text != "")
                                    {
                                        lblStatus.Text      = "All users are checked !";
                                        lblStatus.ForeColor = Color.Green;
                                    }
                                    else
                                    {
                                        lblUser6Name.Text = firstName;
                                        user6_id          = mdh.GetUser_idWithRfid(rfid);
                                    }
                                }
                                else
                                {
                                    lblUser5Name.Text = firstName;
                                    user5_id          = mdh.GetUser_idWithRfid(rfid);
                                }
                            }
                            else
                            {
                                lblUser4Name.Text = firstName;
                                user4_id          = mdh.GetUser_idWithRfid(rfid);
                            }
                        }
                        else
                        {
                            lblUser3Name.Text = firstName;
                            user3_id          = mdh.GetUser_idWithRfid(rfid);
                        }
                    }
                    else
                    {
                        lblUser2Name.Text = firstName;
                        user2_id          = mdh.GetUser_idWithRfid(rfid);
                    }
                }
                else
                {
                    lblUser1Name.Text = firstName;
                    user1_id          = mdh.GetUser_idWithRfid(rfid);
                }
            }
            else
            {
                lblStatus.Text = "There is no user found with that RFID";
            }
            myRfid.Close();
        }