Пример #1
0
        public BusinessObject GetTemplateObject( )
        {
            String  strSQL = String.Format("Select * From [{0}] Where [{1}]='{2}'", TableName, ABCCommon.ABCConstString.colABCStatus, ABCCommon.ABCConstString.ABCStatusTemplate);
            DataSet ds     = DatabaseHelper.RunQuery(strSQL);

            return(BusinessObjectHelper.GetBusinessObject(ds, TableName));
        }
Пример #2
0
        public BusinessObject GetObjectByName(String strObjectName)
        {
            DataSet ds = null;

            if (DatabaseHelper.IsSQLConnection())
            {
                ds = (DatabaseHelper as SqlDatabaseHelper).RunStoredProcedure(StoredProcedureGenerator.GetSPName(StoredProcedureGenerator.SPType.SelectByName, TableName), strObjectName);
            }
            else
            {
                ds = (DatabaseHelper as SQLiteDatabaseHelper).RunScript(QueryGenerator.GenSelectByName(TableName, strObjectName, false, true));
            }

            return(BusinessObjectHelper.GetBusinessObject(ds, TableName));
        }
Пример #3
0
        public BusinessObject GetObjectByID(Guid iObjectID)
        {
            try
            {
                DataSet ds = null;
                if (DatabaseHelper.IsSQLConnection())
                {
                    ds = (DatabaseHelper as SqlDatabaseHelper).RunStoredProcedure(StoredProcedureGenerator.GetSPName(StoredProcedureGenerator.SPType.Select, TableName), iObjectID);
                }
                else
                {
                    ds = (DatabaseHelper as SQLiteDatabaseHelper).RunScript(QueryGenerator.GenSelectByID(TableName, iObjectID));
                }

                return(BusinessObjectHelper.GetBusinessObject(ds, TableName));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Пример #4
0
        public BusinessObject GetFirstObject( )
        {
            StringBuilder strBuilder = new StringBuilder();

            strBuilder.Append(String.Format("Select Top(1) * From [{0}] ", TableName));

            if (DataStructureProvider.IsExistABCStatus(TableName))
            {
                strBuilder.Append(" WHERE ");
                strBuilder.Append(String.Format("[{0}]='{1}'", ABCCommon.ABCConstString.colABCStatus, ABCCommon.ABCConstString.ABCStatusAlive));
            }

            String strQuery = strBuilder.ToString();

            if (DatabaseHelper.IsSQLConnection() == false)
            {
                strQuery = SQLiteDatabaseHelper.RepairSelectSQLite(strQuery);
            }

            DataSet ds = DatabaseHelper.RunQuery(strQuery);

            return(BusinessObjectHelper.GetBusinessObject(ds, TableName));
        }
Пример #5
0
 public BusinessObject GetObjectFromDataRow(DataRow row)
 {
     return(BusinessObjectHelper.GetBusinessObject(row, TableName));
 }
Пример #6
0
        public BusinessObject GetObjectBySqlSP(string spName, params object[] paramValues)
        {
            DataSet ds = GetDataSetBySqlSP(spName, paramValues);

            return(BusinessObjectHelper.GetBusinessObject(ds, TableName));
        }
Пример #7
0
        public BusinessObject GetObjectByCondition(String strConditionQuery)
        {
            DataSet ds = GetDataSetByCondition(strConditionQuery);

            return(BusinessObjectHelper.GetBusinessObject(ds, TableName));
        }
Пример #8
0
        public BusinessObject GetObject(String strQuery)
        {
            DataSet ds = GetDataSet(strQuery);

            return(BusinessObjectHelper.GetBusinessObject(ds, TableName));
        }