Ejemplo n.º 1
0
        }//END SetParameters class.

        #endregion

        #region ExternalSelectionList Reader

        // =====================================================================================
        /// <summary>
        /// This class extracts the content of the reader to the formfield selectionlist object.
        /// </summary>
        /// <param name="Row">DataRow: a data Reader containing the query results</param>
        /// <returns>EvFormFieldSelectionList: a formfield selectionlist object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Extract the compatible data row values to the formfield selectionlist object.
        ///
        /// 2. Return the Formfield selectionlist object.
        /// </remarks>
        //  ---------------------------------------------------------------------------------
        private EvSelectionList readDataRow(DataRow Row)
        {
            //
            // Initialise the formfield selectionlist object.
            //
            EvSelectionList Item = new EvSelectionList( );

            //
            // Extract the compatible data row values to the formfield selectionlist object items.
            //
            Item.Guid        = EvSqlMethods.getGuid(Row, EvSelectionLists.DB_GUID);
            Item.ListId      = EvSqlMethods.getString(Row, EvSelectionLists.DB_LIST_ID);
            Item.Title       = EvSqlMethods.getString(Row, EvSelectionLists.DB_TITLE);
            Item.Description = EvSqlMethods.getString(Row, EvSelectionLists.DB_DESCRIPTION);
            Item.Version     = EvSqlMethods.getInteger(Row, EvSelectionLists.DB_VERSION);

            string xmlCodeItem = EvSqlMethods.getString(Row, EvSelectionLists.DB_ITEM_LIST);

            if (xmlCodeItem != String.Empty)
            {
                Item.Items = Evado.Digital.Model.EvcStatics.DeserialiseObject <List <EvSelectionList.Item> > (xmlCodeItem);
            }
            Item.State = Evado.Model.EvStatics.parseEnumValue <EvSelectionList.SelectionListStates> (
                EvSqlMethods.getString(Row, EvSelectionLists.DB_STATE));
            Item.UpdatedByUserId = EvSqlMethods.getString(Row, EvSelectionLists.DB_UPDATED_BY_USER_ID);
            Item.UpdatedBy       = EvSqlMethods.getString(Row, EvSelectionLists.DB_UPDATED_BY);
            Item.UpdatedDate    += EvSqlMethods.getDateTime(Row, EvSelectionLists.DB_UPDATED_DATE);

            //
            // Return item
            //
            return(Item);
        }//END readDataRow method.
        // =====================================================================================
        /// <summary>
        /// This class reads the content of the data reader object into FormField business object.
        /// </summary>
        /// <param name="Row">DataRow: an sql data query row</param>
        /// <returns>EvFormField: a form field object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Update formfield object with the compatible data row items.
        ///
        /// 2. If the formfield typeId is table, iterate through the formfield table and set the validation rules
        ///
        /// 3. If the selection validation options are missing, add them.
        ///
        /// 4. If it is an external coding visitSchedule then add the relevant coding visitSchedule items.
        ///
        /// 5. Resolve the numeric 'NA' to negative infinity issue.
        ///
        /// 6. Update the instrument type to current enumeration.
        ///
        /// 7. If formfield typeId is either analogue scale or horizontal radio buttons,
        /// select the design by coding value
        ///
        /// 8. Return the formfield object.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        private Evado.Digital.Model.EdRecordSection getRowData(DataRow Row)
        {
            //
            // Initialise xmltable string and a return formfield object.
            //
            string xmlTable = String.Empty;

            Evado.Digital.Model.EdRecordSection formSection = new  Evado.Digital.Model.EdRecordSection( );

            //
            // Update formfield object with the compatible data row items.
            //
            formSection.LayoutGuid      = EvSqlMethods.getGuid(Row, EdRecordSections.DB_LAYOUT_GUID);
            formSection.No              = EvSqlMethods.getInteger(Row, EdRecordSections.DB_NUMBER);;
            formSection.Title           = EvSqlMethods.getString(Row, EdRecordSections.DB_NAME);
            formSection.Order           = EvSqlMethods.getInteger(Row, EdRecordSections.DB_ORDER);
            formSection.FieldId         = EvSqlMethods.getString(Row, EdRecordSections.DB_FIELD_NAME);
            formSection.Instructions    = EvSqlMethods.getString(Row, EdRecordSections.DB_INSTRUCTIONS);
            formSection.FieldValue      = EvSqlMethods.getString(Row, EdRecordSections.DB_FIELD_VALUE);
            formSection.OnMatchVisible  = EvSqlMethods.getBool(Row, EdRecordSections.DB_ON_MATCH_VISIBLE);
            formSection.OnOpenVisible   = EvSqlMethods.getBool(Row, EdRecordSections.DB_VISIBLE);
            formSection.ReadAccessRoles = EvSqlMethods.getString(Row, EdRecordSections.DB_DEFAULT_DISPLAY_ROLES);
            formSection.EditAccessRoles = EvSqlMethods.getString(Row, EdRecordSections.DB_DEFAULT_EDIT_ROLES);
            formSection.PercentWidth    = EvSqlMethods.getInteger(Row, EdRecordSections.DB_PERCENT_WIDTH);

            return(formSection);
        }//END getRowData method.
