Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestResult"/> class. Stores the record ID globally, gets the associated test record, puts the values into the form and fills the user lists with all possible usernames
        /// </summary>
        /// <param name="recId">The record id of the Patient Test Result record to be modified</param>
        public TestResult(int recId)
        {
            InitializeComponent();
            this.Icon  = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            dbb        = new DBBackEnd();
            this.recId = recId;

            PatientTestResults testResult = dbb.GetTestResult(recId);

            rSph_Text.Text      = testResult.RSpH;
            lSph_Text.Text      = testResult.LSpH;
            rVa1_Text.Text      = testResult.RvA1;
            rVa2_Text.Text      = testResult.RvA2;
            lVa1_Text.Text      = testResult.LVA1;
            lVa2_Text.Text      = testResult.LVA2;
            rCyl_Text.Text      = testResult.RcYL;
            rAxis_Text.Text     = testResult.RAxis;
            lCyl_Text.Text      = testResult.LcYL;
            lAxis_Text.Text     = testResult.LaxIs;
            remarks_Text.Text   = testResult.Remarks;
            test_DateTime.Value = testResult.Date.Value;
            foreach (string user in dbb.UserNameList)
            {
                users_ComboBox.Items.Add(user);
            }
            users_ComboBox.SelectedItem = testResult.Users.Username;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the DoWork event of the Login_BackgroundWorker control. Logs the user using the inbuilt method. Runs in a seperate thread to the GUI as running it in the same thread can block the GUI for several seconds leading the user to assume the program has crashed. Returns the result of the login
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e"></param>
 void Login_BackgroundWorkerDoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     Adaptor.Users u1 = (Adaptor.Users)e.Argument;
     using (DBBackEnd dbb = new DBBackEnd())
     {
         e.Result = dbb.LogOn(u1.Username, u1.Password);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "AddCondition" /> class.
 /// </summary>
 public AddCondition()
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     dbb  = new DBBackEnd();
 }
Exemplo n.º 4
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "NewPatient" /> class. Also adds all the possible recall methods to the recall method box
 /// </summary>
 public NewPatient()
 {
     InitializeComponent();
     Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     dbb  = new DBBackEnd();
     foreach (string enumstr in Enum.GetNames(typeof(RecallMethods)))
     {
         recallMethod_ComboBox.Items.Add(enumstr);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Emails"/> class. Refreshes the list of emails
 /// </summary>
 public Emails()
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     dbb       = new DBBackEnd();
     RefreshList();
 }
Exemplo n.º 6
0
 /// <summary>
 ///   Reloads the record in use by refreshing the adaptor (or initializing one) and sets the record globally.
 /// </summary>
 private void Reload_Record()
 {
     if (dbb == null)
     {
         dbb = new DBBackEnd();
     }
     else
     {
         dbb.RefreshAdaptor();
     }
     rec = dbb.PatientRecord(inUseRecId);
 }
Exemplo n.º 7
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "PhoneRecall" /> class. Gets the recall record and populates form fields with its values
        /// </summary>
        /// <param name = "RecallID">The recall ID.</param>
        public PhoneRecall(int RecallID)
        {
            InitializeComponent();
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            dbb  = new DBBackEnd();

            rclrec                      = dbb.GetRecallByRclId(RecallID);
            name_Label.Text             = rclrec.Patients.Name;
            telNum_Label.Text           = rclrec.Patients.TelNum;
            reason_Label.Text           = rclrec.Reason;
            cal_Calendar.SelectionStart = DateTime.Today.Date;
        }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Recalls"/> class.
 /// </summary>
 public Recalls()
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     dbb       = new DBBackEnd();
     startDate_DateTime.Value = DateTime.Today;
     endDate_DateTime.Value   = DateTime.Today;
     LoadRecalls();
 }
Exemplo n.º 9
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "AddConditionOnPatient" /> class. Loads the given patient record and refreshes the condition list.
        /// </summary>
        /// <param name = "PatientID">The patient ID of the patient being modified.</param>
        public AddConditionOnPatient(int PatientID)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            dbb  = new DBBackEnd();

            PatientInfo = dbb.PatientRecord(PatientID);

            RefreshConditionsList();
        }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the PatientList class. Populates the list of patients with the patients from the database
 /// </summary>
 public PatientList()
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     dbb       = new DBBackEnd();
     foreach (string patient in dbb.PatientListWithNhsNumber)
     {
         patient_List.Items.Add(patient);
     }
 }
Exemplo n.º 11
0
 public NewRecall(int patientId)
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     //
     // TODO: Add constructor code after the InitializeComponent() call.
     //
     dbb            = new DBBackEnd();
     this.patientId = patientId;
     Patientrec     = dbb.PatientRecord(patientId);
 }
Exemplo n.º 12
0
        const string passwordempty = "........"; //TODO: notalways
        /// <summary>
        /// Initializes a new instance of the <see cref="UserEditor"/> class. Adds all the hashing methods to the combo box in the form.
        /// </summary>
        public UserEditor()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            dbb = new DBBackEnd();

            foreach (string enumval in Enum.GetNames(typeof(HashMethods)))
            {
                hashingMethod_ComboBox.Items.Add(enumval);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "AppointmentsOnPatient" /> class. Gets the appointments on the selected patient ID and adds them to a list.
        /// </summary>
        /// <param name = "patientId">The patient id to open appointments for.</param>
        public AppointmentsOnPatient(int patientId)
        {
            InitializeComponent();
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            dbb  = new DBBackEnd();

            foreach (PatientAppointments appointment in dbb.GetAppointmentsOnPatient(patientId))
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("#");
                sb.Append(appointment.AppointmentID);
                sb.Append(":");
                sb.Append(appointment.StartDateTime.Date.ToShortDateString());
                appointments_List.Items.Add(sb.ToString());
            }
        }
Exemplo n.º 14
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "NewAppointment" /> class. Sets global variables, Sets the form for the selected date and reloads the calendar.
        /// </summary>
        /// <param name = "patientId">The patient id.</param>
        /// <param name = "selectedDate">The selected date.</param>
        public NewAppointment(int patientId, DateTime selectedDate)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            dbb   = new DBBackEnd();
            recid = patientId;
            foreach (string user in dbb.UserNameList)
            {
                optician_ComboBox.Items.Add(user);
            }
            optician_ComboBox.SelectedItem = Program.OProg.UserName;
            appointmentDate_DateTime.Value = selectedDate;
            RefreshAppointments();
            appointments_DayView.Invalidate();
        }
Exemplo n.º 15
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "EmailRecall" /> class. Sets the global variables with patient information and refreshes the list of emails.
        /// </summary>
        /// <param name = "recallId">The recall id.</param>
        public EmailRecall(int recallId)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            dbb           = new DBBackEnd();
            this.recallId = recallId;
            Patients patientRec = dbb.GetRecallByRclId(recallId).Patients;

            name  = patientRec.Name;
            email = patientRec.Email;
            foreach (string emailrec in dbb.EmailList)
            {
                template_ComboBox.Items.Add(emailrec);
            }
        }
Exemplo n.º 16
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "EditAppointment" /> class. Adds a list of usernames to the opticians screen and fills out the information boxes with fields from the patients record.
        /// </summary>
        /// <param name = "appointmentId">The appointment id.</param>
        public EditAppointment(int appointmentId)
        {
            InitializeComponent();
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            dbb  = new DBBackEnd();

            foreach (string user in dbb.UserNameList)
            {
                optician_ComboBox.Items.Add(user);
            }

            this.appointmentId = appointmentId;
            PatientAppointments ap1 = dbb.GetAppointmentById(appointmentId);

            start_DateTime.Value           = ap1.StartDateTime;
            end_DateTime.Value             = ap1.EndDateTime;
            remarks_Text.Text              = ap1.Remarks;
            optician_ComboBox.SelectedItem = ap1.Users.Username;
        }
Exemplo n.º 17
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "Appointments" /> class. Adds usernames to the combo box, sets the user to the current user, sets the date to today and refreshes the calendar.
        /// </summary>
        public Appointments()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            dbb  = new DBBackEnd();

            foreach (string user in dbb.UserNameList)
            {
                optician_ComboBox.Items.Add(user);
            }
            optician_ComboBox.SelectedItem = Program.OProg.UserName;
            appointmentDate_DateTime.Value = DateTime.Today;

            RefreshAppointments();
            appointments_DayView.Invalidate();
        }
Exemplo n.º 18
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "AppointmentInProgress" /> class. Sets the appointment ID globally, sets the patient information to the values from the record and adds the conditions to the list.
        /// </summary>
        /// <param name = "appointmentId">The appointment id.</param>
        public AppointmentInProgress(int appointmentId)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            dbb  = new DBBackEnd();

            this.appointmentId = appointmentId;

            PatientAppointments pa1 = dbb.GetAppointmentById(appointmentId);

            name_Text.Text        = pa1.Patients.Name;
            dateOfBirth_Text.Text = pa1.Patients.DateOfBirth.ToLongDateString();
            nhsNumber_Text.Text   = pa1.Patients.NhsnUmber;
            patientId             = pa1.PatientID;
            apmtRemarks_Text.Text = pa1.Remarks;

            foreach (PatientConditions patientCondition in pa1.Patients.PatientConditions)
            {
                conditions_List.Items.Add(patientCondition.Conditions.Condition);
            }
        }
Exemplo n.º 19
0
 public void Init()
 {
     dbb = new DBBackEnd();             // if user doesnt exist create user / password like
 }