Exemplo n.º 1
0
        public static DataAccessPath GetSub(this DataAccessPath path, string subName, AccessMode mode)
        {
            var dataAccessPath = path.Clone();

            dataAccessPath.Path.Add(subName);
            dataAccessPath.Mode = mode;
            return(dataAccessPath);
        }
 // insert in the drop down menu all existing databases
 public void PopulateDatabases()
 {
     //fuellt mit den vorhandenen database paths
     ddlDatabase.DataSource     = DataAccessPath.getPaths();
     ddlDatabase.DataTextField  = "DatabasePath";
     ddlDatabase.DataValueField = "Id_path";
     ddlDatabase.DataBind();
     //ddlDatabase.SelectedValue = Constant.currentDatabase;
 }
Exemplo n.º 3
0
 static AppContext()
 {
     m_logManager     = new Log.LogManager();
     m_tableManager   = new TableManager();
     m_settings       = new Settings();
     m_accessPath     = new DataAccessPath();
     m_datumFactory   = new DataRowFactory();
     m_clientsManager = new ClientsManager();
 }
Exemplo n.º 4
0
        public static DataAccessPath WithPrefix(this DataAccessPath original, string prefix)
        {
            var output = new DataAccessPath()
            {
                Path = { prefix },
                Mode = original.Mode
            };

            output.Path.AddRange(original.Path);
            return(output);
        }
Exemplo n.º 5
0
        public override RepeatedField <DataAccessPath> GetPaths()
        {
            var path = new DataAccessPath()
            {
                Mode = AccessedMethods.Any(IsWriteAccessMode) ? AccessMode.Write : AccessMode.Read
            };

            path.Path.AddRange(GetAddressParts(_stateType));
            return(new RepeatedField <DataAccessPath>()
            {
                path
            });
        }
Exemplo n.º 6
0
        public TablesManager()
        {
            m_accessPath  = new DataAccessPath(this);
            m_tablesProxy = new TablesCollection(this);
            m_dataFactory = new DatumFactory();

            var tablesFolder = SettingsManager.TablesFolder;

            m_suppliers   = new DataSuppliersTable(Path.Combine(tablesFolder, "splr"));
            m_units       = new UnitsTable(Path.Combine(tablesFolder, "unit"));
            m_countries   = new CountriesTable(Path.Combine(tablesFolder, "ctry"));
            m_incoterms   = new IncotermsTable(Path.Combine(tablesFolder, "ict"));
            m_places      = new PlacesTable(Path.Combine(tablesFolder, "place"));
            m_currencies  = new CurrenciesTable(Path.Combine(tablesFolder, "cncy"));
            m_valContexts = new ValuesContextsTable(Path.Combine(tablesFolder, "vctxt"));
            m_products    = new ProductsTable(Path.Combine(tablesFolder, "prod"));
            m_sharedTexts = new SharedTextsTable(Path.Combine(tablesFolder, "stxt"));
            m_spotValues  = new SpotValuesTable(Path.Combine(tablesFolder, "sval"));
        }
Exemplo n.º 7
0
        public ITRDatum Build(uint spotValueID)
        {
            DataAccessPath dataPath = AppContext.AccessPath;

            var datum = new TRDatum();

            datum.SpotValue      = dataPath.GetKeyIndexer(InternalTablesID.TR_SPOT_VALUE).Get(spotValueID) as SpotValue;
            datum.TRLabel        = dataPath.GetKeyIndexer(InternalTablesID.TR_LABEL).Get(datum.SpotValue.LabelID) as TRLabel;
            datum.ProductMapping = dataPath.GetKeyIndexer(InternalTablesID.TR_PRODUCT_MAPPING).Get(datum.SpotValue.ProductMappingID) as ProductMapping;
            datum.Product        = dataPath.GetKeyIndexer(TablesID.PRODUCT).Get(datum.ProductMapping.ProductID) as Product;
            datum.ValueContext   = dataPath.GetKeyIndexer(TablesID.VALUE_CONTEXT).Get(datum.ProductMapping.ContextID) as ValueContext;
            datum.Country        = dataPath.GetKeyIndexer(TablesID.COUNTRY).Get(datum.ValueContext.OriginID) as Country;
            datum.Currency       = dataPath.GetKeyIndexer(TablesID.CURRENCY).Get(datum.ValueContext.CurrencyID) as Currency;
            datum.Unit           = dataPath.GetKeyIndexer(TablesID.UNIT).Get(datum.ValueContext.UnitID) as Unit;
            datum.Place          = dataPath.GetKeyIndexer(TablesID.PLACE).Get(datum.ValueContext.PlaceID) as Place;
            datum.Incoterm       = dataPath.GetKeyIndexer(TablesID.INCOTERM).Get(datum.ValueContext.IncotermID) as Incoterm;

            return(datum);
        }