Exemplo n.º 1
0
    public static TMSPrimarySkill Get(System.Int64 psSkillId)
    {
        DataSet         ds;
        Database        db;
        string          sqlCommand;
        DbCommand       dbCommand;
        TMSPrimarySkill instance;


        instance = new TMSPrimarySkill();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
Exemplo n.º 2
0
    public static TMSPrimarySkill[] Search(System.Int64?psSkillId, System.Int64?psSchoolId, System.Int64?psSchoolSubId, System.Int64?psSubjectId, System.Int64?psFacultyId, System.String psSkillName, System.String psSkillDescription, System.String psExtra, System.DateTime?psDate, System.Int32?psStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSPrimarySkill_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, psSkillId, psSchoolId, psSchoolSubId, psSubjectId, psFacultyId, psSkillName, psSkillDescription, psExtra, psDate, psStatus);

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


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
Exemplo n.º 4
0
 public static DataSet GetSearch(TMSPrimarySkill searchObject)
 {
     return GetSearch(searchObject.PSSkillId, searchObject.PSSchoolId, searchObject.PSSchoolSubId, searchObject.PSSubjectId, searchObject.PSFacultyId, searchObject.PSSkillName, searchObject.PSSkillDescription, searchObject.PSExtra, searchObject.PSDate, searchObject.PSStatus);
 }
Exemplo n.º 5
0
 public static TMSPrimarySkill[] Search(TMSPrimarySkill searchObject)
 {
     return(Search(searchObject.PSSkillId, searchObject.PSSchoolId, searchObject.PSSchoolSubId, searchObject.PSSubjectId, searchObject.PSFacultyId, searchObject.PSSkillName, searchObject.PSSkillDescription, searchObject.PSExtra, searchObject.PSDate, searchObject.PSStatus));
 }
Exemplo n.º 6
0
 public static void Update(TMSPrimarySkill tMSPrimarySkill, DbTransaction transaction)
 {
     tMSPrimarySkill.Update(transaction);
 }
Exemplo n.º 7
0
 public static void Update(TMSPrimarySkill tMSPrimarySkill)
 {
     tMSPrimarySkill.Update();
 }
 public static void Update(TMSPrimarySkill tMSPrimarySkill, DbTransaction transaction)
 {
     tMSPrimarySkill.Update(transaction);
 }
 public static void Update(TMSPrimarySkill tMSPrimarySkill)
 {
     tMSPrimarySkill.Update();
 }
    public static TMSPrimarySkill[] MapFrom(DataSet ds)
    {
        List<TMSPrimarySkill> objects;

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

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

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

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

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

        instance = new TMSPrimarySkill();

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

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

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