public static TMSClassAssignFacultyDetails Get(System.Int64 cafdAssignId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSClassAssignFacultyDetails instance; instance = new TMSClassAssignFacultyDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSClassAssignFacultyDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, cafdAssignId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSClassAssignFacultyDetails ID:" + cafdAssignId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSClassAssignFacultyDetails[] Search(System.Int64?cafdAssignId, System.Int64?cafdFacultyId, System.Int64?cafdSchoolId, System.Int64?cafdSchoolSubCategoryId, System.Int64?cafdDepartmentId, System.Int64?cafdSubjectId, System.String cafdAssignType, System.DateTime?cafdDate, System.Int32?cafdStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSClassAssignFacultyDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, cafdAssignId, cafdFacultyId, cafdSchoolId, cafdSchoolSubCategoryId, cafdDepartmentId, cafdSubjectId, cafdAssignType, cafdDate, cafdStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSClassAssignFacultyDetails.MapFrom(ds)); }
public static TMSClassAssignFacultyDetails[] MapFrom(DataSet ds) { List <TMSClassAssignFacultyDetails> objects; // Initialise Collection. objects = new List <TMSClassAssignFacultyDetails>(); // 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_ClassAssignFacultyDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_ClassAssignFacultyDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSClassAssignFacultyDetails instance = new TMSClassAssignFacultyDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static DataSet GetSearch(TMSClassAssignFacultyDetails searchObject) { return(GetSearch(searchObject.CAFDAssignId, searchObject.CAFDFacultyId, searchObject.CAFDSchoolId, searchObject.CAFDSchoolSubCategoryId, searchObject.CAFDDepartmentId, searchObject.CAFDSubjectId, searchObject.CAFDAssignType, searchObject.CAFDDate, searchObject.CAFDStatus)); }
public static void Update(TMSClassAssignFacultyDetails tMSClassAssignFacultyDetails, DbTransaction transaction) { tMSClassAssignFacultyDetails.Update(transaction); }
public static void Update(TMSClassAssignFacultyDetails tMSClassAssignFacultyDetails) { tMSClassAssignFacultyDetails.Update(); }
public static void Update(TMSClassAssignFacultyDetails tMSClassAssignFacultyDetails, DbTransaction transaction) { tMSClassAssignFacultyDetails.Update(transaction); }
public static void Update(TMSClassAssignFacultyDetails tMSClassAssignFacultyDetails) { tMSClassAssignFacultyDetails.Update(); }
public static TMSClassAssignFacultyDetails[] Search(TMSClassAssignFacultyDetails searchObject) { return Search ( searchObject.CAFDAssignId, searchObject.CAFDFacultyId, searchObject.CAFDSchoolId, searchObject.CAFDSchoolSubCategoryId, searchObject.CAFDDepartmentId, searchObject.CAFDSubjectId, searchObject.CAFDAssignType, searchObject.CAFDDate, searchObject.CAFDStatus); }
public static TMSClassAssignFacultyDetails[] MapFrom(DataSet ds) { List<TMSClassAssignFacultyDetails> objects; // Initialise Collection. objects = new List<TMSClassAssignFacultyDetails>(); // 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_ClassAssignFacultyDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_ClassAssignFacultyDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSClassAssignFacultyDetails instance = new TMSClassAssignFacultyDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSClassAssignFacultyDetails Get(System.Int64 cafdAssignId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSClassAssignFacultyDetails instance; instance = new TMSClassAssignFacultyDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSClassAssignFacultyDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, cafdAssignId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSClassAssignFacultyDetails ID:" + cafdAssignId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }