示例#1
0
    public static TMSUploadLectureDetails Get(System.Int64 ulLectureId)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;
        TMSUploadLectureDetails instance;


        instance = new TMSUploadLectureDetails();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
示例#2
0
    public static TMSUploadLectureDetails[] Search(System.Int64?ulLectureId, System.Int64?ulFacultyId, System.Int64?ulFacultyLoginId, System.Int64?ulSchoolId, System.Int64?ulSchoolSubId, System.String ulTitle, System.String ulDescription, System.String ulVideoName, System.String ulThumbnailName, System.String ulExtra, System.DateTime?ulLectureDate, System.DateTime?ulDate, System.Int32?ulStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSUploadLectureDetails_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, ulLectureId, ulFacultyId, ulFacultyLoginId, ulSchoolId, ulSchoolSubId, ulTitle, ulDescription, ulVideoName, ulThumbnailName, ulExtra, ulLectureDate, ulDate, ulStatus);

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


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
 public static DataSet GetSearch(TMSUploadLectureDetails searchObject)
 {
     return(GetSearch(searchObject.ULLectureId, searchObject.ULFacultyId, searchObject.ULFacultyLoginId, searchObject.ULSchoolId, searchObject.ULSchoolSubId, searchObject.ULTitle, searchObject.ULDescription, searchObject.ULVideoName, searchObject.ULThumbnailName, searchObject.ULExtra, searchObject.ULLectureDate, searchObject.ULDate, searchObject.ULStatus));
 }
 public static void Update(TMSUploadLectureDetails tMSUploadLectureDetails, DbTransaction transaction)
 {
     tMSUploadLectureDetails.Update(transaction);
 }
 public static void Update(TMSUploadLectureDetails tMSUploadLectureDetails)
 {
     tMSUploadLectureDetails.Update();
 }
 public static TMSUploadLectureDetails[] Search(TMSUploadLectureDetails searchObject)
 {
     return Search ( searchObject.ULLectureId, searchObject.ULFacultyId, searchObject.ULFacultyLoginId, searchObject.ULSchoolId, searchObject.ULSchoolSubId, searchObject.ULTitle, searchObject.ULDescription, searchObject.ULVideoName, searchObject.ULThumbnailName, searchObject.ULExtra, searchObject.ULLectureDate, searchObject.ULDate, searchObject.ULStatus);
 }
    public static TMSUploadLectureDetails[] MapFrom(DataSet ds)
    {
        List<TMSUploadLectureDetails> objects;

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

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

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

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

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

        instance = new TMSUploadLectureDetails();

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

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

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }
示例#10
0
 public static void Update(TMSUploadLectureDetails tMSUploadLectureDetails, DbTransaction transaction)
 {
     tMSUploadLectureDetails.Update(transaction);
 }
示例#11
0
 public static void Update(TMSUploadLectureDetails tMSUploadLectureDetails)
 {
     tMSUploadLectureDetails.Update();
 }