Ejemplo n.º 3
0
        }//END SetParameters method

        #endregion

        #region Aplication Profile  Reader

        // =====================================================================================
        /// <summary>
        /// This method extracts the data reader values to the Site profile object.
        /// </summary>
        /// <param name="Row">DataRow object.</param>
        /// <returns>EvSiteProfile: A site profile data object.</returns>
        /// <remarks>
        /// This method consists of following steps.
        ///
        /// 1. Extract the compatible data reader object's values to the Site Profile Object.
        ///
        /// 2. Return a Site Profile Object.
        ///
        /// </remarks>
        //  ------------------------------------------------------------------------------------
        public Evado.Digital.Model.EdAdapterSettings getReaderData(DataRow Row)
        {
            //this.LogMethod ( "getReaderData method. " );
            //
            // Initialise method variables and objects.
            //
            Evado.Digital.Model.EdAdapterSettings applicationSettings = new  Evado.Digital.Model.EdAdapterSettings( );

            //
            // Load the query results into the EvProfile object.
            //
            applicationSettings.Guid = EvSqlMethods.getGuid(Row, EdAdapterConfig.DB_FIELD_GUID);

            applicationSettings.ApplicationId = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_APPLICATION_ID);

            applicationSettings.HomePageHeaderText = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_HOME_PAGE_HEADER);

            applicationSettings.HelpUrl = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_HELP_URL);

            applicationSettings.MaximumSelectionListLength = EvSqlMethods.getInteger(Row, EdAdapterConfig.DB_FIELD_MAX_SELECTION_LENGTH);

            applicationSettings.SmtpServer = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_SMTP_SERVER);

            applicationSettings.SmtpServerPort = EvSqlMethods.getInteger(Row, EdAdapterConfig.DB_FIELD_SMTP_PORT);

            applicationSettings.SmtpUserId = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_SMTP_USER_ID);

            applicationSettings.SmtpPassword = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_SMTP_PASSWORD);

            applicationSettings.EmailAlertTestAddress = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_ALERT_EMAIL_ADDRESS);

            //applicationSettings.ap = EvSqlMethods.getString ( Row, EdAdapterSettings.DB_FIELD_APPLICATION_URL );

            applicationSettings.State = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_STATE);

            applicationSettings.Title = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_TITLE);

            applicationSettings.HttpReference = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_HTTP_REFERENCE);

            applicationSettings.Description = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_DESCRIPTION);

            applicationSettings.UserRoles = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_ROLES);

            applicationSettings.UpdatedBy = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_UPDATE_USER);

            applicationSettings.UpdatedByUserId = EvSqlMethods.getString(Row, EdAdapterConfig.DB_FIELD_UPDATE_USER_ID);

            if (applicationSettings.DemoAccountExpiryDays == 0)
            {
                applicationSettings.DemoAccountExpiryDays = 28;
            }
            //
            // Return the object.
            //
            return(applicationSettings);
        }//END getReaderData method
Ejemplo n.º 4
0
        }//END SetParameters class.

        #endregion

        #region ancillary record Reader

        // =====================================================================================
        /// <summary>
        /// This method extracts the data row values to the Subject Record object.
        /// </summary>
        /// <param name="Row">DataRow: A data row object</param>
        /// <returns>EvSubjectRecord: A milestone record object.</returns>
        /// <remarks>
        /// This method consists of following steps:
        ///
        /// 1. Extract the compatible data row values to the Subject record object.
        ///
        /// 2. Return the milestone record object.
        /// </remarks>
        //  ----------------------------------------------------------------------------------
        private EvAncillaryRecord readRowData(DataRow Row)
        {
            //
            // Initialise the method variables and objects.
            //
            EvAncillaryRecord record = new EvAncillaryRecord( );

            //
            // Extract the data object values.
            //
            record.Guid       = EvSqlMethods.getGuid(Row, "TSR_Guid");
            record.ProjectId  = EvSqlMethods.getString(Row, "TrialId");
            record.SubjectId  = EvSqlMethods.getString(Row, "SubjectId");
            record.RecordId   = EvSqlMethods.getString(Row, "RecordId");
            record.RecordDate = EvSqlMethods.getDateTime(Row, "TSR_RecordDate");
            record.Subject    = EvSqlMethods.getString(Row, "TSR_Subject");
            record.Record     = EvSqlMethods.getString(Row, "TSR_Record");

            //
            // Perform binary object management
            //
            record.BinaryLength = EvSqlMethods.getInteger(Row, "TSR_BinaryLength");

            if (record.BinaryLength > 0)
            {
                record.BinaryObject    = EvSqlMethods.getBytes(Row, "TSR_BinaryObject");
                record.BinaryType      = EvSqlMethods.getString(Row, "TSR_BinaryType");
                record.BinaryExtension = EvSqlMethods.getString(Row, "TSR_BinaryExtension");
            }

            record.XmlData         = EvSqlMethods.getString(Row, "TSR_XmlData");
            record.Researcher      = EvSqlMethods.getString(Row, "TSR_Researcher");
            record.ResearcherDate  = EvSqlMethods.getDateTime(Row, "TSR_ResearcherDate");
            record.Reviewer        = EvSqlMethods.getString(Row, "TSR_Reviewer");
            record.ReviewDate      = EvSqlMethods.getDateTime(Row, "TSR_ReviewDate");
            record.Approver        = EvSqlMethods.getString(Row, "TSR_Approver");
            record.ApprovalDate    = EvSqlMethods.getDateTime(Row, "TSR_ApprovalDate");
            record.State           = Evado.Model.EvStatics.parseEnumValue <EdRecordObjectStates> (EvSqlMethods.getString(Row, "TSR_State"));
            record.UpdatedByUserId = EvSqlMethods.getString(Row, "TSR_UpdatedByUserId");
            record.UpdatedBy       = EvSqlMethods.getString(Row, "TSR_UpdatedBy");
            record.UpdatedDate     = EvSqlMethods.getDateTime(Row, "TSR_UpdateDate");
            record.BookedOutBy     = EvSqlMethods.getString(Row, "TSR_BookedOutBy");
            record.Signoffs        = Evado.Model.EvStatics.DeserialiseObject <List <EdUserSignoff> > (EvSqlMethods.getString(Row, "TSR_Signoffs"));

            //
            // Return an object containing EvSubjectRecord object.
            //
            return(record);
        }//END getRowData
