Пример #1
0
    public static TMSFunStuffDetails Get(System.Int64 fsdFunStuffId)
    {
        DataSet            ds;
        Database           db;
        string             sqlCommand;
        DbCommand          dbCommand;
        TMSFunStuffDetails instance;


        instance = new TMSFunStuffDetails();

        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSFunStuffDetails_SELECT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, fsdFunStuffId);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            throw new ApplicationException("Could not get TMSFunStuffDetails ID:" + fsdFunStuffId.ToString() + " from Database.");
        }
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
Пример #2
0
    public static TMSFunStuffDetails[] Search(System.Int64?fsdFunStuffId, System.Int64?fsdFacultyId, System.Int64?fsdStudentId, System.Int64?fsdSchoolID, System.Int64?fsdSchoolSubId, System.String fsdFunStuffType, System.String fsdFunStuffSubType, System.String fsdLanguage, System.String fsdQuestion, System.String fsdAnswer, System.String fsdTitle, System.String fsdDescription, System.String fsdDescription1, System.String fsdImage, System.String fsdAuthorName, System.Int64?fsdAddedbyId, System.String fsdExtra, System.String fsdPuzzleCategory, System.String fsdPuzzlePlayersType, System.String fsdGameLink, System.String fsdVideoUploadName, System.DateTime?fsdDate, System.Int32?fsdStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSFunStuffDetails_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, fsdFunStuffId, fsdFacultyId, fsdStudentId, fsdSchoolID, fsdSchoolSubId, fsdFunStuffType, fsdFunStuffSubType, fsdLanguage, fsdQuestion, fsdAnswer, fsdTitle, fsdDescription, fsdDescription1, fsdImage, fsdAuthorName, fsdAddedbyId, fsdExtra, fsdPuzzleCategory, fsdPuzzlePlayersType, fsdGameLink, fsdVideoUploadName, fsdDate, fsdStatus);

        ds = db.ExecuteDataSet(dbCommand);
        ds.Tables[0].TableName = TABLE_NAME;
        return(TMSFunStuffDetails.MapFrom(ds));
    }
Пример #3
0
    public static TMSFunStuffDetails[] MapFrom(DataSet ds)
    {
        List <TMSFunStuffDetails> objects;


        // Initialise Collection.
        objects = new List <TMSFunStuffDetails>();

        // 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_FunStuffDetails] in DataSet.");
        }

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        {
            throw new ApplicationException("Table [dbo].[TMS_FunStuffDetails] is empty.");
        }

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSFunStuffDetails instance = new TMSFunStuffDetails();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return(objects.ToArray());
    }
Пример #4
0
 public static TMSFunStuffDetails[] Search(TMSFunStuffDetails searchObject)
 {
     return(Search(searchObject.FSDFunStuffId, searchObject.FSDFacultyId, searchObject.FSDStudentId, searchObject.FSDSchoolID, searchObject.FSDSchoolSubId, searchObject.FSDFunStuffType, searchObject.FSDFunStuffSubType, searchObject.FSDLanguage, searchObject.FSDQuestion, searchObject.FSDAnswer, searchObject.FSDTitle, searchObject.FSDDescription, searchObject.FSDDescription1, searchObject.FSDImage, searchObject.FSDAuthorName, searchObject.FSDAddedbyId, searchObject.FSDExtra, searchObject.FSDPuzzleCategory, searchObject.FSDPuzzlePlayersType, searchObject.FSDGameLink, searchObject.FSDVideoUploadName, searchObject.FSDDate, searchObject.FSDStatus));
 }
Пример #5
0
 public static void Update(TMSFunStuffDetails tMSFunStuffDetails, DbTransaction transaction)
 {
     tMSFunStuffDetails.Update(transaction);
 }
Пример #6
0
 public static void Update(TMSFunStuffDetails tMSFunStuffDetails)
 {
     tMSFunStuffDetails.Update();
 }
 public static void Update(TMSFunStuffDetails tMSFunStuffDetails, DbTransaction transaction)
 {
     tMSFunStuffDetails.Update(transaction);
 }
 public static void Update(TMSFunStuffDetails tMSFunStuffDetails)
 {
     tMSFunStuffDetails.Update();
 }
 public static TMSFunStuffDetails[] Search(TMSFunStuffDetails searchObject)
 {
     return Search ( searchObject.FSDFunStuffId, searchObject.FSDFacultyId, searchObject.FSDStudentId, searchObject.FSDSchoolID, searchObject.FSDSchoolSubId, searchObject.FSDFunStuffType, searchObject.FSDFunStuffSubType, searchObject.FSDLanguage, searchObject.FSDQuestion, searchObject.FSDAnswer, searchObject.FSDTitle, searchObject.FSDDescription, searchObject.FSDDescription1, searchObject.FSDImage, searchObject.FSDAuthorName, searchObject.FSDAddedbyId, searchObject.FSDExtra, searchObject.FSDPuzzleCategory, searchObject.FSDPuzzlePlayersType, searchObject.FSDGameLink, searchObject.FSDVideoUploadName, searchObject.FSDDate, searchObject.FSDStatus);
 }
    public static TMSFunStuffDetails[] MapFrom(DataSet ds)
    {
        List<TMSFunStuffDetails> objects;

        // Initialise Collection.
        objects = new List<TMSFunStuffDetails>();

        // 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_FunStuffDetails] in DataSet.");

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        throw new ApplicationException("Table [dbo].[TMS_FunStuffDetails] is empty.");

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSFunStuffDetails instance = new TMSFunStuffDetails();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return objects.ToArray();
    }
    public static TMSFunStuffDetails Get(System.Int64 fsdFunStuffId)
    {
        DataSet ds;
        Database db;
        string sqlCommand;
        DbCommand dbCommand;
        TMSFunStuffDetails instance;

        instance = new TMSFunStuffDetails();

        db = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSFunStuffDetails_SELECT";
        dbCommand = db.GetStoredProcCommand(sqlCommand, fsdFunStuffId);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSFunStuffDetails ID:" + fsdFunStuffId.ToString()+ " from Database.");
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }