public RoomSelectionForm()
        {
            InitializeComponent();

            WindowState = FormWindowState.Maximized;
            FormBorderStyle = FormBorderStyle.None;

            wrapper_panel.Left = (this.ClientSize.Width - wrapper_panel.Width) / 2;
            wrapper_panel.Top = (this.ClientSize.Height - wrapper_panel.Height) / 2;

            LoadDefaults();

            LoginForm login = new LoginForm(0);
            login.ShowDialog();

            LOGGED_IN_ID = getLogInIDFromPassword(login.password);
        }
 //NEEDS TO BE WIRED UP TO LOGINFORM()
 private void btn_logOut_Click(object sender, EventArgs e)
 {
     LoginForm login = new LoginForm(1);
     login.ShowDialog();
     allowUserToClose = true;
 }
        private void EmployeeInformationForm_Load(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\TestDB.mdf;
            Integrated Security=True;Connect Timeout=30");

            cn.Open();

            //SqlCommand cmd = new SqlCommand("CREATE OR ALTER VIEW boss_view AS SELECT s.staff_id, j.job_title, s.s_name, s.salary, b.location_id , b.tel , s.password FROM staffs s JOIN jobs j ON(s.job_id = j.job_id) JOIN branches b ON(s.branch_id = b.branch_id) WHERE s.staff_id > 0", cn);
            //cmd.ExecuteNonQuery();
            //SqlDataAdapter da = new SqlDataAdapter(cmd);
            //DataSet ds = new DataSet();
            //da.Fill(ds);
            // DataTable dt = ds.Tables[0];

            //cmd = new SqlCommand(" CREATE OR ALTER VIEW menage_view AS SELECT s.staff_id, j.job_title, s.s_name, s.salary, b.location_id  FROM staffs s JOIN jobs j ON(s.job_id = j.job_id) JOIN branches b ON(s.branch_id = b.branch_id) WHERE s.staff_id > 20", cn);
            //cmd.ExecuteNonQuery();
            // da = new SqlDataAdapter(cmd);
            //ds = new DataSet();
            // da.Fill(ds);
            // dt = ds.Tables[1];

            //cmd = new SqlCommand("CREATE OR ALTER VIEW normal_view AS SELECT s.staff_id, j.job_title, s.s_name, s.salary ,b.location_id FROM staffs s JOIN jobs j ON(s.job_id = j.job_id) JOIN branches b ON(s.branch_id = b.branch_id)", cn);
            // cmd.ExecuteNonQuery();
            //da = new SqlDataAdapter(cmd);
            // ds = new DataSet();
            //da.Fill(ds);
            //dt = ds.Tables[2];
            //BOSS_VIEW MENAGE_VIEW NORMAL_VIEW 直接在資料庫中創建了!!(檢視表)

            load();
            load2();
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet        ds = new DataSet();
            DataTable      dt = new DataTable();

            LoginForm Lf2;

            Lf2 = new LoginForm();

            if (Lf2.id() == 0)
            {
                da = new SqlDataAdapter("SELECT job_title ,s_name ,staff_id ,salary,location_id,tel,password  FROM boss_view ", cn);
                da.Fill(ds);
                dataGridView1.DataSource = ds.Tables[0];
                dt = ds.Tables[0];
            }
            else if (Lf2.id() == 1)
            {
                da = new SqlDataAdapter("SELECT job_title ,s_name ,staff_id ,salary,location_id  FROM menage_view ", cn);
                da.Fill(ds);
                dataGridView1.DataSource = ds.Tables[0];
                dt = ds.Tables[0];
            }
            else
            {
                da = new SqlDataAdapter("SELECT job_title ,s_name ,staff_id ,salary,location_id  FROM menage_view ", cn);
                da.Fill(ds);
                dataGridView1.DataSource = ds.Tables[0];
                dt = ds.Tables[0];
            }
            if (Lf2.id() != 0)
            {
                btn_Insert.Enabled = false;
                btn_Update.Enabled = false;
                btn_Delete.Enabled = false;
            }
            cn.Close();

            /*SqlConnection cn = new SqlConnection(cnStr);
             * SqlDataAdapter da = new SqlDataAdapter("SELECT job_title ,s_name ,staff_id,password ,salary,location_id,tel  FROM" +
             *   " (SELECT j.job_title , s.s_name ,s.staff_id , s.password , s.salary, b.location_id , b.tel FROM jobs j JOIN staffs s ON j.job_id = s.job_id JOIN branches b ON s.branch_id = b.branch_id) b", cn);
             * DataSet ds = new DataSet();
             * da.Fill(ds);
             * dataGridView1.DataSource = ds.Tables[0];*/
        }