コード例 #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);
    }
コード例 #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));
    }
コード例 #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());
    }
コード例 #4
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();
    }
コード例 #5
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;
    }