public static TMSExamTimeTable Get(System.Int64 ettExamId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSExamTimeTable instance; instance = new TMSExamTimeTable(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSExamTimeTable_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, ettExamId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSExamTimeTable ID:" + ettExamId.ToString()+ " from Database."); // Return results. { return(null); } ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSExamTimeTable[] Search(System.Int64?ettExamId, System.String ettExamCode, System.Int64?ettFacultyLoginId, System.String ettExamType, System.Int64?ettExamTestId, System.Int64?ettSchoolId, System.Int64?ettSchoolSubId, System.Int64?ettSubjectId, System.Int64?ettDepartmentID, System.String ettExtra1, System.DateTime?ettExamDate, System.String ettStartTime, System.String ettEndTime, System.Int64?ettAddedById, System.String ettAddedType, System.DateTime?ettDate, System.Int32?ettStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSExamTimeTable_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, ettExamId, ettExamCode, ettFacultyLoginId, ettExamType, ettExamTestId, ettSchoolId, ettSchoolSubId, ettSubjectId, ettDepartmentID, ettExtra1, ettExamDate, ettStartTime, ettEndTime, ettAddedById, ettAddedType, ettDate, ettStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSExamTimeTable.MapFrom(ds)); }
public static TMSExamTimeTable[] MapFrom(DataSet ds) { List <TMSExamTimeTable> objects; // Initialise Collection. objects = new List <TMSExamTimeTable>(); // 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_ExamTimeTable] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_ExamTimeTable] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSExamTimeTable instance = new TMSExamTimeTable(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static DataSet GetSearch(TMSExamTimeTable searchObject) { return(GetSearch(searchObject.ETTExamId, searchObject.ETTExamCode, searchObject.ETTFacultyLoginId, searchObject.ETTExamType, searchObject.ETTExamTestId, searchObject.ETTSchoolId, searchObject.ETTSchoolSubId, searchObject.ETTSubjectId, searchObject.ETTDepartmentID, searchObject.ETTExtra1, searchObject.ETTExamDate, searchObject.ETTStartTime, searchObject.ETTEndTime, searchObject.ETTAddedById, searchObject.ETTAddedType, searchObject.ETTDate, searchObject.ETTStatus)); }
public static void Update(TMSExamTimeTable tMSExamTimeTable, DbTransaction transaction) { tMSExamTimeTable.Update(transaction); }
public static void Update(TMSExamTimeTable tMSExamTimeTable) { tMSExamTimeTable.Update(); }
public static TMSExamTimeTable[] Search(TMSExamTimeTable searchObject) { return Search ( searchObject.ETTExamId, searchObject.ETTExamCode, searchObject.ETTFacultyLoginId, searchObject.ETTExamType, searchObject.ETTExamTestId, searchObject.ETTSchoolId, searchObject.ETTSchoolSubId, searchObject.ETTSubjectId, searchObject.ETTDepartmentID, searchObject.ETTExtra1, searchObject.ETTExamDate, searchObject.ETTStartTime, searchObject.ETTEndTime, searchObject.ETTAddedById, searchObject.ETTAddedType, searchObject.ETTDate, searchObject.ETTStatus); }
public static TMSExamTimeTable[] MapFrom(DataSet ds) { List<TMSExamTimeTable> objects; // Initialise Collection. objects = new List<TMSExamTimeTable>(); // 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_ExamTimeTable] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_ExamTimeTable] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSExamTimeTable instance = new TMSExamTimeTable(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSExamTimeTable Get(System.Int64 ettExamId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSExamTimeTable instance; instance = new TMSExamTimeTable(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSExamTimeTable_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, ettExamId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSExamTimeTable ID:" + ettExamId.ToString()+ " from Database."); // Return results. return null; ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }