Пример #1
0
        private void optionsToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            DialogResult signOutResult = MessageBox.Show("Are you sure to log out?", "Sign Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (signOutResult == DialogResult.Yes)
            {
                onlineUser = null;
                this.Dispose();
                this.Close();
            }
        }
Пример #2
0
        // 3. Delete rows (without procedures)
        private void deleteAccountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult deleteResult = MessageBox.Show("Are you sure to delete your account?", "Delete account", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            string[] info_to_delete = { @"DELETE FROM assigned_for WHERE ID = :id",
                                        @"DELETE FROM drug_history WHERE ID = :id",
                                        @"DELETE FROM attends WHERE ID = :id",
                                        @"DELETE FROM preexisting_condition WHERE ID = :id",
                                        @"DELETE FROM Patient_history WHERE ID = :id",
                                        @"DELETE FROM Patient WHERE ID = :id" };
            if (deleteResult == DialogResult.Yes)
            {
                for (int i = 0; i < info_to_delete.Length; ++i)
                {
                    try
                    {
                        OracleCommand cmd = new OracleCommand
                        {
                            Connection  = OrclDatabase.conn,
                            CommandText = info_to_delete[i],
                            CommandType = CommandType.Text
                        };

                        cmd.Parameters.Add("id", onlineUser.ID);

                        int r = cmd.ExecuteNonQuery();

                        if (r != -1 && i == info_to_delete.Length - 1)
                        {
                            onlineUser = null;
                            this.Dispose();
                            this.Close();
                            MessageBox.Show("User deleted from Database", "Operation Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
 public BookingAppointmentForm(SystemPersona loggedinUser)
 {
     onlineUser = loggedinUser;
     randomFees = new Random();
     InitializeComponent();
 }
Пример #4
0
 public AppointmentsForm(SystemPersona loggedinUser)
 {
     onlineUser = loggedinUser;
     InitializeComponent();
 }
Пример #5
0
 public MainForm(SystemPersona loggedinUser)
 {
     onlineUser = loggedinUser;
     InitializeComponent();
 }