예제 #1
0
        private int Update_Grant()
        {
            DataTable temp = (DataTable)Priv_dataGridView.DataSource;

            foreach (DataRow dr in temp.Rows)
            {
                if ((dr["COLUMN_NAME"].ToString().ToUpper() == "LUONG" || dr["COLUMN_NAME"].ToString().ToUpper() == "PHUCAP") && this.Table_name == "LUONG")
                {
                    MessageBox.Show("CỘT " + dr["COLUMN_NAME"].ToString().ToUpper() + "ĐÃ ĐƯỢC MÃ HÓA, KHÔNG ĐƯỢC PHÉP ADD QUYỀN SELECT QUA APP!!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(0);
                }
            }
            MainForm.Login_Form.conn.Open();

            Oracle.revoke_priv(MainForm.Login_Form.conn, Table_name, MainForm.username, "UPDATE");
            foreach (DataRow dr in temp.Rows)
            {
                if (Convert.ToBoolean(dr["ENABLED"]))
                {
                    if (Convert.ToBoolean(dr["WITH GRANT OPTION"]) && MainForm.is_user)
                    {
                        Oracle.Grant_Update(MainForm.Login_Form.conn, dr["COLUMN_NAME"].ToString(), Table_name, MainForm.username, true);
                    }
                    else
                    {
                        Oracle.Grant_Update(MainForm.Login_Form.conn, dr["COLUMN_NAME"].ToString(), Table_name, MainForm.username, false);
                    }
                }
            }

            MainForm.Login_Form.conn.Close();
            return(1);
        }
예제 #2
0
        private void Update_Grant()
        {
            MainForm.Login_Form.conn.Open();

            DataTable temp = (DataTable)Priv_dataGridView.DataSource;

            Oracle.revoke_priv(MainForm.Login_Form.conn, Table_name, MainForm.username, "UPDATE");
            foreach (DataRow dr in temp.Rows)
            {
                if (Convert.ToBoolean(dr["ENABLED"]))
                {
                    if (Convert.ToBoolean(dr["WITH GRANT OPTION"]))
                    {
                        Oracle.Grant_Update(MainForm.Login_Form.conn, dr["COLUMN_NAME"].ToString(), Table_name, MainForm.username, true);
                    }
                    else
                    {
                        Oracle.Grant_Update(MainForm.Login_Form.conn, dr["COLUMN_NAME"].ToString(), Table_name, MainForm.username, false);
                    }
                }
            }
        }