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


        instance = new TMSApplicationSenderType();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
Пример #2
0
    public static TMSApplicationSenderType[] Search(System.Int64?asSenderId, System.String asSenderType, System.String asApplicationType, System.DateTime?asDate, System.Int32?asStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSApplicationSenderType_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, asSenderId, asSenderType, asApplicationType, asDate, asStatus);

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


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
 public static void Update(TMSApplicationSenderType tMSApplicationSenderType, DbTransaction transaction)
 {
     tMSApplicationSenderType.Update(transaction);
 }
 public static void Update(TMSApplicationSenderType tMSApplicationSenderType)
 {
     tMSApplicationSenderType.Update();
 }
 public static TMSApplicationSenderType[] Search(TMSApplicationSenderType searchObject)
 {
     return Search ( searchObject.ASSenderId, searchObject.ASSenderType, searchObject.ASApplicationType, searchObject.ASDate, searchObject.ASStatus);
 }
    public static TMSApplicationSenderType[] MapFrom(DataSet ds)
    {
        List<TMSApplicationSenderType> objects;

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

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

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

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

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

        instance = new TMSApplicationSenderType();

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

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

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }
 public static DataSet GetSearch(TMSApplicationSenderType searchObject)
 {
     return(GetSearch(searchObject.ASSenderId, searchObject.ASSenderType, searchObject.ASApplicationType, searchObject.ASDate, searchObject.ASStatus));
 }
Пример #10
0
 public static void Update(TMSApplicationSenderType tMSApplicationSenderType, DbTransaction transaction)
 {
     tMSApplicationSenderType.Update(transaction);
 }
Пример #11
0
 public static void Update(TMSApplicationSenderType tMSApplicationSenderType)
 {
     tMSApplicationSenderType.Update();
 }