public static DataSet GetSearch(TMSFeatures searchObject)
 {
     return GetSearch(searchObject.FEFeatureID, searchObject.FETitle, searchObject.FESubTitle, searchObject.FEDescription, searchObject.FEImage, searchObject.EFType, searchObject.FEImageLogo, searchObject.FEDate, searchObject.FEStatus);
 }
 public static void Update(TMSFeatures tMSFeatures, DbTransaction transaction)
 {
     tMSFeatures.Update(transaction);
 }
    public static TMSFeatures[] MapFrom(DataSet ds)
    {
        List<TMSFeatures> objects;

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

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

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

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

        // Return collection.
        return objects.ToArray();
    }
 public static void Update(TMSFeatures tMSFeatures)
 {
     tMSFeatures.Update();
 }
    public static TMSFeatures Get(System.Int64 feFeatureID)
    {
        DataSet ds;
        Database db;
        string sqlCommand;
        DbCommand dbCommand;
        TMSFeatures instance;

        instance = new TMSFeatures();

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

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

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