示例#1
0
        bool AddBlankRowToRecordset(IDataListItem dlItem, IList <IScalar> columns, int indexToInsertAt, int indexNum)
        {
            var itemsAdded = false;

            if (dlItem.CanHaveMutipleRows)
            {
                IList <IScalar> recsetCols = columns.Distinct(Scalar.Comparer).ToList();
                string          colName    = null;
                foreach (var col in recsetCols.Distinct(new ScalarNameComparer()))
                {
                    if (string.IsNullOrEmpty(colName) || !colName.Equals(col.Name))
                    {
                        WorkflowInputs.Insert(indexToInsertAt + 1, new DataListItem
                        {
                            DisplayValue       = string.Concat(dlItem.Recordset, @"(", indexNum, @").", col.Name),
                            Value              = string.Empty,
                            CanHaveMutipleRows = dlItem.CanHaveMutipleRows,
                            Recordset          = dlItem.Recordset,
                            Field              = col.Name,
                            Description        = col.Description,
                            Index              = indexNum.ToString(CultureInfo.InvariantCulture)
                        });
                        indexToInsertAt++;
                    }
                    colName    = col.Name;
                    itemsAdded = true;
                }
            }
            return(itemsAdded);
        }
        private bool AddBlankRowToRecordset(IDataListItem dlItem, IList <Dev2Column> columns, int indexToInsertAt, int indexNum)
        {
            bool itemsAdded = false;

            if (dlItem.IsRecordset)
            {
                IList <Dev2Column> recsetCols = columns;
                foreach (Dev2Column col in recsetCols)
                {
                    WorkflowInputs.Insert(indexToInsertAt + 1, new DataListItem
                    {
                        DisplayValue   = string.Concat(dlItem.Recordset, "(", indexNum, ").", col.ColumnName),
                        Value          = string.Empty,
                        IsRecordset    = dlItem.IsRecordset,
                        Recordset      = dlItem.Recordset,
                        Field          = col.ColumnName,
                        Description    = col.ColumnDescription,
                        RecordsetIndex = indexNum.ToString(CultureInfo.InvariantCulture)
                    });
                    itemsAdded = true;
                    indexToInsertAt++;
                }
            }
            return(itemsAdded);
        }