public static TMSEvolutionOfMotorDevelopment Get(System.Int64 emdDevelopmentId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSEvolutionOfMotorDevelopment instance; instance = new TMSEvolutionOfMotorDevelopment(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSEvolutionOfMotorDevelopment_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, emdDevelopmentId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSEvolutionOfMotorDevelopment ID:" + emdDevelopmentId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSEvolutionOfMotorDevelopment[] Search(System.Int64?emdDevelopmentId, System.Int64?emdSchoolId, System.Int64?emdSchoolSubId, System.Int64?emdStudentLoginId, System.String emdAlertandRemeber, System.String emdKickThrowBall, System.String emdHopJumpRun, System.String emdKeenObserver, System.String emdCommunicateClearly, System.String emdGripWithPencil, System.String emdMyBalanceHandEye, System.String emdPicesOfPuzzle, System.String emdAddedByType, System.Int64?emdAddedByLoginId, System.DateTime?emdDate, System.Int32?emdStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSEvolutionOfMotorDevelopment_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, emdDevelopmentId, emdSchoolId, emdSchoolSubId, emdStudentLoginId, emdAlertandRemeber, emdKickThrowBall, emdHopJumpRun, emdKeenObserver, emdCommunicateClearly, emdGripWithPencil, emdMyBalanceHandEye, emdPicesOfPuzzle, emdAddedByType, emdAddedByLoginId, emdDate, emdStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSEvolutionOfMotorDevelopment.MapFrom(ds)); }
public static TMSEvolutionOfMotorDevelopment[] MapFrom(DataSet ds) { List <TMSEvolutionOfMotorDevelopment> objects; // Initialise Collection. objects = new List <TMSEvolutionOfMotorDevelopment>(); // 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_EvolutionOfMotorDevelopment] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_EvolutionOfMotorDevelopment] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSEvolutionOfMotorDevelopment instance = new TMSEvolutionOfMotorDevelopment(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static TMSEvolutionOfMotorDevelopment[] MapFrom(DataSet ds) { List<TMSEvolutionOfMotorDevelopment> objects; // Initialise Collection. objects = new List<TMSEvolutionOfMotorDevelopment>(); // 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_EvolutionOfMotorDevelopment] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_EvolutionOfMotorDevelopment] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSEvolutionOfMotorDevelopment instance = new TMSEvolutionOfMotorDevelopment(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSEvolutionOfMotorDevelopment Get(System.Int64 emdDevelopmentId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSEvolutionOfMotorDevelopment instance; instance = new TMSEvolutionOfMotorDevelopment(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSEvolutionOfMotorDevelopment_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, emdDevelopmentId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSEvolutionOfMotorDevelopment ID:" + emdDevelopmentId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }