public static TMSLeacturedDetails Get(System.Int64 ldLeacturedDetailsId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSLeacturedDetails instance; instance = new TMSLeacturedDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSLeacturedDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, ldLeacturedDetailsId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSLeacturedDetails ID:" + ldLeacturedDetailsId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSLeacturedDetails[] Search(System.Int64?ldLeacturedDetailsId, System.Int64?ldSubjectId, System.Int64?ldFacultyId, System.Int64?ldSchoolCatId, System.Int64?ldSubSchoolCatId, System.String ldWeekDays, System.Int64?ldLeactureTimeId, System.String ldExtra1, System.DateTime?ldDate, System.Int32?ldStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSLeacturedDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, ldLeacturedDetailsId, ldSubjectId, ldFacultyId, ldSchoolCatId, ldSubSchoolCatId, ldWeekDays, ldLeactureTimeId, ldExtra1, ldDate, ldStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSLeacturedDetails.MapFrom(ds)); }
public static TMSLeacturedDetails[] MapFrom(DataSet ds) { List <TMSLeacturedDetails> objects; // Initialise Collection. objects = new List <TMSLeacturedDetails>(); // 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_LeacturedDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_LeacturedDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSLeacturedDetails instance = new TMSLeacturedDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static void Update(TMSLeacturedDetails tMSLeacturedDetails, DbTransaction transaction) { tMSLeacturedDetails.Update(transaction); }
public static void Update(TMSLeacturedDetails tMSLeacturedDetails) { tMSLeacturedDetails.Update(); }
public static TMSLeacturedDetails[] Search(TMSLeacturedDetails searchObject) { return Search ( searchObject.LDLeacturedDetailsId, searchObject.LDSubjectId, searchObject.LDFacultyId, searchObject.LDSchoolCatId, searchObject.LDSubSchoolCatId, searchObject.LDWeekDays, searchObject.LDLeactureTimeId, searchObject.LDExtra1, searchObject.LDDate, searchObject.LDStatus); }
public static TMSLeacturedDetails[] MapFrom(DataSet ds) { List<TMSLeacturedDetails> objects; // Initialise Collection. objects = new List<TMSLeacturedDetails>(); // 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_LeacturedDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_LeacturedDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSLeacturedDetails instance = new TMSLeacturedDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSLeacturedDetails Get(System.Int64 ldLeacturedDetailsId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSLeacturedDetails instance; instance = new TMSLeacturedDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSLeacturedDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, ldLeacturedDetailsId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSLeacturedDetails ID:" + ldLeacturedDetailsId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static DataSet GetSearch(TMSLeacturedDetails searchObject) { return(GetSearch(searchObject.LDLeacturedDetailsId, searchObject.LDSubjectId, searchObject.LDFacultyId, searchObject.LDSchoolCatId, searchObject.LDSubSchoolCatId, searchObject.LDWeekDays, searchObject.LDLeactureTimeId, searchObject.LDExtra1, searchObject.LDDate, searchObject.LDStatus)); }