Ejemplo n.º 5
0
        }//END SetParameters class.

        #endregion

        #region Data Reader methods

        // ==================================================================================
        /// <summary>
        /// This method reads the content of the data row object containing a query result
        /// into an ActivityRecord object.
        /// </summary>
        /// <param name="Row">DataRow: a retrieving data row object</param>
        /// <returns>EvBinaryFileMetaData: a readed data row object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Extract the compatible data row values to the Binary file Meta data object
        ///
        /// 2. Return the Binary file Meta data object
        /// </remarks>
        // ----------------------------------------------------------------------------------
        public EvBinaryFileMetaData readDataRow(DataRow Row)
        {
            //
            // Initialise the instrument objects and variables.
            //
            EvBinaryFileMetaData binaryFile = new EvBinaryFileMetaData( );

            //
            // Extract the data object values.
            //
            binaryFile.Guid         = EvSqlMethods.getGuid(Row, EvBinaryFiles.DB_GUID);
            binaryFile.FileGuid     = EvSqlMethods.getGuid(Row, EvBinaryFiles.DB_FILE_GUID);
            binaryFile.TrialGuid    = EvSqlMethods.getGuid(Row, EvBinaryFiles.DB_PROJECT_GUID);
            binaryFile.GroupGuid    = EvSqlMethods.getGuid(Row, EvBinaryFiles.DB_GROUP_GUID);
            binaryFile.SubGroupGuid = EvSqlMethods.getGuid(Row, EvBinaryFiles.DB_SUB_GROUP_GUID);

            binaryFile.Language   = EvSqlMethods.getString(Row, EvBinaryFiles.DB_LANGUAGE);
            binaryFile.TrialId    = EvSqlMethods.getString(Row, EvBinaryFiles.DB_TRIAL_ID);
            binaryFile.GroupId    = EvSqlMethods.getString(Row, EvBinaryFiles.DB_GROUP_ID);
            binaryFile.SubGroupId = EvSqlMethods.getString(Row, EvBinaryFiles.DB_SUB_GROUP_ID);
            binaryFile.FileId     = EvSqlMethods.getString(Row, EvBinaryFiles.DB_FILE_ID);
            binaryFile.Title      = EvSqlMethods.getString(Row, EvBinaryFiles.DB_FILE_TITLE);

            binaryFile.Comments = EvSqlMethods.getString(Row, EvBinaryFiles.DB_FILE_COMMENT);
            binaryFile.FileName = EvSqlMethods.getString(Row, EvBinaryFiles.DB_FILE_NAME);
            binaryFile.MimeType = EvSqlMethods.getString(Row, EvBinaryFiles.DB_MIME_TYPE);
            binaryFile.Status   = EvSqlMethods.getString <EvBinaryFileMetaData.FileStatus> (
                Row, EvBinaryFiles.DB_FILE_STATUS);
            binaryFile.UploadDate = EvSqlMethods.getDateTime(Row, EvBinaryFiles.DB_UPLOAD_DATE);

            binaryFile.ReleaseDate    = EvSqlMethods.getDateTime(Row, EvBinaryFiles.DB_RELEASE_DATE);
            binaryFile.SupersededDate = EvSqlMethods.getDateTime(Row, EvBinaryFiles.DB_SUPERSEDED_DATE);
            binaryFile.FileExists     = EvSqlMethods.getBool(Row, EvBinaryFiles.DB_FILE_EXISTS);
            binaryFile.FileEncrypted  = EvSqlMethods.getBool(Row, EvBinaryFiles.DB_FILE_ENCRYPTED);
            binaryFile.Version        = EvSqlMethods.getInteger(Row, EvBinaryFiles.DB_VERSION);

            binaryFile.UpdatedByUserId = EvSqlMethods.getString(Row, EvBinaryFiles.DB_UPDATED_BY_USER_ID);
            binaryFile.UpdatedBy       = EvSqlMethods.getString(Row, EvBinaryFiles.DB_UPDATED_BY);
            binaryFile.UpdatedByDate   = EvSqlMethods.getDateTime(Row, EvBinaryFiles.DB_UPDATED_DATE);

            //
            // Return the object.
            //
            return(binaryFile);
        }//End readDataRow method.
