Ejemplo n.º 1
0
        }//END setUpdateChangeParameters.

        // +++++++++++++++++++++++++ END QUERY PARAMETERS SECTION ++++++++++++++++++++++++++++++
        #endregion

        #region data change reader

        // =====================================================================================
        /// <summary>
        /// This class reads the content of the data reader object into Change business object.
        /// </summary>
        /// <param name="Row">DataRow: a data row object</param>
        /// <returns>EvDataChange: a data change object</returns>
        /// <remarks>
        /// This method consists of the following steps:
        ///
        /// 1. Extract the data row values to the data change object.
        ///
        /// 2. Encrypt the data change if it is not encrypted.
        ///
        /// 3. Return the data change object.
        /// </remarks>
        // -------------------------------------------------------------------------------------
        private EvDataChange getRowData(DataRow Row)
        {
            //
            // Initialise the data change object
            //
            EvDataChange dataChange = new EvDataChange( );

            //
            // Extract the data row values to the data change object.
            //
            dataChange.Guid       = EvSqlMethods.getGuid(Row, "DC_Guid");
            dataChange.RecordGuid = EvSqlMethods.getGuid(Row, "DC_RecordGuid");
            dataChange.Uid        = EvSqlMethods.getLong(Row, "DC_Uid");
            dataChange.RecordUid  = EvSqlMethods.getLong(Row, "DC_RecordUid");
            dataChange.TableName  =
                Evado.Model.EvStatics.parseEnumValue <EvDataChange.DataChangeTableNames> (
                    EvSqlMethods.getString(Row, "DC_TableName"));
            string encrypted = EvSqlMethods.getString(Row, "DC_DataChange");

            dataChange.UserId    = EvSqlMethods.getString(Row, "DC_UserId");
            dataChange.DateStamp = EvSqlMethods.getDateTime(Row, "DC_DateStamp");

            //
            // Check that the encrypted string exists.
            //
            if (encrypted != String.Empty)
            {
                dataChange = this.decryptData(encrypted, dataChange.Guid);

                //
                // Check that items exist.
                //
                if (dataChange != null)
                {
                    //
                    // If the data change items exist process them.
                    //
                    if (dataChange.Items.Count > 0)
                    {
                        //
                        // Iterate through the data change items updating the html coding
                        //
                        for (int count = 0; count < dataChange.Items.Count; count++)
                        {
                            dataChange.Items [count].InitialValue =
                                dataChange.Items [count].InitialValue.Replace("&amp;gt;", "&amp;gt; ");

                            dataChange.Items [count].NewValue =
                                dataChange.Items [count].NewValue.Replace("&amp;gt;", "&amp;gt; ");
                        } //END iterate through the item values correcting html coding.
                    }     //END data change items exist.
                }         //END items exit
            }             //END encrypted date exists

            //
            // Return the newField .
            //
            return(dataChange);
        }//END getRowData method.