public static TMSResultDetails Get(System.Int64 rdResultId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSResultDetails instance; instance = new TMSResultDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSResultDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, rdResultId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSResultDetails ID:" + rdResultId.ToString()+ " from Database."); // Return results. { return(null); } ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSResultDetails[] Search(System.Int64?rdResultId, System.Int64?rdSchoolId, System.Int64?rdSchoolSubId, System.Int64?rdStudentId, System.Int64?rdSubjectId, System.String rdExamType, System.Int64?rdExamId, System.String rdExamName, System.String rdResultText, System.Int32?rdMarks, System.String rdGrade, System.DateTime?rdResultDate, System.Int64?rdResultAddedBy, System.String rdResultStatus, System.DateTime?rdDate, System.Int32?rdStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSResultDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, rdResultId, rdSchoolId, rdSchoolSubId, rdStudentId, rdSubjectId, rdExamType, rdExamId, rdExamName, rdResultText, rdMarks, rdGrade, rdResultDate, rdResultAddedBy, rdResultStatus, rdDate, rdStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSResultDetails.MapFrom(ds)); }
public static TMSResultDetails[] MapFrom(DataSet ds) { List <TMSResultDetails> objects; // Initialise Collection. objects = new List <TMSResultDetails>(); // 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_ResultDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_ResultDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSResultDetails instance = new TMSResultDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static void Update(TMSResultDetails tMSResultDetails, DbTransaction transaction) { tMSResultDetails.Update(transaction); }
public static void Update(TMSResultDetails tMSResultDetails) { tMSResultDetails.Update(); }
public static TMSResultDetails[] Search(TMSResultDetails searchObject) { return Search ( searchObject.RDResultId, searchObject.RDSchoolId, searchObject.RDSchoolSubId, searchObject.RDStudentId, searchObject.RDSubjectId, searchObject.RDExamType, searchObject.RDExamId, searchObject.RDExamName, searchObject.RDResultText, searchObject.RDMarks, searchObject.RDGrade, searchObject.RDResultDate, searchObject.RDResultAddedBy, searchObject.RDResultStatus, searchObject.RDDate, searchObject.RDStatus); }
public static TMSResultDetails[] MapFrom(DataSet ds) { List<TMSResultDetails> objects; // Initialise Collection. objects = new List<TMSResultDetails>(); // 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_ResultDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_ResultDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSResultDetails instance = new TMSResultDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSResultDetails Get(System.Int64 rdResultId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSResultDetails instance; instance = new TMSResultDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSResultDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, rdResultId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSResultDetails ID:" + rdResultId.ToString()+ " from Database."); // Return results. return null; ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static DataSet GetSearch(TMSResultDetails searchObject) { return(GetSearch(searchObject.RDResultId, searchObject.RDSchoolId, searchObject.RDSchoolSubId, searchObject.RDStudentId, searchObject.RDSubjectId, searchObject.RDExamType, searchObject.RDExamId, searchObject.RDExamName, searchObject.RDResultText, searchObject.RDMarks, searchObject.RDGrade, searchObject.RDResultDate, searchObject.RDResultAddedBy, searchObject.RDResultStatus, searchObject.RDDate, searchObject.RDStatus)); }
public static void Update(TMSResultDetails tMSResultDetails, DbTransaction transaction) { tMSResultDetails.Update(transaction); }
public static void Update(TMSResultDetails tMSResultDetails) { tMSResultDetails.Update(); }