Exemple #1
0
        public RegisterNewPatientForm(Patient p, PatientFactory pf, ReceptionistForm parent)
        {
            InitializeComponent();
            this.p      = p;
            this.pf     = pf;
            this.parent = parent;

            if (p != null)
            {
                nhsNumbertextBox1.Text           = p.NHSNumber;
                patientFirstNameTextBox.Text     = p.FirstName;
                patientLastNameTextBox.Text      = p.LastName;
                patientAddressTextBox.Text       = p.Address;
                postcodetextBox2.Text            = p.Postcode;
                patientNextOfKinTextBox.Text     = p.NextOfKin;
                dateTimePicker1.Value            = p.DOB;
                maleradioButton1.Checked         = p.Gender.Contains("Male");
                religiontextBox3.Text            = p.Religion;
                patientEmailTextBox.Text         = p.Email;
                patientContactNumberTextBox.Text = p.Phone;

                this.Text = "Edit Patient Details";
            }

            compulsoryFields[0] = nhsNumbertextBox1;
            compulsoryFields[1] = patientFirstNameTextBox;
            compulsoryFields[2] = patientLastNameTextBox;
            compulsoryFields[3] = patientAddressTextBox;
            compulsoryFields[4] = postcodetextBox2;
            compulsoryFields[5] = patientNextOfKinTextBox;
            compulsoryFields[6] = patientContactNumberTextBox;
        }
Exemple #2
0
 public FindAppointmentForm(ReceptionistForm parent)
 {
     InitializeComponent();
     this.parent = parent;
     this.nameRadioButton.Checked = true;
     this.lastNameTextBox.KeyUp  += LastNameTextBox_KeyUp;
     this.Load += FindAppointmentForm_Load;
     this.nameGroupBox.Enabled = true;
 }
Exemple #3
0
        public AddAppointmentForm(DBConnection dbCon, int staffID, int patientID, Appointment app, ReceptionistForm parent, bool editMode)
        {
            InitializeComponent();
            this.dbCon     = dbCon;
            this.pf        = new PatientFactory(dbCon);
            this.sf        = new StaffFactory(dbCon);
            this.af        = new AppointmentFactory(dbCon);
            this.staffID   = staffID;
            this.patientID = patientID;
            this.app       = app;
            this.parent    = parent;
            this.KeyUp    += AddAppointmentForm_KeyUp;
            this.editMode  = editMode;
            if (editMode)
            {
                this.Text = "Edit Appointment Details";
            }

            QueryBuilder b = new QueryBuilder();

            b.Select(Tables.ALL).From(Tables.STAFF_TABLE).Where(b.IsEqual(Tables.STAFF_TABLE.JobRole, "Doctor"), b.Or(), b.IsEqual(Tables.STAFF_TABLE.JobRole, "Nurse"));
            patients = pf.GetPatients();
            staff    = sf.GetStaff(b);

            if (editMode)
            {
                staff    = sf.GetStaffByID(staffID);
                patients = pf.GetPatientsByID(patientID);
                firstnametextBox1.Visible = false;
                lastnametextBox2.Visible  = false;
                findPatientButton.Visible = false;
            }
            else
            {
                this.statusComboBox.Enabled = false;
            }

            ctf = new CustomTableFactory(dbCon);
            this.statusComboBox.SelectedIndex = 0;

            PopulateComboBoxes();
        }
Exemple #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            int id = int.Parse(staffIdTxt.Text);

            var search = (from x in db.Staff
                          where x.StaffId == id &&
                          x.StaffPassword.Equals(passTxt.Text)
                          select x.StaffPosition).FirstOrDefault();

            if (search != null)
            {
                if (search.Equals("Receptionist"))
                {
                    rForm = new ReceptionistForm();
                    rForm.Show();
                }
                else if (search.Equals("HouseKeeping"))
                {
                    hkForm = new HouseKeepingForm();
                    hkForm.Show();
                }
                else if (search.Equals("DiningRoom"))
                {
                    drForm = new DiningRoomForm();
                    drForm.Show();
                }
                else if (search.Equals("RoomService"))
                {
                    rsForm = new RoomServiceForm();
                    rsForm.Show();
                }
                else if (search.Equals("Kitchen"))
                {
                    kForm = new KitchenForm();
                    kForm.Show();
                }
                else if (search.Equals("Purchasing"))
                {
                    pForm = new PurchasingForm();
                    pForm.Show();
                }
                else if (search.Equals("AccountingAndFinance"))
                {
                    aafForm = new AccountingAndFinanceForm();
                    aafForm.Show();
                }
                else if (search.Equals("SalesAndMarketing"))
                {
                    samForm = new SalesAndMarketingForm();
                    samForm.Show();
                }
                else if (search.Equals("HumanCapital"))
                {
                    hcForm = new HumanCapitalForm();
                    hcForm.Show();
                }
                else if (search.Equals("HotelManager"))
                {
                    hmForm = new HotelManagerForm();
                    hmForm.Show();
                }
            }
            else
            {
                MessageBox.Show("Invalid Id or Password");
            }
        }