Example #1
0
        private void resetData()
        {
            SystemDB sysDB = new SystemDB();

            sysDB.retrieveData(this.ptID, out fName, out mName, out lName, out gender, out birthday, out address, out city, out email, out contactNo, out occu);

            fName_box.Text = fName;
            mName_box.Text = mName;
            lName_box.Text = lName;
            if (gender == "F")
            {
                gender_cbox.SelectedItem = "Female";
            }
            else
            {
                gender_cbox.SelectedItem = "Male";
            }

            //birthday_Box.Value.ToShortDateString() =
            streetAdd_box.Text = address;
            city_box.Text      = city;
            email_box.Text     = email;
            contactNo_box.Text = contactNo;
            occu_box.Text      = occu;
        }
Example #2
0
        public viewPtRec()
        {
            InitializeComponent();

            SystemDB      sysdb      = new SystemDB();
            BindingSource bindSource = new BindingSource();

            dataGrid.DataSource   = bindSource;
            bindSource.DataSource = sysdb.retrieveData();
        }
Example #3
0
        public PtHistory(int ptID)
        {
            InitializeComponent();
            this.ptID = ptID;

            SystemDB      sysdb      = new SystemDB();
            BindingSource bindSource = new BindingSource();

            histDataGrid.DataSource = bindSource;
            bindSource.DataSource   = sysdb.getHistory(ptID);
        }
Example #4
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            string fName     = fName_box.Text;
            string mName     = mName_box.Text;
            string lName     = lName_box.Text;
            string gender    = gender_cbox.SelectedItem.ToString();
            string birthday  = birthday_Box.Value.ToShortDateString();
            string address   = streetAdd_box.Text;
            string city      = city_box.Text;
            string email     = email_box.Text;
            string contactNo = contactNo_box.Text;
            string occu      = occu_box.Text;

            SystemDB sysDB = new SystemDB();
            checker  check = new checker();

            if (fName == "" || mName == "" || lName == "" || gender == "" || birthday == "" || address == "" || city == "" ||
                email == "" || contactNo == "" || occu == "")
            {
                errorLbl.Text = "Please fill out all fields.";
            }
            else if (!check.IsValidEmail(email))
            {
                errorLbl.Text = "Please enter a valid email address";
                email_box.Focus();
            }
            else
            {
                DialogResult result = MessageBox.Show("Are you sure to create new record?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    Boolean success = sysDB.createPatient(fName, mName, lName, gender, birthday, address, city, email, contactNo, occu);
                    if (success)
                    {
                        MessageBox.Show("Record Saved!", "Success");
                        result = MessageBox.Show("Create record again?\n(Clicking No will redirect you to the Main Menu)", "Again?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                        if (result == DialogResult.Yes)
                        {
                            resetBoxes();
                        }
                        else
                        {
                            this.Hide();
                            Menu menu = new Menu();
                            menu.ShowDialog();
                            this.Dispose();
                        }
                    }
                }
            }
        }
Example #5
0
        private void stopBtn_Click(object sender, EventArgs e)
        {
            start           = false;
            stopBtn.Enabled = false;
            sensor.Stop();
            sensor = null;

            sysDB = new SystemDB();
            int  age    = sysDB.getAge(ptID); //if error, comment this
            char gender = sysDB.getGender(ptID);

            gaitResults results = new gaitResults(age, gender, ptID, this); //if error, comment this

            //gaitResults results = new gaitResults(age, gender, ptID, this); //uncomment this
            this.Hide();
            results.ShowDialog();
            this.Dispose();
        }
Example #6
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            string username = uNameTxtBox.Text;
            string pw       = pwTxtBox.Text;

            SystemDB sysDB = new SystemDB();
            Boolean  valid = sysDB.loginCheck(username, pw);

            if (valid)
            {
                this.Hide();
                Menu menu = new Menu();
                menu.ShowDialog();
                this.Close();
            }
            else
            {
                errorLbl.Text = "Wrong username or password!";
            }
        }