Exemple #1
0
        private void PrintBtn_Click(object sender, EventArgs e)
        {
            set_printer();

            //check for errors
            int err = error_checking();

            if (err == 0)
            {
                //set first letter of name to uppercase
                current_patient.firstName = current_patient.firstName.First().ToString().ToUpper() + string.Join("", current_patient.firstName.Skip(1));
                current_patient.lastName  = current_patient.lastName.First().ToString().ToUpper() + string.Join("", current_patient.lastName.Skip(1));
                string printer_name = File.ReadAllText("printerSettings.txt");
                RawPrinterHelper.print(current_patient, printer_name);
            }
        }
Exemple #2
0
        private void PrintThreeBtn_Click(object sender, EventArgs e)
        {
            set_printer();

            //check for errors
            int err = error_checking();

            if (err == 0)
            {
                Patient temp_patient = new Patient()
                {
                    firstName = current_patient.firstName, lastName = current_patient.lastName
                };
                for (int i = 0; i < 3; i++)
                {
                    if (i + 1 <= current_patient.appointments.Count && current_patient.appointments[i] != null)
                    {
                        temp_patient.appointments.Add(current_patient.appointments[i]);
                    }
                }
                RawPrinterHelper.print(temp_patient, printer_name);
            }
        }
Exemple #3
0
        private void printTestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Patient test_patient = new Patient()
            {
                firstName = "Cody",
                lastName  = "Malick",
                //appointments = { DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now}
                //appointments = { DateTime.Now, DateTime.Now, DateTime.Now }
                //appointments = { DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now }
                //appointments = { DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now }
                appointments = { DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now }
            };

            set_printer();
            if (printer_name == null)
            {
                MessageBox.Show("Please configure printer");
            }
            else
            {
                RawPrinterHelper.print(test_patient, printer_name);
            }
        }