Пример #1
0
        private static void GetDBData(string TableName, string SelectSQL)
        {
            OracleDataAdapter DataAdapter = new OracleDataAdapter(new OracleCommand(SelectSQL, Database_Connector.GetConnection()));

            DataAdapter.Fill(DS, TableName);
            Database_Connector.CloseConnection();
        }
Пример #2
0
        private void Load(int Userid)
        {
            string select = "SELECT PERMISSION FROM USER_PERMISSIONS where USER_ID=:userid " +
                            "UNION ALL SELECT PERMISSION FROM USER_GROUPS inner join GROUP_PERMISSIONS " +
                            "on USER_GROUPS.GROUP_ID=GROUP_PERMISSIONS.GROUP_ID where USER_GROUPS.USER_ID=:userid";

            OracleCommand cmd = new OracleCommand(select, Database_Connector.GetConnection());

            OracleParameter uid = new OracleParameter("userid", OracleDbType.Int32);

            uid.Value = Userid;

            cmd.Parameters.Add(uid);
            OracleDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                UserPermissions.Add(dr["PERMISSION"].ToString().ToLower());
            }

            Database_Connector.CloseConnection();
        }
Пример #3
0
 private void Main_Menu_FormClosed(object sender, FormClosedEventArgs e)
 {
     Database_Connector.CloseConnection();
 }