Ejemplo n.º 6
0
        }//END SetParameters class.

        #endregion

        #region PageLayout Reader

        // =====================================================================================
        /// <summary>
        /// This class extracts the content of the reader to the formfield selectionlist object.
        /// </summary>
        /// <param name="Row">DataRow: a data Reader containing the query results</param>
        /// <returns>EvFormFieldSelectionList: a formfield selectionlist object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Extract the compatible data row values to the formfield selectionlist object.
        ///
        /// 2. Return the Formfield selectionlist object.
        /// </remarks>
        //  ---------------------------------------------------------------------------------
        private EdPageLayout readDataRow(DataRow Row)
        {
            //
            // Initialise the formfield selectionlist object.
            //
            EdPageLayout Item = new EdPageLayout( );

            //
            // Extract the compatible data row values to the formfield selectionlist object items.
            //
            Item.Guid      = EvSqlMethods.getGuid(Row, EdPageLayouts.DB_GUID);
            Item.PageId    = EvSqlMethods.getString(Row, EdPageLayouts.DB_PAGE_ID);
            Item.State     = EvSqlMethods.getString <EdPageLayout.States> (Row, EdPageLayouts.DB_STATE);
            Item.UserTypes = EvSqlMethods.getString(Row, EdPageLayouts.DB_USER_TYPES);
            Item.Title     = EvSqlMethods.getString(Row, EdPageLayouts.DB_TITLE);

            Item.HomePage            = EvSqlMethods.getBool(Row, EdPageLayouts.DB_HOME_PAGE);
            Item.MenuLocation        = EvSqlMethods.getString <EdPageLayout.MenuLocations> (Row, EdPageLayouts.DB_MENU_LOCATION);
            Item.PageCommands        = EvSqlMethods.getString(Row, EdPageLayouts.DB_PAGE_COMMANDS);
            Item.HeaderContent       = EvSqlMethods.getString(Row, EdPageLayouts.DB_HEADER_CONTENT);
            Item.HeaderComponentList = EvSqlMethods.getString(Row, EdPageLayouts.DB_HEADER_COMPONENT_LIST);

            Item.LeftColumnContent       = EvSqlMethods.getString(Row, EdPageLayouts.DB_LEFT_CONTENT);
            Item.LeftColumnComponentList = EvSqlMethods.getString(Row, EdPageLayouts.DB_LEFT_COMPONENT_LIST);
            Item.LeftColumnWidth         = (short)EvSqlMethods.getInteger(Row, EdPageLayouts.DB_LEFT_COLUMN_WIDTH);

            Item.CenterColumnContent       = EvSqlMethods.getString(Row, EdPageLayouts.DB_CENTER_CONTENT);
            Item.CenterColumnComponentList = EvSqlMethods.getString(Row, EdPageLayouts.DB_CENTER_COMPONENT_LIST);

            Item.RightColumnContent       = EvSqlMethods.getString(Row, EdPageLayouts.DB_RIGHT_CONTENT);
            Item.RightColumnComponentList = EvSqlMethods.getString(Row, EdPageLayouts.DB_RIGHT_COMPONENT_LIST);
            Item.RightColumnWidth         = (short)EvSqlMethods.getInteger(Row, EdPageLayouts.DB_RIGHT_COLUMN_WIDTH);

            Item.Version         = EvSqlMethods.getInteger(Row, EdPageLayouts.DB_VERSION);
            Item.UpdatedByUserId = EvSqlMethods.getString(Row, EdPageLayouts.DB_UPDATED_BY_USER_ID);
            Item.UpdatedBy       = EvSqlMethods.getString(Row, EdPageLayouts.DB_UPDATED_BY);
            Item.UpdatedDate    += EvSqlMethods.getDateTime(Row, EdPageLayouts.DB_UPDATED_DATE);

            //
            // Return item
            //
            return(Item);
        }//END readDataRow method.
