Ejemplo n.º 1
0
    public static TMSParentRepresentativeDetails Get(System.Int64 prpDetailsID)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;
        TMSParentRepresentativeDetails instance;


        instance = new TMSParentRepresentativeDetails();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
Ejemplo n.º 2
0
    public static TMSParentRepresentativeDetails[] Search(System.Int64?prpDetailsID, System.Int64?prpParentRepresentativeID, System.Int64?prpParentLoginID, System.Int64?prpStudentLoginID, System.Int64?prpStandardID, System.Int64?prpDivisionID, System.String prpSubject, System.String prpDescription, System.String prpDescription1, System.DateTime?prpDate, System.Int32?prpStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSParentRepresentativeDetails_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, prpDetailsID, prpParentRepresentativeID, prpParentLoginID, prpStudentLoginID, prpStandardID, prpDivisionID, prpSubject, prpDescription, prpDescription1, prpDate, prpStatus);

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


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
Ejemplo n.º 4
0
 public static TMSParentRepresentativeDetails[] Search(TMSParentRepresentativeDetails searchObject)
 {
     return(Search(searchObject.PRPDetailsID, searchObject.PRPParentRepresentativeID, searchObject.PRPParentLoginID, searchObject.PRPStudentLoginID, searchObject.PRPStandardID, searchObject.PrpDivisionID, searchObject.PrpSubject, searchObject.PrpDescription, searchObject.PrpDescription1, searchObject.PrpDate, searchObject.PrpStatus));
 }
Ejemplo n.º 5
0
 public static void Update(TMSParentRepresentativeDetails tMSParentRepresentativeDetails, DbTransaction transaction)
 {
     tMSParentRepresentativeDetails.Update(transaction);
 }
Ejemplo n.º 6
0
 public static void Update(TMSParentRepresentativeDetails tMSParentRepresentativeDetails)
 {
     tMSParentRepresentativeDetails.Update();
 }
 public static void Update(TMSParentRepresentativeDetails tMSParentRepresentativeDetails, DbTransaction transaction)
 {
     tMSParentRepresentativeDetails.Update(transaction);
 }
 public static void Update(TMSParentRepresentativeDetails tMSParentRepresentativeDetails)
 {
     tMSParentRepresentativeDetails.Update();
 }
 public static TMSParentRepresentativeDetails[] Search(TMSParentRepresentativeDetails searchObject)
 {
     return Search ( searchObject.PRPDetailsID, searchObject.PRPParentRepresentativeID, searchObject.PRPParentLoginID, searchObject.PRPStudentLoginID, searchObject.PRPStandardID, searchObject.PrpDivisionID, searchObject.PrpSubject, searchObject.PrpDescription, searchObject.PrpDescription1, searchObject.PrpDate, searchObject.PrpStatus);
 }
    public static TMSParentRepresentativeDetails[] MapFrom(DataSet ds)
    {
        List<TMSParentRepresentativeDetails> objects;

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

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

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

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

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

        instance = new TMSParentRepresentativeDetails();

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

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

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