コード例 #1
0
        private void search_button_Click(object sender, EventArgs e)
        {
            first    = user_first.Text;
            last     = user_last.Text;
            f_name   = first;
            l_name   = last;
            fullName = last + first;

            string curFile = @"C:\Users\uta\Desktop\BMI\BMI\bin\Debug\Patients Data\" + fullName + ".txt";

            Console.WriteLine(fullName);
            Console.WriteLine(File.Exists(curFile) ? "File exists." : "File does not exist.");

            if (File.Exists(curFile))
            {
                found = 1;
                MessageBox.Show("Patient: " + first + " " + last + " is found!", "Welcome");
                this.Visible = false;
                home_form.ShowDialog();
            }
            else
            {
                found = 0;
                MessageBox.Show("Patient has not been registered.", "Oops!");
                this.Visible = false;
                new_patient.ShowDialog();
            }
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            NewPatient newPatient_form = new NewPatient();

            newPatient_form.ShowDialog();
        }