Ejemplo n.º 7
0
        }//END SetLetterParameters.

        #endregion

        #region ReaderData methods

        // =====================================================================================
        /// <summary>
        /// This class reads the content of the data reader object into Menus business object.
        /// </summary>
        /// <param name="Row">DataRow: a sql data row</param>
        /// <returns>EvMenuItem: a row data of the menu item</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Add page identifier to a menu item object if it exists
        ///
        /// 2. Append the row strings of EvSqlMethods object to the menu item object.
        ///
        /// 3. Rename the role visitSchedule members and add them to the menu item object.
        ///
        /// 4. Return the menu item object
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public Evado.Digital.Model.EvMenuItem getRowData(DataRow Row)
        {
            //
            // Initialise the menu item object and a page identifier string.
            //
            Evado.Digital.Model.EvMenuItem menu = new  Evado.Digital.Model.EvMenuItem( );

            menu.Guid        = EvSqlMethods.getGuid(Row, "MNU_GUID");
            menu.PageId      = EvSqlMethods.getString(Row, "MNU_PAGE_ID");
            menu.Title       = EvSqlMethods.getString(Row, "MNU_TITLE");
            menu.Order       = EvSqlMethods.getInteger(Row, "MNU_ORDER");
            menu.Group       = EvSqlMethods.getString(Row, "MNU_GROUP");
            menu.GroupHeader = EvSqlMethods.getBool(Row, "MNU_GROUP_HEADER");
            menu.Platform    = EvSqlMethods.getString(Row, "MNU_PLATFORM");
            menu.UserTypes   = EvSqlMethods.getString(Row, "MNU_USER_TYPES");
            menu.RoleList    = EvSqlMethods.getString(Row, "MNU_ROLES");
            menu.Parameters  = EvSqlMethods.getString(Row, "MNU_PARAMETERS");

            return(menu);
        }//END getRowData method.
Ejemplo n.º 8
0
        }//END getCheckBoxValue method

        // =====================================================================================
        /// <summary>
        /// this method updates a table cell value form the query result set.
        /// Note:  the cell indexes are zero based.
        /// </summary>
        /// <param name="Row">The DataRow containing the field</param>
        /// <param name="FormField"> Evado.Model.Forms.EvFormField object, containg the field data.</param>
        // -------------------------------------------------------------------------------------
        private void getTableCellValue(DataRow Row, Evado.Digital.Model.EdRecordField FormField)
        {
            LogMethod("getTableCellValue");
            //
            // Validate that the table exists.
            //
            if (FormField.Table == null)
            {
                this.LogDebug("FormField.Table is null");
                return;
            }

            //
            // Get the field row values.
            //
            int    row      = EvSqlMethods.getInteger(Row, EdRecordValues.DB_VALUES_ROW);
            String columnId = EvSqlMethods.getString(Row, EdRecordValues.DB_VALUES_COLUMN_ID);

            //
            // get the colum no
            //
            int col = getHeaderColumnNo(FormField.Table.Header, columnId);

            //
            // get the column row value.
            //
            string value = this.getTableColumnValue(Row, col, FormField);

            LogMethodEnd("getTableColumnValue");

            //
            // Add the value to the table.
            //
            if (row < FormField.Table.Rows.Count)
            {
                FormField.Table.Rows [row].Column [col] = value;
            }
            this.LogDebug(" Row: " + row + " col: " + col + ", value: " + FormField.Table.Rows [row].Column [col]);

            LogMethodEnd("getTableCellValue");
        }//END getTableCellValue method
        //
        // Define the class EventId property and variable.
        //
        #endregion

        #region Data Reader section

        // ==================================================================================
        /// <summary>
        /// This class reads the content of the data reader object into ApplicationEvent business object.
        /// </summary>
        /// <param name="Row">DataRow: a data row object</param>
        /// <remarks>
        /// This method consists of the following step:
        ///
        /// 1. Convert the elements from data reader object into the elements
        /// in application event business object.
        /// </remarks>
        // ----------------------------------------------------------------------------------
        public EvApplicationEvent getReaderData(DataRow Row)
        {
            EvApplicationEvent Event = new EvApplicationEvent( );

            //
            // Convert the elements from data reader object into the elements in application event business object.
            //
            Event.Guid     = EvSqlMethods.getGuid(Row, DB_GUID);
            Event.EventId  = EvSqlMethods.getInteger(Row, DB_EVENT_ID);
            Event.DateTime = EvSqlMethods.getDateTime(Row, DB_DATE_TIME);
            string sType = EvSqlMethods.getString(Row, DB_EVENT_TYPE);

            if (sType == "A")
            {
                sType = "Action";
            }
            if (sType == "I")
            {
                sType = "Information";
            }
            if (sType == "W")
            {
                sType = "Warning";
            }
            if (sType == "E")
            {
                sType = "Error";
            }

            Event.Type = Evado.Model.EvStatics.parseEnumValue <EvApplicationEvent.EventType> (sType);

            Event.Category    = EvSqlMethods.getString(Row, DB_EVENT_CATEGORY);
            Event.UserId      = EvSqlMethods.getString(Row, DB_USER_NAME);
            Event.Description = EvSqlMethods.getString(Row, DB_DESCRIPTION);
            Event.PageUrl     = EvSqlMethods.getString(Row, DB_PAGE_URL);
            Event.CustomerId  = EvSqlMethods.getString(Row, DB_SITE);

            return(Event);
        }//END getRowData method.
        // ==================================================================================
        /// <summary>
        /// This method reads the content of the data row object containing a query result
        /// into an Activity Record object.
        /// </summary>
        /// <param name="Row">DataRow: a data row record object</param>
        /// <returns>EvActivityForm: a data row object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Extract the data object values from the data row object and add to the activity form object.
        ///
        /// 2. Return the activity form object.
        /// </remarks>
        // ----------------------------------------------------------------------------------
        private EvObjectParameter readDataRow(DataRow Row)
        {
            //
            // Initialise application parameter object
            //
            EvObjectParameter parameter = new EvObjectParameter( );

            //
            // Extract the data object values from the data row object and add to the activity form object.
            //
            parameter.Guid     = EvSqlMethods.getGuid(Row, "OBJ_GUID");
            parameter.Order    = EvSqlMethods.getInteger(Row, "OBP_ORDER");
            parameter.Name     = EvSqlMethods.getString(Row, "OBP_NAME");
            parameter.DataType = EvStatics.parseEnumValue <EvDataTypes> (EvSqlMethods.getString(Row, "OBP_TYPE"));
            parameter.Value    = EvSqlMethods.getString(Row, "OBP_VALUE");
            parameter.Options  = EvSqlMethods.getString(Row, "OBP_OPTIONS");

            //
            // Return the application parameter object.
            //
            return(parameter);
        }// End readDataRow method.
        // ==================================================================================
        /// <summary>
        /// This class reads the content of the SqlDataReader into the Facility data object.
        /// </summary>
        /// <param name="Row">DataRow: a row of data row table</param>
        /// <returns>EvDataBaseUpdate: an update database</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Initialise an update object.
        ///
        /// 2. Extract the data object values and update values to the update object.
        ///
        /// 3. Return the update object.
        /// </remarks>
        // ----------------------------------------------------------------------------------
        public EvDataBaseUpdate readDataRow(DataRow Row)
        {
            //
            // Initialise an update object.
            //
            EvDataBaseUpdate update = new EvDataBaseUpdate( );

            //
            // Extract the data object values and update values to the update object.
            //
            update.Guid        = EvSqlMethods.getGuid(Row, "DBU_Guid");
            update.UpdateNo    = EvSqlMethods.getInteger(Row, "DBU_Update_No");
            update.UpdateDate  = EvSqlMethods.getDateTime(Row, "DBU_Update_Date");
            update.Version     = EvSqlMethods.getString(Row, "DBU_Version");
            update.Objects     = EvSqlMethods.getString(Row, "DBU_Object");
            update.Description = EvSqlMethods.getString(Row, "DBU_Description");

            //
            // Return the update object.
            //
            return(update);
        }// End readDataRow method.
