public static TMSFunStuffNewsType Get(System.Int64 fsntTypeId)
    {
        DataSet             ds;
        Database            db;
        string              sqlCommand;
        DbCommand           dbCommand;
        TMSFunStuffNewsType instance;


        instance = new TMSFunStuffNewsType();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
    public static TMSFunStuffNewsType[] Search(System.Int64?fsntTypeId, System.String fsntNewsTypeName, System.DateTime?fsntDate, System.Int32?fsntStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSFunStuffNewsType_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, fsntTypeId, fsntNewsTypeName, fsntDate, fsntStatus);

        ds = db.ExecuteDataSet(dbCommand);
        ds.Tables[0].TableName = TABLE_NAME;
        return(TMSFunStuffNewsType.MapFrom(ds));
    }
    public static TMSFunStuffNewsType[] MapFrom(DataSet ds)
    {
        List <TMSFunStuffNewsType> objects;


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
 public static DataSet GetSearch(TMSFunStuffNewsType searchObject)
 {
     return GetSearch ( searchObject.FSNTTypeId, searchObject.FSNTNewsTypeName, searchObject.FSNTDate, searchObject.FSNTStatus);
 }
Example #5
0
 public static DataSet  GetSearch(TMSFunStuffNewsType searchObject)
 {
     return(GetSearch(searchObject.FSNTTypeId, searchObject.FSNTNewsTypeName, searchObject.FSNTDate, searchObject.FSNTStatus));
 }
 public static void Update(TMSFunStuffNewsType tMSFunStuffNewsType, DbTransaction transaction)
 {
     tMSFunStuffNewsType.Update(transaction);
 }
 public static void Update(TMSFunStuffNewsType tMSFunStuffNewsType)
 {
     tMSFunStuffNewsType.Update();
 }
    public static TMSFunStuffNewsType[] MapFrom(DataSet ds)
    {
        List<TMSFunStuffNewsType> objects;

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

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

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

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

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

        instance = new TMSFunStuffNewsType();

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

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

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }
 public static void Update(TMSFunStuffNewsType tMSFunStuffNewsType, DbTransaction transaction)
 {
     tMSFunStuffNewsType.Update(transaction);
 }
 public static void Update(TMSFunStuffNewsType tMSFunStuffNewsType)
 {
     tMSFunStuffNewsType.Update();
 }