Exemple #1
0
 public EditMember(RFIDLoggerMain main, string member)
 {
     InitializeComponent();
     this.main   = main;
     this.member = member;
     Parse();
 }
Exemple #2
0
 public Password(RFIDLoggerMain main, char action, SerialPort port)
 {
     InitializeComponent();
     this.action = action;
     this.main   = main;
     this.port   = port;
 }
        public PortName(RFIDLoggerMain main)
        {
            InitializeComponent();
            this.main = main;
            comCombo.Items.AddRange(SerialPort.GetPortNames());

            if (SerialPort.GetPortNames().Length > 1)
            {
                comCombo.SelectedIndex = 1;
            }
            else if (SerialPort.GetPortNames().Length > 0)
            {
                comCombo.SelectedIndex = 0;
            }
        }
        public NewMember(string rfid, RFIDLoggerMain main, MySqlConnection mySQLcon)
        {
            this.main = main;
            newMemCon = mySQLcon;
            InitializeComponent();
            RFIDBox.Text = rfid;

            if (main.openDB())
            {
                projCombo.Items.Clear();
                newMemComm             = newMemCon.CreateCommand();
                newMemComm.CommandText = "select project_name from projects where active_project=1 order by project_id;";
                newMemReader           = newMemComm.ExecuteReader();
                while (newMemReader.Read())
                {
                    projCombo.Items.Add(newMemReader.GetValue(0));
                }
                newMemReader.Close();
                main.closeDB();
            }
            projCombo.SelectedIndex = 0;
        }
        public ViewAllMembers(RFIDLoggerMain logger, bool edit, MySqlConnection sqlcon)
        {
            InitializeComponent();
            this.main       = logger;
            this.edit       = edit;
            this.viewSQLcon = sqlcon;
            int num = main.getNumMembers();

            if (num > 0)
            {
                totalHoursValue.Text = main.getTotalHours().ToString();
            }
            if (num > 1)
            {
                for (int i = 1; i < num; i++)
                {
                    membersListBox.Items.Add(main.displayMembers(i, 0));
                }
            }
            else
            {
                MessageBox.Show("There are no members to view. Please add one and try again.", "No members");
            }
        }