コード例 #1
0
ファイル: MainForm.cs プロジェクト: jzhang182/HealthMonitor
        private void SearchButton_Click(object sender, EventArgs e)
        {
            toolStripStatusLabel1.Text = "Searching";
            bool isGinLegal = int.TryParse(textBox1.Text, out int currentGin);

            if (!isGinLegal)
            {
                MessageBox.Show("Invalid Gin");
            }
            else
            {
                try
                {
                    Employee employee = data.DataDict[currentGin];
                    MessageBox.Show("Target employee found" + "\n" + employee.ToString());
                    SubForm editForm = new SubForm(this, employee, "Modify");
                    editForm.Show();
                    RefreshButton_Click(sender, e);
                }
                catch
                {
                    MessageBox.Show("No corresponding record");
                }
            }
            toolStripStatusLabel1.Text = "Ready";
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: jzhang182/HealthMonitor
        private void AddButton_Click(object sender, EventArgs e)
        {
            toolStripStatusLabel1.Text = "Adding New Profile";
            SubForm editForm = new SubForm(this, null, "add");

            editForm.Show();
            RefreshButton_Click(sender, e);
            toolStripStatusLabel1.Text = "Ready";
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: jzhang182/HealthInfo
        private void SearchButton_Click(object sender, EventArgs e)
        {
            int currentGin = int.Parse(textBox1.Text);

            try
            {
                Employee employee = data.DataDict[currentGin];
                MessageBox.Show("Target employee found" + "\n" + employee.ToString());
                SubForm editForm = new SubForm(this, employee, "Modify");
                editForm.Show();
            }
            catch
            {
                MessageBox.Show("No corresponding record.");
            }
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: jzhang182/HealthInfo
        private void AddButton_Click(object sender, EventArgs e)
        {
            SubForm editForm = new SubForm(this, null, "add");

            editForm.Show();
        }