public static TMSBusRouteDetails Get(System.Int64 brRouteId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSBusRouteDetails instance; instance = new TMSBusRouteDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusRouteDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, brRouteId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSBusRouteDetails ID:" + brRouteId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSBusRouteDetails[] Search(System.Int64?brRouteId, System.Int64?brBusId, System.String brStartRoute, System.String brEndRoute, System.String brArrivalTime, System.String brDepartureTime, System.String brHalt, System.String brKm, System.String brMapImage, System.DateTime?brDate, System.Int32?brStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusRouteDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, brRouteId, brBusId, brStartRoute, brEndRoute, brArrivalTime, brDepartureTime, brHalt, brKm, brMapImage, brDate, brStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSBusRouteDetails.MapFrom(ds)); }
public static TMSBusRouteDetails[] MapFrom(DataSet ds) { List <TMSBusRouteDetails> objects; // Initialise Collection. objects = new List <TMSBusRouteDetails>(); // 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_BusRouteDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_BusRouteDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSBusRouteDetails instance = new TMSBusRouteDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static void Update(TMSBusRouteDetails tMSBusRouteDetails, DbTransaction transaction) { tMSBusRouteDetails.Update(transaction); }
public static void Update(TMSBusRouteDetails tMSBusRouteDetails) { tMSBusRouteDetails.Update(); }
public static TMSBusRouteDetails[] Search(TMSBusRouteDetails searchObject) { return Search ( searchObject.BRRouteId, searchObject.BRBusId, searchObject.BRStartRoute, searchObject.BREndRoute, searchObject.BRArrivalTime, searchObject.BRDepartureTime, searchObject.BRHalt, searchObject.BrKm, searchObject.BRMapImage, searchObject.BRDate, searchObject.BRStatus); }
public static TMSBusRouteDetails[] MapFrom(DataSet ds) { List<TMSBusRouteDetails> objects; // Initialise Collection. objects = new List<TMSBusRouteDetails>(); // 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_BusRouteDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_BusRouteDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSBusRouteDetails instance = new TMSBusRouteDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSBusRouteDetails Get(System.Int64 brRouteId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSBusRouteDetails instance; instance = new TMSBusRouteDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSBusRouteDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, brRouteId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSBusRouteDetails ID:" + brRouteId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static TMSBusRouteDetails[] Search(TMSBusRouteDetails searchObject) { return(Search(searchObject.BRRouteId, searchObject.BRBusId, searchObject.BRStartRoute, searchObject.BREndRoute, searchObject.BRArrivalTime, searchObject.BRDepartureTime, searchObject.BRHalt, searchObject.BrKm, searchObject.BRMapImage, searchObject.BRDate, searchObject.BRStatus)); }