public static EstimateRecord[] GetRecords(
        BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            ArrayList recList = EstimateTable.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize);

            return (EstimateRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.EstimateRecord"));
        }
        /// <summary>
        /// Return an array of values from the database.  The values returned are DISTINCT values.
        /// For example, GetColumnValues("Employees", "City") will return a list of all Cities
        /// from the Employees table. There will be no duplicates in the list.
        /// This function adds a Where Clause.  So you can say something like "Country = 'USA'" and in this
        /// case only cities in the US will be returned.
        /// You can use the IN operator to compare the values.  You can also use the resulting array to display
        /// such as String.Join(", ", GetColumnValues("Employees", "City", "Country = 'USA'")
        /// to display: New York, Chicago, Los Angeles, San Francisco
        /// </summary>
        /// <returns>An array of values for the given field as an Object.</returns>
        public static string[] GetColumnValues(string tableName, string fieldName, string whereStr)
        {
            // Find the
            PrimaryKeyTable bt = null;
            bt = (PrimaryKeyTable)DatabaseObjects.GetTableObject(tableName);
            if (bt == null)
            {
                throw new Exception("GETCOLUMNVALUES(" + tableName + ", " + fieldName + ", " + whereStr + "): " + Resource("Err:NoRecRetrieved"));
            }

            BaseColumn col = bt.TableDefinition.ColumnList.GetByCodeName(fieldName);
            if (col == null)
            {
                throw new Exception("GETCOLUMNVALUES(" + tableName + ", " + fieldName + ", " + whereStr + "): " + Resource("Err:NoRecRetrieved"));
            }

            string[] values = null;

            try
            {
                // Always start a transaction since we do not know if the calling function did.
                SqlBuilderColumnSelection sqlCol = new SqlBuilderColumnSelection(false, true);
                sqlCol.AddColumn(col);

                WhereClause wc = new WhereClause();
                if (!(whereStr == null) && whereStr.Trim().Length > 0)
                {
                    wc.iAND(whereStr);
                }
                BaseClasses.Data.BaseFilter join = null;
                values = bt.GetColumnValues(sqlCol, join, wc.GetFilter(), null, null, BaseTable.MIN_PAGE_NUMBER, BaseTable.MAX_BATCH_SIZE);
            }
            catch
            {
            }

            // The value can be null.  In this case, return an empty array since
            // that is an acceptable value.
            if (values == null)
            {
                values = new string[0];
            }

            return values;
        }
        public static string GetCount(
		BaseColumn col,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            SqlBuilderColumnSelection colSel = new SqlBuilderColumnSelection(false, false);
            colSel.AddColumn(col, SqlBuilderColumnOperation.OperationType.Count);

            return EstimateTable.Instance.GetColumnStatistics(colSel, null, where.GetFilter(), null, orderBy, pageIndex, pageSize);
        }
 public static int GetRecordCount(WhereClause where)
 {
     return (int)EstimateTable.Instance.GetRecordListCount(null, where.GetFilter(), null, null);
 }
        public static string GetSum(
		BaseColumn col,
		BaseFilter join, 
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            SqlBuilderColumnSelection colSel = new SqlBuilderColumnSelection(false, false);
            colSel.AddColumn(col, SqlBuilderColumnOperation.OperationType.Sum);

            return UsersTable.Instance.GetColumnStatistics(colSel, join, where.GetFilter(), null, orderBy, pageIndex, pageSize);
        }
Exemple #6
0
 public static int GetRecordCount(WhereClause where)
 {
     return((int)SpeciesTable.Instance.GetRecordListCount(null, where.GetFilter(), null, null));
 }
        public static VwPropSBondBudgetRecord[] GetRecords(
        BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            ArrayList recList = VwPropSBondBudgetView.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize);

            return (VwPropSBondBudgetRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.VwPropSBondBudgetRecord"));
        }
        public static UsersRecord[] GetRecords(
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            BaseClasses.Data.BaseFilter join = null;
            ArrayList recList = UsersTable.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize);

            return (UsersRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.UsersRecord"));
        }
        public static string Export(WhereClause where)
        {
            BaseFilter whereFilter = null;
            if (where != null)
            {
            whereFilter = where.GetFilter();
            }

            return VwPropSBondBudgetView.Instance.ExportRecordData(whereFilter);
        }
 public static int GetRecordCount(BaseFilter join, WhereClause where)
 {
     return (int)VwPropSBondBudgetView.Instance.GetRecordListCount(join, where.GetFilter(), null, null);
 }
Exemple #11
0
 public static int GetRecordCount(BaseFilter join, WhereClause where)
 {
     return((int)TrapTypesTable.Instance.GetRecordListCount(join, where.GetFilter(), null, null));
 }
        public static VwPropSBondBudgetDetailRecord[] GetRecords(
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize,
		ref int totalRecords)
        {
            BaseClasses.Data.BaseFilter join = null;
            ArrayList recList = VwPropSBondBudgetDetailView.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize, ref totalRecords);

            return (VwPropSBondBudgetDetailRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.VwPropSBondBudgetDetailRecord"));
        }
 public static int GetRecordCount(WhereClause where)
 {
     return (int)VwPropSBondBudgetDetailView.Instance.GetRecordListCount(null, where.GetFilter(), null, null);
 }
        public static string Export(WhereClause where)
        {
            BaseFilter whereFilter = null;
            if (where != null)
            {
            whereFilter = where.GetFilter();
            }

            return UsersTable.Instance.ExportRecordData(whereFilter);
        }
        public static string GetSum(
		BaseColumn col,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            SqlBuilderColumnSelection colSel = new SqlBuilderColumnSelection(false, false);
            colSel.AddColumn(col, SqlBuilderColumnOperation.OperationType.Sum);

            return VwPropSBondBudgetView.Instance.GetColumnStatistics(colSel, null, where.GetFilter(), null, orderBy, pageIndex, pageSize);
        }
 public static int GetRecordCount(BaseFilter join, WhereClause where)
 {
     return (int)UsersTable.Instance.GetRecordListCount(join, where.GetFilter(), null, null);
 }
 public static int GetRecordCount(WhereClause where)
 {
     return (int)VwAreaView.Instance.GetRecordListCount(null, where.GetFilter(), null, null);
 }
        public static UsersRecord[] GetRecords(
        BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize,
		ref int totalRecords)
        {
            ArrayList recList = UsersTable.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize, ref totalRecords);

            return (UsersRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.UsersRecord"));
        }
        public static ReportRecord[] GetRecords(
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize,
		ref int totalRecords)
        {
            BaseClasses.Data.BaseFilter join = null;
            ArrayList recList = ReportTable.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize, ref totalRecords);

            return (ReportRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.ReportRecord"));
        }
        public static String[] GetValues(
		BaseColumn col,
		BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int maxItems)
        {
            // Create the filter list.
            SqlBuilderColumnSelection retCol = new SqlBuilderColumnSelection(false, true);
            retCol.AddColumn(col);

            return UsersTable.Instance.GetColumnValues(retCol, join, where.GetFilter(), null, orderBy, BaseTable.MIN_PAGE_NUMBER, maxItems);
        }
 public static int GetRecordCount(BaseFilter join, WhereClause where)
 {
     return((int)View_Trap_SummaryView.Instance.GetRecordListCount(join, where.GetFilter(), null, null));
 }