Ejemplo n.º 12
0
        // =====================================================================================
        /// <summary>
        /// This class reads the content of the data reader object into ChecklistItem business object.
        /// </summary>
        /// <param name="Row">DataRow: an Sql DataReader object</param>
        /// <returns>EvFormField: a formfield object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Extract the compatible row data to the formfield object.
        ///
        /// 2. Deserialize the xmlData to the formfield design object if it exists.
        ///
        /// 3. Deserialize the xmlvalidationRules to the formfield validationRules object if they exist.
        ///
        /// 4. Reset the horizontal radion button list enumertion
        ///
        /// 5. Ensure that the formfield state is not null.
        ///
        /// 6. if skip retrieving comments is selected, fill the comment list and format it
        ///
        /// 7. Get the table object and the external selection list object.
        ///
        /// 8. Process the NA values in selectionlists.
        ///
        /// 9. Update the current formfield state and type object.
        ///
        /// 10. Return the formfield object.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        private EdRecordField getRowData(
            DataRow Row)
        {
            this.LogMethod("getRowData method");
            //
            // Initialise method template table string, a return formfield object and an annotation string.
            //
            string        stTemplateTable = String.Empty;
            EdRecordField recordField     = new EdRecordField( );

            //
            // Fill the evForm object.l
            //
            recordField.Guid       = EvSqlMethods.getGuid(Row, EdRecordValues.DB_VALUES_GUID);
            recordField.RecordGuid = EvSqlMethods.getGuid(Row, EdRecords.DB_RECORD_GUID);
            recordField.LayoutGuid = EvSqlMethods.getGuid(Row, EdRecordLayouts.DB_LAYOUT_GUID);
            recordField.FieldGuid  = EvSqlMethods.getGuid(Row, EdRecordValues.DB_FIELD_GUID);


            recordField.FieldId = EvSqlMethods.getString(Row, EdRecordFields.DB_FIELD_ID);
            String value = EvSqlMethods.getString(Row, EdRecordFields.DB_TYPE_ID);

            recordField.Design.TypeId = Evado.Model.EvStatics.parseEnumValue <Evado.Model.EvDataTypes> (value);

            recordField.Design.Title                   = EvSqlMethods.getString(Row, EdRecordFields.DB_TITLE);
            recordField.Design.Instructions            = EvSqlMethods.getString(Row, EdRecordFields.DB_INSTRUCTIONS);
            recordField.Design.HttpReference           = EvSqlMethods.getString(Row, EdRecordFields.DB_HTTP_REFERENCE);
            recordField.Design.SectionNo               = EvSqlMethods.getInteger(Row, EdRecordFields.DB_SECTION_ID);
            recordField.Design.Options                 = EvSqlMethods.getString(Row, EdRecordFields.DB_OPTIONS);
            recordField.Design.IsSummaryField          = EvSqlMethods.getBool(Row, EdRecordFields.DB_SUMMARY_FIELD);
            recordField.Design.Mandatory               = EvSqlMethods.getBool(Row, EdRecordFields.DB_MANDATORY);
            recordField.Design.AiDataPoint             = EvSqlMethods.getBool(Row, EdRecordFields.DB_AI_DATA_POINT);
            recordField.Design.HideField               = EvSqlMethods.getBool(Row, EdRecordFields.DB_HIDDEN);
            recordField.Design.ExSelectionListId       = EvSqlMethods.getString(Row, EdRecordFields.DB_EX_SELECTION_LIST_ID);
            recordField.Design.ExSelectionListCategory = EvSqlMethods.getString(Row, EdRecordFields.DB_EX_SELECTION_LIST_CATEGORY);
            recordField.Design.DefaultValue            = EvSqlMethods.getString(Row, EdRecordFields.DB_DEFAULT_VALUE);
            recordField.Design.Unit        = EvSqlMethods.getString(Row, EdRecordFields.DB_UNIT);
            recordField.Design.UnitScaling = EvSqlMethods.getString(Row, EdRecordFields.DB_UNIT_SCALING);

            recordField.Design.ValidationLowerLimit  = EvSqlMethods.getFloat(Row, EdRecordFields.DB_VALIDATION_LOWER_LIMIT);
            recordField.Design.ValidationUpperLimit  = EvSqlMethods.getFloat(Row, EdRecordFields.DB_VALIDATION_UPPER_LIMIT);
            recordField.Design.AlertLowerLimit       = EvSqlMethods.getFloat(Row, EdRecordFields.DB_ALERT_LOWER_LIMIT);
            recordField.Design.AlertUpperLimit       = EvSqlMethods.getFloat(Row, EdRecordFields.DB_ALERT_UPPER_LIMIT);
            recordField.Design.NormalRangeLowerLimit = EvSqlMethods.getFloat(Row, EdRecordFields.DB_NORMAL_LOWER_LIMITD);
            recordField.Design.NormalRangeUpperLimit = EvSqlMethods.getFloat(Row, EdRecordFields.DB_NORMAL_UPPER_LIMIT);

            recordField.Design.FieldCategory        = EvSqlMethods.getString(Row, EdRecordFields.DB_FIELD_CATEGORY);
            recordField.Design.AnalogueLegendStart  = EvSqlMethods.getString(Row, EdRecordFields.DB_ANALOGUE_LEGEND_START);
            recordField.Design.AnalogueLegendFinish = EvSqlMethods.getString(Row, EdRecordFields.DB_ANALOGUE_LEGEND_FINISH);
            recordField.Design.JavaScript           = EvSqlMethods.getString(Row, EdRecordFields.DB_JAVA_SCRIPT);
            recordField.Design.InitialOptionList    = EvSqlMethods.getString(Row, EdRecordFields.DB_INITIAL_OPTION_LIST);
            recordField.Design.InitialVersion       = EvSqlMethods.getInteger(Row, EdRecordFields.DB_INITIAL_VERSION);
            //
            // if the field is a signature then decrypt the field.
            //
            if (recordField.TypeId == EvDataTypes.Signature)
            {
                this.LogDebug("Encrypted Signature string");
                EvEncrypt encrypt = new EvEncrypt(this.ClassParameters.AdapterGuid, recordField.Guid);
                encrypt.ClassParameters = this.ClassParameters;

                value = encrypt.decryptString(recordField.ItemText);
                this.LogDebug("clear string: " + value);
                recordField.ItemText = value;

                this.LogClass(encrypt.Log);
            }

            //
            // Get the table or matric object.
            //
            this.processTableRowObject(Row, recordField);

            //
            // Return the formfield object.
            //
            this.LogMethodEnd("getRowData");
            return(recordField);
        }//END getRowData method.
