public static TMSBusApplyDetails Get(System.Int64 badApplyId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSBusApplyDetails instance; instance = new TMSBusApplyDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusApplyDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, badApplyId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSBusApplyDetails ID:" + badApplyId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSBusApplyDetails[] Search(System.Int64?badApplyId, System.Int64?badStudentId, System.Int64?badFacultyId, System.Int64?badBusId, System.String badSeatNumber, System.String badTravelingStatus, System.DateTime?badDate, System.Int32?badStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusApplyDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, badApplyId, badStudentId, badFacultyId, badBusId, badSeatNumber, badTravelingStatus, badDate, badStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSBusApplyDetails.MapFrom(ds)); }
public static TMSBusApplyDetails[] MapFrom(DataSet ds) { List <TMSBusApplyDetails> objects; // Initialise Collection. objects = new List <TMSBusApplyDetails>(); // 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_BusApplyDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_BusApplyDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSBusApplyDetails instance = new TMSBusApplyDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static TMSBusApplyDetails[] Search(TMSBusApplyDetails searchObject) { return(Search(searchObject.BADApplyId, searchObject.BADStudentId, searchObject.BADFacultyId, searchObject.BADBusId, searchObject.BADSeatNumber, searchObject.BADTravelingStatus, searchObject.BADDate, searchObject.BADStatus)); }
public static void Update(TMSBusApplyDetails tMSBusApplyDetails, DbTransaction transaction) { tMSBusApplyDetails.Update(transaction); }
public static void Update(TMSBusApplyDetails tMSBusApplyDetails) { tMSBusApplyDetails.Update(); }
public static void Update(TMSBusApplyDetails tMSBusApplyDetails, DbTransaction transaction) { tMSBusApplyDetails.Update(transaction); }
public static void Update(TMSBusApplyDetails tMSBusApplyDetails) { tMSBusApplyDetails.Update(); }
public static TMSBusApplyDetails[] Search(TMSBusApplyDetails searchObject) { return Search ( searchObject.BADApplyId, searchObject.BADStudentId, searchObject.BADFacultyId, searchObject.BADBusId, searchObject.BADSeatNumber, searchObject.BADTravelingStatus, searchObject.BADDate, searchObject.BADStatus); }
public static TMSBusApplyDetails[] MapFrom(DataSet ds) { List<TMSBusApplyDetails> objects; // Initialise Collection. objects = new List<TMSBusApplyDetails>(); // 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_BusApplyDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_BusApplyDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSBusApplyDetails instance = new TMSBusApplyDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSBusApplyDetails Get(System.Int64 badApplyId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSBusApplyDetails instance; instance = new TMSBusApplyDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusApplyDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, badApplyId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSBusApplyDetails ID:" + badApplyId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }