private void GetTagId() { List <string> listUsbDevicePath = CLReader.GetUsbHidDeviceList(); if (listUsbDevicePath.Count > 0) { ConnIDs = listUsbDevicePath[0]; if (CLReader.CreateUsbConn(ConnIDs, Handle, RFIDPrg)) { // MessageBox.Show("Connected"); // btnGetTagId .Text = "Ok"; eReadType eRType = new eReadType(); eRType = eReadType.Single; antennaNum = eAntennaNo._1; int TID = 0; TID = CLReader._Tag6C.GetEPC_TID(ConnIDs, antennaNum, eRType); System.Threading.Thread.Sleep(1000); if (TID != 0) { // MessageBox.Show(TID.ToString()); } } else { MessageBox.Show("Not connected"); } } else { MessageBox.Show("No USB connections Found"); } CLReader.CloseConn(ConnIDs); CLReader.CloseAllConnect(); }
private void btnConnectUSB_Click(object sender, EventArgs e) { List <string> listUsbDevicePath = CLReader.GetUsbHidDeviceList(); comboBox1.DataSource = listUsbDevicePath; int i = listUsbDevicePath.Count; textBox3.Text = i.ToString(); if (listUsbDevicePath.Count > 0) { ConnIDs = listUsbDevicePath[0]; if (CLReader.CreateUsbConn(ConnIDs, Handle, RFIDPrg)) { MessageBox.Show("Connected"); eReadType eRType = new eReadType(); eRType = eReadType.Inventory; antennaNum = eAntennaNo._1; int TID = 0; TID = CLReader._Tag6C.GetEPC_TID(ConnIDs, antennaNum, eRType); if (TID != 0) { MessageBox.Show("Data Read"); } } else { MessageBox.Show("Not connected"); } } else { MessageBox.Show("No USB connections Found"); } CLReader.CloseConn(ConnIDs); CLReader.CloseAllConnect(); btnReturnButton.Visible = true; //this.Close(); }
public void AddNewStudent() { txtName.ReadOnly = false; txtClass.ReadOnly = false; txtRollNos.ReadOnly = false; txtClassTeacher.ReadOnly = false; txtClassTeacherContactNos.ReadOnly = false; txtGuardianName.ReadOnly = false; txtGuardiancontactNumber.ReadOnly = false; txtHomeAddress.ReadOnly = false; txtSiblingInformation.ReadOnly = false; txtJoinedSchoolDate.ReadOnly = false; txtBloodGroup.ReadOnly = false; txtWarnings.ReadOnly = false; txtNotes.ReadOnly = false; txtEntryTime.ReadOnly = false; txtExitTime.ReadOnly = false; txtDate.ReadOnly = false; txtLastNotedLocation.ReadOnly = false; txtAttendenceInDays.ReadOnly = false; txtGender.ReadOnly = false; txtAadharNos.ReadOnly = false; panel3.Visible = false; btnSaveNExit.Visible = true; isAddingNewStudent = true; GetRFID_panel.Visible = true; if (GetRFID_panel.Visible == true) { #region READRFID //Show RFID reading first. GetRFID_panel.Width = 800; GetRFID_panel.Height = 800; //Disable exit button and background. btnExitButton.Visible = false; ProgramCLUSB RFIDPrg = new ProgramCLUSB(); List <string> listUsbDevicePath = new List <string>(); string ConnIDs = ""; eAntennaNo antennaNum = eAntennaNo._1; eReadType eRType = eReadType.Single; try { listUsbDevicePath = CLReader.GetUsbHidDeviceList(); } catch (Exception eee) { MessageBox.Show(eee.ToString()); } if (listUsbDevicePath.Count > 0) { ConnIDs = listUsbDevicePath[0]; if (CLReader.CreateUsbConn(ConnIDs, Handle, RFIDPrg)) { MessageBox.Show("Connected"); int TID = 0; TID = CLReader._Tag6C.GetEPC_TID(ConnIDs, antennaNum, eRType); if (TID > 0) { MessageBox.Show("Data Read"); } } else { MessageBox.Show("Not connected"); } } else { MessageBox.Show("No USB connections Found"); } scanID.Text = "ID of Tag =" + TagRead; CLReader.CloseConn(ConnIDs); CLReader.CloseAllConnect(); btnExitButton.Visible = true; txtStudentId.Text = TagRead; btnSaveNExit.Visible = true; btnSaveNExit.Enabled = true; } #endregion }