예제 #1
0
파일: 2568.cs 프로젝트: kubiix/StyleCop
        /// <summary>
        /// Create a NavDataSet with the formVariables in a table
        /// </summary>
        /// <returns>Returns the data set.</returns>
        internal NavDataSet GetFormVariablesState()
        {
            NavDataSet dataSet = new NavDataSet();

            dataSet.Locale = CultureInfo.InvariantCulture;
            NavDataTable dataTable = new NavDataTable();

            dataTable.Locale    = CultureInfo.InvariantCulture;
            dataTable.TableName = "FormVariables";
            dataSet.Tables.Add(dataTable);
            NsFormDataAccess formDataAccess = this as NsFormDataAccess;

            if (formDataAccess != null && formDataAccess.Form != null)
            {
                foreach (NavFormSourceExpression sourceExpression in formDataAccess.RowBasedExpressions)
                {
                    NSPage.AddFieldToDataTable(sourceExpression.Id, CommonTypeInformation.ResolveClrType(NavNclTypeHelper.GetNavTypeFromType(sourceExpression.Type)), dataTable);
                }
            }
            NavDataRow dataRow = dataTable.NewRow();

            NSRecordBase.PopulateCLRTable(dataTable, this, dataRow);
            dataTable.Rows.Add(dataRow);
            return(dataSet);
        }
예제 #2
0
파일: 2568.cs 프로젝트: kubiix/StyleCop
        internal void GetCommittedData(object sender, EventArgs e)
        {
            NavDataSet   dataSet   = new NavDataSet();
            NavDataTable dataTable = new NavDataTable();

            dataSet.Tables.Add(dataTable);
            NSPage.BuildCLRDataTable(dataTable, null, this);
            NavDataRow row = dataTable.NewRow();

            NavRecord cached = (this.Record != null) ? this.Record.Clone(this.Record.IsTemporary) : null;

            try
            {
                // Get the latest persisted copy of the record
                if (this.Record != null)
                {
                    if (!this.Record.ALGet(DataError.TrapError, this.Record.ALRecordId))
                    {
                        return;
                    }
                }

                NSRecordBase.PopulateCLRTable(dataTable, this, row);
                dataTable.Rows.Add(row);
            }
            finally
            {
                if (cached != null)
                {
                    this.Record.Assign(cached);
                    cached.Dispose();
                }
            }

            NavRecordState dataSetState = NSDatasetState.Create(this);

            NSClientCallback.SendCommittedDataToClient(dataSet, dataSetState);
        }