Ejemplo n.º 13
0
        // =====================================================================================
        /// <summary>
        /// This class reads the content of the SqlDataReader into the Report data object.
        /// </summary>
        /// <param name="Row">DataRow: a data row object.</param>
        /// <param name="Columns">List of EvReportColumn: a list of report columns</param>
        /// <returns>EvReportRow: a report row object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Loop through the Report's columns list
        ///
        /// 2. Switch data type to update the Report object's column values.
        ///
        /// 3. Return the Report object.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        private EdReportRow readRow(DataRow Row, List <EdReportColumn> Columns)
        {
            //
            // Initialize the return report row object.
            //
            EdReportRow reportRow = new EdReportRow(Columns.Count);

            //
            // Loop through the report columns list.
            //
            for (int columnCount = 0; columnCount < Columns.Count; columnCount++)
            {
                //
                // Switch column's datatype for updating the column values.
                //
                switch (Columns [columnCount].DataType)
                {
                case EdReport.DataTypes.Bool:
                {
                    reportRow.ColumnValues [columnCount] = EvSqlMethods.getBool(Row, Columns [columnCount].SourceField).ToString( );
                    break;
                }

                case EdReport.DataTypes.Date:
                {
                    DateTime dateVal = EvSqlMethods.getDateTime(Row, Columns [columnCount].SourceField);
                    if (dateVal != Evado.Model.EvStatics.CONST_DATE_NULL)
                    {
                        reportRow.ColumnValues [columnCount] = dateVal.ToString("dd MMM yyyy HH:mm:ss");
                    }
                    else
                    {
                        reportRow.ColumnValues [columnCount] = "";
                    }

                    break;
                }

                case EdReport.DataTypes.Integer:
                {
                    reportRow.ColumnValues [columnCount] = EvSqlMethods.getInteger(Row, Columns [columnCount].SourceField).ToString( );
                    break;
                }

                case EdReport.DataTypes.Float:
                case EdReport.DataTypes.Currency:
                {
                    reportRow.ColumnValues [columnCount] = EvSqlMethods.getFloat(Row, Columns [columnCount].SourceField).ToString( );
                    break;
                }

                default:
                {
                    String val = EvSqlMethods.getString(Row, Columns [columnCount].SourceField);
                    if (val == "Null")
                    {
                        val = String.Empty;
                    }
                    reportRow.ColumnValues [columnCount] = val;
                    break;
                }
                } //END Type switch
            }     //END column interation loop.

            //
            // Return the Report object
            //
            return(reportRow);
        }// End readRow method.
