コード例 #1
0
        private void membersListBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int    mem;
            string memToFind = membersListBox.SelectedItem.ToString();

            if (!edit)
            {
                if (memToFind.Length > 0)
                {
                    string[] array = memToFind.Split(' ');
                    mem = main.FindMemByName(array[1] + " " + array[2]);
                    if (mem > 0)
                    {
                        MessageBox.Show(main.displayMembers(mem, 1));
                    }
                }
            }
            else
            {
                if (memToFind.Length > 0)
                {
                    string[] array = memToFind.Split(' ');
                    mem = main.FindMemByName(array[1] + " " + array[2]);
                    main.startEditThread(mem);
                }
            }
        }
コード例 #2
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");
            }
        }