Example #1
0
        internal void ToSettings(string indexName, Dictionary <string, string> settings, bool isSubField)
        {
            var category = "Index-" + indexName.ToLower() + "-Fields-" + this.Name.ToLower();

            Lib.AddSettingAsNeeded(settings, category, "IsSubField", isSubField.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Name", this.Name, true);

            Lib.AddSettingAsNeeded(settings, category, "Ordinal", Ordinal.ToString(), true);


            Lib.AddSettingAsNeeded(settings, category, "Value", ("" + Value).ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsPrimaryKey", IsPrimaryKey.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "StoredInIndex", StoredInIndex.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Searchable", Searchable.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Format", Format.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Type", DataType.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsBoolean", IsBoolean.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "TrueValue", TrueValue.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsCreatedDate", IsCreatedDate.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsModifiedDate", IsModifiedDate.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "ForeignKeyTable", ForeignKeyTable.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "ForeignKeyField", ForeignKeyField.ToString(), true);


            Lib.AddSettingAsNeeded(settings, category, "Calculation", Calculation.ToString(), true);
            foreach (Field sf in this.SubFields)
            {
                sf.ToSettings(indexName, settings, true);
            }
        }
Example #2
0
        internal void FillDataSet(DataSet ds, string indexName, bool isSubField)
        {
            var dtField = ds.Tables["index_field"];

            var drFields = dtField.Select("index_name = '" + indexName + "' and field_name = '" + Name + "'");
            var drField  = dtField.NewRow();

            if (drFields.Length == 0)
            {
                dtField.Rows.Add(drField);
            }
            else
            {
                drField = drFields[0];
            }


            drField["index_name"] = indexName;
            drField["field_name"] = Name.ToString();
            drField["ordinal"]    = Ordinal.ToString();
            //drField["value"] = ("" + Value).ToString();
            drField["is_primary_key"]     = IsPrimaryKey.ToString();
            drField["is_stored_in_index"] = StoredInIndex.ToString();
            drField["is_searchable"]      = Searchable.ToString();
            drField["format"]             = Format.ToString();
            drField["type"]              = DataType.ToString();
            drField["is_boolean"]        = IsBoolean.ToString();
            drField["true_value"]        = TrueValue.ToString();
            drField["foreign_key_table"] = ForeignKeyTable.ToString();
            drField["foreign_key_field"] = ForeignKeyField.ToString();
            drField["calculation"]       = Calculation.ToString();

            foreach (Field sf in this.SubFields)
            {
                sf.FillDataSet(ds, indexName, true);
            }
        }