Beispiel #1
0
    public static TMSCertificateDetails Get(System.Int64 certificateId)
    {
        DataSet               ds;
        Database              db;
        string                sqlCommand;
        DbCommand             dbCommand;
        TMSCertificateDetails instance;


        instance = new TMSCertificateDetails();

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

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

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
Beispiel #2
0
    public static TMSCertificateDetails[] Search(System.Int64?certificateId, System.String certificateName, System.Int64?certificateForStudentId, System.Int64?certificateForStandardId, System.Int64?certificateForDivisionId, System.DateTime?certificateRequestDate, System.String certificateRequestedBy, System.Int64?certificateRequestedId, System.String certificateReason, System.Int64?certificateNextApplicationId, System.Int64?certificatePrincipalLoginId, System.Int64?certificateAccountManagerLoginId, System.Int64?certificateStockManagerLoginId, System.Int64?certificateLibraryManagerLoginId, System.String certificatePrincipalApprovedStatus, System.String certificateStockApprovedStatus, System.String certificateLibraryApprovedStatus, System.String certificateAccountApproveSatus, System.DateTime?certificatePrincipalApproveDate, System.DateTime?certificateStockApproveDate, System.DateTime?certificateLibraryApproveDate, System.DateTime?certificateAccountApprovedDate, System.Boolean?certificateStatus, System.Int64?certificateNotificationStatus, System.String certificationApprovedBy, System.DateTime?certificationExtra1, System.String certificateExtra2, System.Int64?certificateExtra3, System.Boolean?certificateExtra4)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSCertificateDetails_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, certificateId, certificateName, certificateForStudentId, certificateForStandardId, certificateForDivisionId, certificateRequestDate, certificateRequestedBy, certificateRequestedId, certificateReason, certificateNextApplicationId, certificatePrincipalLoginId, certificateAccountManagerLoginId, certificateStockManagerLoginId, certificateLibraryManagerLoginId, certificatePrincipalApprovedStatus, certificateStockApprovedStatus, certificateLibraryApprovedStatus, certificateAccountApproveSatus, certificatePrincipalApproveDate, certificateStockApproveDate, certificateLibraryApproveDate, certificateAccountApprovedDate, certificateStatus, certificateNotificationStatus, certificationApprovedBy, certificationExtra1, certificateExtra2, certificateExtra3, certificateExtra4);

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


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

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

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

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

        // Return collection.
        return(objects.ToArray());
    }
 public static DataSet GetSearch(TMSCertificateDetails searchObject)
 {
     return GetSearch(searchObject.CertificateId, searchObject.CertificateName, searchObject.CertificateForStudentId, searchObject.CertificateForStandardId, searchObject.CertificateForDivisionId, searchObject.CertificateRequestDate, searchObject.CertificateRequestedBy, searchObject.CertificateRequestedId, searchObject.CertificateReason, searchObject.CertificateNextApplicationId, searchObject.CertificatePrincipalLoginId, searchObject.CertificateAccountManagerLoginId, searchObject.CertificateStockManagerLoginId, searchObject.CertificateLibraryManagerLoginId, searchObject.CertificatePrincipalApprovedStatus, searchObject.CertificateStockApprovedStatus, searchObject.CertificateLibraryApprovedStatus, searchObject.CertificateAccountApproveSatus, searchObject.CertificatePrincipalApproveDate, searchObject.CertificateStockApproveDate, searchObject.CertificateLibraryApproveDate, searchObject.CertificateAccountApprovedDate, searchObject.CertificateStatus, searchObject.CertificateNotificationStatus, searchObject.CertificationApprovedBy, searchObject.CertificationExtra1, searchObject.CertificateExtra2, searchObject.CertificateExtra3, searchObject.CertificateExtra4);
 }
 public static void Update(TMSCertificateDetails tMSCertificateDetails, DbTransaction transaction)
 {
     tMSCertificateDetails.Update(transaction);
 }
 public static void Update(TMSCertificateDetails tMSCertificateDetails)
 {
     tMSCertificateDetails.Update();
 }
    public static TMSCertificateDetails[] MapFrom(DataSet ds)
    {
        List<TMSCertificateDetails> objects;

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

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

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

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

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

        instance = new TMSCertificateDetails();

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

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

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }
Beispiel #9
0
 public static void Update(TMSCertificateDetails tMSCertificateDetails, DbTransaction transaction)
 {
     tMSCertificateDetails.Update(transaction);
 }
Beispiel #10
0
 public static void Update(TMSCertificateDetails tMSCertificateDetails)
 {
     tMSCertificateDetails.Update();
 }
Beispiel #11
0
 public static TMSCertificateDetails[] Search(TMSCertificateDetails searchObject)
 {
     return(Search(searchObject.CertificateId, searchObject.CertificateName, searchObject.CertificateForStudentId, searchObject.CertificateForStandardId, searchObject.CertificateForDivisionId, searchObject.CertificateRequestDate, searchObject.CertificateRequestedBy, searchObject.CertificateRequestedId, searchObject.CertificateReason, searchObject.CertificateNextApplicationId, searchObject.CertificatePrincipalLoginId, searchObject.CertificateAccountManagerLoginId, searchObject.CertificateStockManagerLoginId, searchObject.CertificateLibraryManagerLoginId, searchObject.CertificatePrincipalApprovedStatus, searchObject.CertificateStockApprovedStatus, searchObject.CertificateLibraryApprovedStatus, searchObject.CertificateAccountApproveSatus, searchObject.CertificatePrincipalApproveDate, searchObject.CertificateStockApproveDate, searchObject.CertificateLibraryApproveDate, searchObject.CertificateAccountApprovedDate, searchObject.CertificateStatus, searchObject.CertificateNotificationStatus, searchObject.CertificationApprovedBy, searchObject.CertificationExtra1, searchObject.CertificateExtra2, searchObject.CertificateExtra3, searchObject.CertificateExtra4));
 }