Ejemplo n.º 1
0
        /*
         * public override CurrentItems FillDataRow()
         * {
         *      CurrentItems ci = base.FillDataRow();
         *      DataRow row = this.Current as DataRow;
         *
         *      if (row != null) {
         *              CurrentItem c = null;
         *
         *              foreach (DataColumn dc in table.Columns)
         *              {
         *                      c = new CurrentItem();
         *                      c.ColumnName = dc.ColumnName;
         *                      c.Value = row[dc.ColumnName];
         *                      ci.Add(c);
         *              }
         *      }
         *      return ci;
         * }
         */

        public override CurrentItemsCollection FillDataRow()
        {
            CurrentItemsCollection ci = base.FillDataRow();

            if (current != null)
            {
                CurrentItem c = null;
                foreach (PropertyDescriptor pd in this.listProperties)
                {
                    c            = new CurrentItem();
                    c.ColumnName = pd.Name;
                    c.DataType   = pd.PropertyType;
                    c.Value      = pd.GetValue(this.Current).ToString();
                    ci.Add(c);
                }
            }
            return(ci);
        }
Ejemplo n.º 2
0
        public override CurrentItemsCollection FillDataRow()
        {
            CurrentItemsCollection ci = base.FillDataRow();
            DataRow row = this.Current as DataRow;

            if (row != null)
            {
                CurrentItem c = null;
                foreach (DataColumn dc in table.Columns)
                {
                    c            = new CurrentItem();
                    c.ColumnName = dc.ColumnName;
                    c.DataType   = dc.DataType;
                    c.Value      = row[dc.ColumnName];
                    ci.Add(c);
                }
            }
            return(ci);
        }
Ejemplo n.º 3
0
        public CurrentItemsCollection FillDataRow(int pos)
        {
            CurrentItemsCollection ci = new CurrentItemsCollection();
            DataRow row = this.table.Rows[pos] as DataRow;

            if (row != null)
            {
                CurrentItem c = null;
                foreach (DataColumn dc in table.Columns)
                {
                    c            = new CurrentItem();
                    c.ColumnName = dc.ColumnName;
                    c.DataType   = dc.DataType;
                    c.Value      = row[dc.ColumnName];
                    ci.Add(c);
                }
            }
            return(ci);
        }