コード例 #1
0
        void CmdLoginClick(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;
            string sql      = "select count(username) as count,role,id from employeee where username = '******' and password ='******'";

            sql = sql.Replace("d1", username);
            sql = sql.Replace("d2", password);

            DataTable result    = m1.GetDataTable(sql);
            string    count     = result.Rows[0][0].ToString();
            string    role      = result.Rows[0][1].ToString();
            string    id        = result.Rows[0][2].ToString();
            string    username1 = result.Rows[0][1].ToString();

            Global.active_user_name = username;
            Global.active_user_role = role;
            Global.active_user_id   = id;

            if (count == "1")
            {
                Task           form1 = new Task();
                MenuManagement form2 = new MenuManagement();
                form1.Show();
            }
            else
            {
                txtUsername.Text = "";
                txtPassword.Text = "";
                MessageBox.Show("please re-enter your username and password");
            }
        }
コード例 #2
0
        void CmdMenuManagementClick(object sender, EventArgs e)
        {
            MenuManagement form1 = new MenuManagement();

            form1.Show();
            this.Close();
        }