public static TMSEventCalendar Get(System.Int64 ecEventId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSEventCalendar instance; instance = new TMSEventCalendar(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSEventCalendar_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, ecEventId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSEventCalendar ID:" + ecEventId.ToString()+ " from Database."); // Return results. { return(null); } ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSEventCalendar[] Search(System.Int64?ecEventId, System.Int64?ecDepartmentId, System.Int64?ecFacultyId, System.Int64?ecSchoolCategoryId, System.Int64?ecSubSchoolCategoryId, System.String ecEventName, System.String ecEventDescriptionOne, System.String ecEventDescriptionTwo, System.String ecEventYear, System.String ecEventStartTime, System.String ecEventEndTime, System.DateTime?ecEventStartDate, System.DateTime?ecEventEndDate, System.String ecEventImageOne, System.String ecEventImageTwo, System.DateTime?ecEventAddDate, System.Int64?ecEventAddedby, System.Int32?ecStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSEventCalendar_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, ecEventId, ecDepartmentId, ecFacultyId, ecSchoolCategoryId, ecSubSchoolCategoryId, ecEventName, ecEventDescriptionOne, ecEventDescriptionTwo, ecEventYear, ecEventStartTime, ecEventEndTime, ecEventStartDate, ecEventEndDate, ecEventImageOne, ecEventImageTwo, ecEventAddDate, ecEventAddedby, ecStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSEventCalendar.MapFrom(ds)); }
public static TMSEventCalendar[] MapFrom(DataSet ds) { List <TMSEventCalendar> objects; // Initialise Collection. objects = new List <TMSEventCalendar>(); // 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_EventCalendar] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_EventCalendar] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSEventCalendar instance = new TMSEventCalendar(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static void Update(TMSEventCalendar tMSEventCalendar, DbTransaction transaction) { tMSEventCalendar.Update(transaction); }
public static void Update(TMSEventCalendar tMSEventCalendar) { tMSEventCalendar.Update(); }
public static TMSEventCalendar[] Search(TMSEventCalendar searchObject) { return Search ( searchObject.ECEventId, searchObject.ECDepartmentId, searchObject.ECFacultyId, searchObject.ECSchoolCategoryId, searchObject.ECSubSchoolCategoryId, searchObject.ECEventName, searchObject.ECEventDescriptionOne, searchObject.ECEventDescriptionTwo, searchObject.ECEventYear, searchObject.ECEventStartTime, searchObject.ECEventEndTime, searchObject.ECEventStartDate, searchObject.ECEventEndDate, searchObject.ECEventImageOne, searchObject.ECEventImageTwo, searchObject.ECEventAddDate, searchObject.ECEventAddedby, searchObject.ECStatus); }
public static TMSEventCalendar[] MapFrom(DataSet ds) { List<TMSEventCalendar> objects; // Initialise Collection. objects = new List<TMSEventCalendar>(); // 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_EventCalendar] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_EventCalendar] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSEventCalendar instance = new TMSEventCalendar(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSEventCalendar Get(System.Int64 ecEventId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSEventCalendar instance; instance = new TMSEventCalendar(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSEventCalendar_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, ecEventId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSEventCalendar ID:" + ecEventId.ToString()+ " from Database."); // Return results. return null; ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static TMSEventCalendar[] Search(TMSEventCalendar searchObject) { return(Search(searchObject.ECEventId, searchObject.ECDepartmentId, searchObject.ECFacultyId, searchObject.ECSchoolCategoryId, searchObject.ECSubSchoolCategoryId, searchObject.ECEventName, searchObject.ECEventDescriptionOne, searchObject.ECEventDescriptionTwo, searchObject.ECEventYear, searchObject.ECEventStartTime, searchObject.ECEventEndTime, searchObject.ECEventStartDate, searchObject.ECEventEndDate, searchObject.ECEventImageOne, searchObject.ECEventImageTwo, searchObject.ECEventAddDate, searchObject.ECEventAddedby, searchObject.ECStatus)); }