public static TMSGroupDetails Get(System.Int64 gdGroupId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSGroupDetails instance; instance = new TMSGroupDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSGroupDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, gdGroupId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { //throw new ApplicationException("Could not get TMSGroupDetails ID:" + gdGroupId.ToString()+ " from Database."); return(null); } ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSGroupDetails[] Search(System.Int64?gdGroupId, System.Int64?gdSchoolID, System.String gdGroupName, System.String gdGroupDescription, System.String gdGroupTeacherId, System.DateTime?gdDate, System.Int32?gdStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSGroupDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, gdGroupId, gdSchoolID, gdGroupName, gdGroupDescription, gdGroupTeacherId, gdDate, gdStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSGroupDetails.MapFrom(ds)); }
public static TMSGroupDetails[] MapFrom(DataSet ds) { List <TMSGroupDetails> objects; // Initialise Collection. objects = new List <TMSGroupDetails>(); // 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_GroupDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_GroupDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSGroupDetails instance = new TMSGroupDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static DataSet GetSearch(TMSGroupDetails searchObject) { return GetSearch ( searchObject.GDGroupId, searchObject.GDSchoolID, searchObject.GDGroupName, searchObject.GDGroupDescription, searchObject.GDGroupTeacherId, searchObject.GDDate, searchObject.GDStatus); }
public static DataSet GetSearch(TMSGroupDetails searchObject) { return(GetSearch(searchObject.GDGroupId, searchObject.GDSchoolID, searchObject.GDGroupName, searchObject.GDGroupDescription, searchObject.GDGroupTeacherId, searchObject.GDDate, searchObject.GDStatus)); }
public static void Update(TMSGroupDetails tMSGroupDetails, DbTransaction transaction) { tMSGroupDetails.Update(transaction); }
public static void Update(TMSGroupDetails tMSGroupDetails) { tMSGroupDetails.Update(); }
public static void Update(TMSGroupDetails tMSGroupDetails, DbTransaction transaction) { tMSGroupDetails.Update(transaction); }
public static void Update(TMSGroupDetails tMSGroupDetails) { tMSGroupDetails.Update(); }
public static TMSGroupDetails[] MapFrom(DataSet ds) { List<TMSGroupDetails> objects; // Initialise Collection. objects = new List<TMSGroupDetails>(); // 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_GroupDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_GroupDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSGroupDetails instance = new TMSGroupDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSGroupDetails Get(System.Int64 gdGroupId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSGroupDetails instance; instance = new TMSGroupDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSGroupDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, gdGroupId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSGroupDetails ID:" + gdGroupId.ToString()+ " from Database."); return null; ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }