public static TMSDesignationType Get(System.Int64 dtDestId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSDesignationType instance; instance = new TMSDesignationType(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSDesignationType_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, dtDestId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSDesignationType ID:" + dtDestId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSDesignationType[] Search(System.Int64?dtDestId, System.String dtDesignationName, System.Int32?dtStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSDesignationType_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, dtDestId, dtDesignationName, dtStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSDesignationType.MapFrom(ds)); }
public static TMSDesignationType[] MapFrom(DataSet ds) { List <TMSDesignationType> objects; // Initialise Collection. objects = new List <TMSDesignationType>(); // Validation. if (ds == null) { throw new ApplicationException("Cannot map to dataset null."); } else if (ds.Tables[TABLE_NAME].Rows.Count == 0) { return(objects.ToArray()); } if (ds.Tables[TABLE_NAME] == null) { throw new ApplicationException("Cannot find table [dbo].[TMS_DesignationType] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_DesignationType] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSDesignationType instance = new TMSDesignationType(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static TMSDesignationType[] Search(TMSDesignationType searchObject) { return(Search(searchObject.DTDestId, searchObject.DTDesignationName, searchObject.DTStatus)); }
public static void Update(TMSDesignationType tMSDesignationType, DbTransaction transaction) { tMSDesignationType.Update(transaction); }
public static void Update(TMSDesignationType tMSDesignationType) { tMSDesignationType.Update(); }
public static TMSDesignationType[] Search(TMSDesignationType searchObject) { return Search ( searchObject.DTDestId, searchObject.DTDesignationName, searchObject.DTStatus); }
public static TMSDesignationType[] MapFrom(DataSet ds) { List<TMSDesignationType> objects; // Initialise Collection. objects = new List<TMSDesignationType>(); // Validation. if (ds == null) throw new ApplicationException("Cannot map to dataset null."); else if (ds.Tables[TABLE_NAME].Rows.Count == 0) return objects.ToArray(); if (ds.Tables[TABLE_NAME] == null) throw new ApplicationException("Cannot find table [dbo].[TMS_DesignationType] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_DesignationType] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSDesignationType instance = new TMSDesignationType(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSDesignationType Get(System.Int64 dtDestId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSDesignationType instance; instance = new TMSDesignationType(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSDesignationType_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, dtDestId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSDesignationType ID:" + dtDestId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }