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)); }
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)); }
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); } }
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)); }
public BusinessObject GetObjectFromDataRow(DataRow row) { return(BusinessObjectHelper.GetBusinessObject(row, TableName)); }
public BusinessObject GetObjectBySqlSP(string spName, params object[] paramValues) { DataSet ds = GetDataSetBySqlSP(spName, paramValues); return(BusinessObjectHelper.GetBusinessObject(ds, TableName)); }
public BusinessObject GetObjectByCondition(String strConditionQuery) { DataSet ds = GetDataSetByCondition(strConditionQuery); return(BusinessObjectHelper.GetBusinessObject(ds, TableName)); }
public BusinessObject GetObject(String strQuery) { DataSet ds = GetDataSet(strQuery); return(BusinessObjectHelper.GetBusinessObject(ds, TableName)); }