Beispiel #1
0
    public static TMSTitleType Get(System.Int64 ttTitleId)
    {
        DataSet      ds;
        Database     db;
        string       sqlCommand;
        DbCommand    dbCommand;
        TMSTitleType instance;


        instance = new TMSTitleType();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
Beispiel #2
0
    public static TMSTitleType[] Search(System.Int64?ttTitleId, System.String ttTitleName, System.Int32?ttStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSTitleType_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, ttTitleId, ttTitleName, ttStatus);

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


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
 public static DataSet GetSearch(TMSTitleType searchObject)
 {
     return GetSearch(searchObject.TTTitleId, searchObject.TTTitleName, searchObject.TTStatus);
 }
Beispiel #5
0
 public static TMSTitleType[] Search(TMSTitleType searchObject)
 {
     return(Search(searchObject.TTTitleId, searchObject.TTTitleName, searchObject.TTStatus));
 }
Beispiel #6
0
 public static void Update(TMSTitleType tMSTitleType, DbTransaction transaction)
 {
     tMSTitleType.Update(transaction);
 }
Beispiel #7
0
 public static void Update(TMSTitleType tMSTitleType)
 {
     tMSTitleType.Update();
 }
 public static void Update(TMSTitleType tMSTitleType, DbTransaction transaction)
 {
     tMSTitleType.Update(transaction);
 }
 public static void Update(TMSTitleType tMSTitleType)
 {
     tMSTitleType.Update();
 }
 public static TMSTitleType[] Search(TMSTitleType searchObject)
 {
     return Search ( searchObject.TTTitleId, searchObject.TTTitleName, searchObject.TTStatus);
 }
    public static TMSTitleType[] MapFrom(DataSet ds)
    {
        List<TMSTitleType> objects;

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

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

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

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

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

        instance = new TMSTitleType();

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

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

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }
 public static DataSet GetSearch(TMSTitleType searchObject)
 {
     return(GetSearch(searchObject.TTTitleId, searchObject.TTTitleName, searchObject.TTStatus));
 }