/*--------------------------------------------ACTIVATE CAMERA END-----------------------------------------------------*/

/*---------------------------------------------RFID ENTRY & EXIT START------------------------------------------------*/

        //Entry Function
        private void entry()
        {
            try
            {
                string inTagResponse = null;
                string inTagID       = null;

                inTagResponse = mReader.G2Read(eG2Bank.EPC, "2", "6");
                int len = inTagResponse.Length;
                if (len >= 35)
                {
                    inTagID = inTagResponse.Substring(0, 35);
                    string inVal = inTagID.Trim();

                    ArrayList entryID = new ArrayList();

                    for (int i = 0; i < 8; i++)
                    {
                        if (Convert.ToString(inVal[i + 27]) != " ")
                        {
                            entryID.Add(inVal[i + 27]);
                        }
                    }

                    StringBuilder builder = new StringBuilder();
                    foreach (char gvalue in entryID)
                    {
                        builder.Append(gvalue);
                    }

                    int gdecValue = Convert.ToInt32(builder.ToString(), 16);

                    rfidInTB.Text = Convert.ToString(gdecValue);
                }
                else
                {
                    inTagID       = inTagResponse.Substring(0, 23);
                    rfidInTB.Text = inTagID.Trim();
                }

                if (inControl())
                {
                    if (trackNoInTB.Text != inTrackNo)
                    {
                        rfidInControlLog("0");// mReader.ProgAntenna
                        inTrackNo = trackNoInTB.Text;
                    }
                    closeMysqlConn();
                }
                else
                {
                    if (rfidInTB.Text != inRfid)
                    {
                        nonRfidInControlLog("0");
                        inRfid = rfidInTB.Text;
                    }
                    closeMysqlConn();
                }
            }
            catch
            {
                rfidInTB.Text     = "";
                nameInTB.Text     = "";
                surnameInTB.Text  = "";
                facultyInTB.Text  = "";
                plateCarInTB.Text = "";
                trackNoInTB.Text  = "";
                ppIn.Image        = null;
            }
        }