Ejemplo n.º 14
0
        }//END SetParameters class.

        #endregion

        #region Data Reader methods

        // =====================================================================================
        /// <summary>
        /// This class extracts the data row values to the report object.
        /// </summary>
        /// <param name="Row">DataRow: a data row object</param>
        /// <returns>EvReport: a report data object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Extract the compatible data row values to the Report data object.
        ///
        /// 2. Set the xml report string, if it is empty.
        ///
        /// 3. Return the Report data object.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        public EdReport readRow(DataRow Row)
        {
            //
            // Initialise the methods variables and objects.
            //
            EdReport report = new EdReport( );

            //
            // Set the xml report string, if it is empty.
            //
            string xmlReport = EvSqlMethods.getString(Row, "RS_XmlReport");

            if (xmlReport != String.Empty)
            {
                xmlReport = xmlReport.Replace("utf-8", "utf-16");

                xmlReport = xmlReport.Replace("<SelectionSource></SelectionSource>",
                                              "<SelectionSource>None</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource />",
                                              "<SelectionSource>None</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>SubjectId</SelectionSource>",
                                              "<SelectionSource>Subject_Id</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>SiteId</SelectionSource>",
                                              "<SelectionSource>Site_Id</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>TrialId</SelectionSource>",
                                              "<SelectionSource>Trial_Id</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>Trial_Id</SelectionSource>",
                                              "<SelectionSource>Project_Id</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>ScheduleId</SelectionSource>",
                                              "<SelectionSource>Arm_Index</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>AllTrialSites</SelectionSource>",
                                              "<SelectionSource>All_Trial_Sites</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>CurrentTrial</SelectionSource>",
                                              "<SelectionSource>Current_Trial</SelectionSource>");

                xmlReport = xmlReport.Replace("<SelectionSource>Current_Trial</SelectionSource>",
                                              "<SelectionSource>Current_Project</SelectionSource>");

                xmlReport = xmlReport.Replace("<TrialId>", "<ProjectId>");
                xmlReport = xmlReport.Replace("</TrialId>", "</ProjectId>");
                xmlReport = xmlReport.Replace("<ReportTypeId>", "<ReportType>");
                xmlReport = xmlReport.Replace("</ReportTypeId>", "</ReportType>");

                report = Evado.Model.EvStatics.DeserialiseObject <EdReport> (xmlReport);;
            }

            //
            // Extract the compatible data row values to the Report object.
            //
            report.Guid        = EvSqlMethods.getGuid(Row, "RS_Guid");
            report.ReportId    = EvSqlMethods.getString(Row, "ReportId");
            report.ReportTitle = EvSqlMethods.getString(Row, "RS_ReportTitle");
            //Report.ReportSubTitle = EvSqlMethods.getString( Row, "RS_ReportSubTitle" );
            report.ReportDate = EvSqlMethods.getDateTime(Row, "RS_ReportDate");
            report.ReportType = (EdReport.ReportTypeCode)EvSqlMethods.getInteger(Row, "RS_ReportTypeId");
            report.ReportNo   = EvSqlMethods.getInteger(Row, "RS_ReportNo");

            report.UpdateUserId = EvSqlMethods.getString(Row, "RS_UpdatedByUserId");
            report.Updated      = EvSqlMethods.getString(Row, "RS_UpdatedBy");
            report.Updated     += " on " + EvSqlMethods.getDateTime(Row, "RS_UpdateDate").ToString("dd MMM yyyy HH:mm");

            report.GeneratedBy = EvSqlMethods.getString(Row, "RS_UpdatedBy");

            //
            // Return the Report object
            //
            return(report);
        }// End readRow method.