Example #1
0
        private void dashboard_label_Click(object sender, EventArgs e)
        {
            PharmacistHome pharmacistHome = new PharmacistHome();

            this.Hide();
            pharmacistHome.Show();
        }
Example #2
0
        private void login_button_Click(object sender, EventArgs e)
        {
            if (username.Text == "")
            {
                error.Text = "Username cannot be empty.";
            }
            else if (password.Text == "")
            {
                error.Text = "Password cannot be empty.";
            }
            else
            {
                UserFactory fac       = new UserFactory();
                UserStore   userStore = new UserStore(fac);
                userStore.SetUser(username.Text, password.Text, null);
                User u = userStore.LoginUser();

                if (u != null)
                {
                    error.ForeColor = Color.Green;
                    error.Text      = "Successfully Logged in.";
                    Global.Id       = u.Id;
                    Global.Username = u.Username;
                    Global.Type     = (UserType)u.Type;
                    Form nextForm = null;
                    if (u.Type == UserType.DOCTOR)
                    {
                        nextForm = new DoctorHome();
                    }
                    else if (u.Type == UserType.PATIENT)
                    {
                        nextForm = new PatientHome();
                    }
                    else if (u.Type == UserType.PHARMACIST || u.Type == UserType.LAB_TECHNICIAN)
                    {
                        nextForm = new PharmacistHome();
                    }
                    nextForm.Show();
                    this.Hide();
                }
                else
                {
                    error.ForeColor = Color.Red;
                    error.Text      = "Invalid Username or Password.";
                }
            }
        }
Example #3
0
        private void checkout_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells["Id"].Value != null)
                {
                    if (Convert.ToBoolean(row.Cells["Give"].Value))
                    {
                        ManagePrescription mp = new ManagePrescription();
                        mp.giveMedicine(Int32.Parse(row.Cells["Id"].Value.ToString()), Int32.Parse(patient_id.Text));
                    }
                }
            }
            PharmacistHome pharmacistHome = new PharmacistHome();

            this.Hide();
            pharmacistHome.Show();
        }