示例#1
0
        /// <summary>
        /// Returns a list of users (suitable for read-only lists, such as combos), optionally of a certain role.
        /// </summary>
        /// <param name="roleId">Role to filter (negative number means all).</param>
        /// <returns>A list of users (id, full name), ordered by full name.</returns>
        public DataSet GetUserList(int roleId)
        {
            Database d = DatabaseFactory.GetDatabase();

            if (roleId >= 0)
            {
                return(d.FillDataSet("USR_ID, USR_FULLNAME", "VW_USERS_LIST", null, "USR_ROL_ID = @VW_USERS_LIST.USR_ROL_ID", "VW_USERS_LIST", -1, roleId));
            }
            else
            {
                return(d.FillDataSet("USR_ID, USR_FULLNAME", "VW_USERS_LIST", null, null, "VW_USERS_LIST", -1));
            }
        }
        public DataSet LoadStaticResources(string culture, int logicalUnit)
        {
            Database d = DatabaseFactory.GetDatabase();

            object[] values = { culture, "STATICS", logicalUnit };
            return(d.FillDataSet("SELECT UPPER(LIT_DESCSHORT), LIT_DESCLONG FROM LITERALS "
                                 + "WHERE LIT_LAN_ID = @LITERALS.LIT_LAN_ID@ "
                                 + "AND LIT_CATEGORY = @LITERALS.LIT_CATEGORY@ "
                                 + "AND LIT_DLUNI_ID = @LITERALS.LIT_DLUNI_ID@", "LiteralesField", values));
        }
示例#3
0
        /// <summary>
        /// Executes a Query and fills a DataSet.
        /// </summary>
        /// <param name="select">Fields to SELECT.</param>
        /// <param name="from">Tables and joins clauses.</param>
        /// <param name="where">Filters to add to where. Null if none.</param>
        /// <param name="groupBy">Fields to GROUP BY. Null if none.</param>
        /// <param name="orderBy">Fields to ORDER BY. Null if none.</param>
        /// <returns>Returns a DataSet which contains a DataTable. The table name is "Results".</returns>
        public DataSet FillDataSet(
            string select,
            string from,
            string where,
            string groupBy,
            string orderBy
            )
        {
            Database d = DatabaseFactory.GetDatabase();

            return(d.FillDataSet(select, from, orderBy, where, groupBy, "Results", -1));
        }
        public DataSet LoadMessageBoxResources(string culture, int logicalUnit)
        {
            Database d = DatabaseFactory.GetDatabase();

            object[] values = { culture, "VIEWS", "MESSAGES", "MODULES", logicalUnit };
            return(d.FillDataSet("SELECT LIT_ID, LIT_DESCSHORT, LIT_DESCLONG FROM LITERALS "
                                 + "WHERE LIT_LAN_ID = @LITERALS.LIT_LAN_ID@ "
                                 + "AND (LIT_CATEGORY = @LITERALS.LIT_CATEGORY@ "
                                 + "OR LIT_CATEGORY = @LITERALS.LIT_CATEGORY@ "
                                 + "OR LIT_CATEGORY = @LITERALS.LIT_CATEGORY@) "
                                 + "AND LIT_DLUNI_ID = @LITERALS.LIT_DLUNI_ID@", "LiteralesField", values));
        }
        public DataSet LoadMenuResources(string culture, int logicalUnit)
        {
            Database d = DatabaseFactory.GetDatabase();

            object[] values = { culture, "FIELD", "STATICS", "MESSAGES", logicalUnit };
            return(d.FillDataSet("SELECT LIT_ID, LIT_DESCSHORT, LIT_DESCLONG FROM LITERALS "
                                 + "WHERE LIT_LAN_ID = @LITERALS.LIT_LAN_ID@ "
                                 + "AND LIT_CATEGORY <> @LITERALS.LIT_CATEGORY@ "
                                 + "AND LIT_CATEGORY <> @LITERALS.LIT_CATEGORY@ "
                                 + "AND LIT_CATEGORY <> @LITERALS.LIT_CATEGORY@ "
                                 + "AND LIT_DLUNI_ID = @LITERALS.LIT_DLUNI_ID@", "Literales", values));
        }
示例#6
0
        public DataSet FillDataSet(
            string table,
            string select,
            string from,
            string where,
            string groupBy,
            string orderBy,
            object[] values
            )
        {
            Database d = DatabaseFactory.GetDatabase();

            return(d.FillDataSet(select, from, orderBy, where, groupBy, table, -1, values));
        }
示例#7
0
        public void FillDataSet(
            ref DataSet dataSet,
            string table,
            string select,
            string from,
            string where,
            string groupBy,
            string orderBy,
            object[] values
            )
        {
            Database d = DatabaseFactory.GetDatabase();

            d.FillDataSet(ref dataSet, select, from, orderBy, where, groupBy, table, -1, values);
        }
示例#8
0
        public DataSet GetUserData(string login)
        {
            Database d = DatabaseFactory.GetDatabase();

            return(d.FillDataSet("USR_ID, USR_NAME, USR_SURNAME1, USR_SURNAME2, USR_ROL_ID, USR_LOGIN, USR_PASSWORD, USR_LAN_ID, USR_STATUS, USR_CUS_ID", "USERS", null, "USR_LOGIN = @USERS.USR_LOGIN@ AND USR_STATUS = @USERS.USR_STATUS@", "USERS", -1, login, 1));
        }