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


        instance = new TMSLeactureTimeDetails();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
    public static TMSLeactureTimeDetails[] Search(System.Int64?ltdTimeId, System.String ltdStartTime, System.String ltdEndTime, System.Int64?ltdSchoolCatId, System.Int64?ltdSubCategoryId, System.DateTime?ltdDate, System.Int32?ltdStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSLeactureTimeDetails_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, ltdTimeId, ltdStartTime, ltdEndTime, ltdSchoolCatId, ltdSubCategoryId, ltdDate, ltdStatus);

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


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
Exemplo n.º 4
0
 public static DataSet GetSearch(TMSLeactureTimeDetails searchObject)
 {
     return(GetSearch(searchObject.LTDTimeId, searchObject.LTDStartTime, searchObject.LTDEndTime, searchObject.LTDSchoolCatId, searchObject.LTDSubCategoryId, searchObject.LTDDate, searchObject.LTDStatus));
 }
 public static void Update(TMSLeactureTimeDetails tMSLeactureTimeDetails, DbTransaction transaction)
 {
     tMSLeactureTimeDetails.Update(transaction);
 }
 public static void Update(TMSLeactureTimeDetails tMSLeactureTimeDetails)
 {
     tMSLeactureTimeDetails.Update();
 }
 public static void Update(TMSLeactureTimeDetails tMSLeactureTimeDetails, DbTransaction transaction)
 {
     tMSLeactureTimeDetails.Update(transaction);
 }
 public static void Update(TMSLeactureTimeDetails tMSLeactureTimeDetails)
 {
     tMSLeactureTimeDetails.Update();
 }
 public static TMSLeactureTimeDetails[] Search(TMSLeactureTimeDetails searchObject)
 {
     return Search ( searchObject.LTDTimeId, searchObject.LTDStartTime, searchObject.LTDEndTime, searchObject.LTDSchoolCatId, searchObject.LTDSubCategoryId, searchObject.LTDDate, searchObject.LTDStatus);
 }
    public static TMSLeactureTimeDetails[] MapFrom(DataSet ds)
    {
        List<TMSLeactureTimeDetails> objects;

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

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

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

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

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

        instance = new TMSLeactureTimeDetails();

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

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

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