public List <SingleColumn> GetColumnValues(EbDataTable LocalData, int RowIndex)
        {
            List <SingleColumn> SC = new List <SingleColumn>();

            for (int i = 0; i < LocalData.Rows[RowIndex].Count; i++)
            {
                EbDataColumn column = LocalData.Columns.Find(o => o.ColumnIndex == i);

                if (column != null && column.ColumnName != "eb_loc_id" && column.ColumnName != "id")
                {
                    DbTypedValue DTV = this.GetDbType(column.ColumnName, LocalData.Rows[RowIndex][i], column.Type);
                    SC.Add(new SingleColumn
                    {
                        Name  = column.ColumnName,
                        Type  = (int)DTV.Type,
                        Value = DTV.Value
                    });
                }
            }
            return(SC);
        }
예제 #2
0
        public List <SingleColumn> GetColumnValues(ColumnColletion columns, EbDataRow row)
        {
            List <SingleColumn> singleColumn = new List <SingleColumn>();

            for (int i = 0; i < row.Count; i++)
            {
                EbDataColumn column = columns.Find(o => o.ColumnIndex == i);

                if (column != null && column.ColumnName != "eb_loc_id" && column.ColumnName != "id")
                {
                    DbTypedValue DTV = GetDbType(column.ColumnName, row[i], column.Type);

                    singleColumn.Add(new SingleColumn
                    {
                        Name  = column.ColumnName,
                        Type  = (int)DTV.Type,
                        Value = DTV.Value
                    });
                }
            }
            return(singleColumn);
        }
        public DbTypedValue GetDbType(string name, object value, EbDbTypes type)
        {
            DbTypedValue TV = new DbTypedValue(name, value, type);

            EbMobileControl ctrl = ControlDictionary.ContainsKey(name) ? ControlDictionary[name] : null;

            if (ctrl != null)
            {
                TV.Type  = ctrl.EbDbType;
                TV.Value = ctrl.SQLiteToActual(value);
            }
            else
            {
                if (TV.Type == EbDbTypes.Date)
                {
                    TV.Value = Convert.ToDateTime(value).ToString("yyyy-MM-dd");
                }
                else if (TV.Type == EbDbTypes.DateTime)
                {
                    TV.Value = Convert.ToDateTime(value).ToString("yyyy-MM-dd HH:mm:ss");
                }
            }
            return(TV);
        }
예제 #4
0
        public DbTypedValue GetDbType(string name, object value, EbDbTypes type)
        {
            DbTypedValue TV = new DbTypedValue(name, value, type);

            EbMobileControl ctrl = ChildControls.Find(item => item.Name == name);

            if (ctrl != null)
            {
                TV.Type  = ctrl.EbDbType;
                TV.Value = ctrl.SQLiteToActual(value);
            }
            else
            {
                if (type == EbDbTypes.Date)
                {
                    TV.Value = Convert.ToDateTime(value).ToString("yyyy-MM-dd");
                }
                else if (type == EbDbTypes.DateTime)
                {
                    TV.Value = Convert.ToDateTime(value).ToString("yyyy-MM-dd HH:mm:ss");
                }
            }
            return(TV);
        }