Exemple #1
0
        public Api(string node)
        {
            netnode = node;
            switch (netnode)
            {
            case "testnet":
                daoService = new DaoService
                {
                    mh              = mh,
                    mongodbConnStr  = mh.notify_mongodbConnStr_testnet,
                    mongodbDatabase = mh.notify_mongodbDatabase_testnet
                };
                break;

            case "mainnet":
                daoService = new DaoService
                {
                    mh              = mh,
                    mongodbConnStr  = mh.notify_mongodbConnStr_mainnet,
                    mongodbDatabase = mh.notify_mongodbDatabase_mainnet
                };
                break;
            }

            initMonitor();
        }
Exemple #2
0
        private DaoService GetDaoService()
        {
            var web3    = new Web3.Web3("https://eth2.augur.net");
            var service = new DaoService(web3, "0xbb9bc244d798123fde783fcc1c72d3bb8c189413");

            return(service);
        }
Exemple #3
0
        //Intrumentacion Logger


        // public override Crear Ejecutar(Usuario usuario)
        public Crear Ejecutar(Usuario usuario)
        {
            DaoService dao       = FabricaDAO.crearDaoService();
            Crear      respuesta = dao.AgregarUsuario(usuario);

            // Intrumentacion Logger

            return(respuesta);
        }
Exemple #4
0
        public override string Ejecutar()
        {
            //Intrumentacion Logger

            DaoService dao       = FabricaDAO.crearDaoService();
            string     respuesta = dao.GetData();

            //Intrumentacion Logger
            return(respuesta);
        }
Exemple #5
0
        public override Consulta Ejecutar()
        {
            //Intrumentacion Logger

            DaoService dao       = FabricaDAO.crearDaoService();
            Consulta   respuesta = dao.ConsultarUsuarios();

            //Intrumentacion Logger

            return(respuesta);
        }
Exemple #6
0
        public Consulta Ejecutar(int id_usuario)
        {
            //Intrumentacion Logger

            DaoService dao       = FabricaDAO.crearDaoService();
            Consulta   respuesta = dao.ConsultarUsuarioPorID(id_usuario);

            //Intrumentacion Logger

            return(respuesta);
        }
Exemple #7
0
        public Eliminar Ejecutar(int id_usuario, int estadoeliminado)
        {
            //Intrumentacion Logger

            DaoService dao       = FabricaDAO.crearDaoService();
            Eliminar   respuesta = dao.EliminarUsuario(id_usuario, estadoeliminado);

            //Intrumentacion Logger

            return(respuesta);
        }
Exemple #8
0
        //Sifranti
        public List <DSifranti> GetDSifranti(string id)
        {
            List <DSifranti> dto;

            try
            {
                dto = DaoService.GetSifranti(id).ToList();
            }
            catch (Exception ex)
            {
                Log.Error("Napaka pri branju Šifrantov /" + ex);
                throw new ApplicationException("Napaka pri branju Šifrantov /" + ex);
            }

            return(dto);
        }
        public void CreateCampaign()
        {
            // Initiliaser un objet Campaign
            Campaign campaign = new Campaign()
            {
                Name = "Nouvelle Campagne", Description = "Description Nouvelle Campagne"
            };

            // On vérifie qu'une campagne appelée "Nouvelle Campagne" n'existe pas déjà / Maitrise du multi-clic

            // Générer un fichier XML Campaign.txt
            if (XmlService <Campaign> .WriteXml("Campaign\\Nouvelle Campagne\\Campaign.txt", campaign))
            {
                // Générer un fichier DB Campaign.db
                DaoService.CreateCampaignDatabase("Campaign\\Nouvelle Campagne\\Campaign.db");

                // On rappelle la méthode GetCampaignList afin de remettre à jour la liste des campagnes
                //  On verra la campagne nouvellement créée apparaître
                CampaignList = GetCampaignList();
            }
        }
Exemple #10
0
        /*Berem SQLite bazo preko navadnega selecta*/
        public DResponse GetDResponse(string SearchString, int pageIndex, int pageSelected, string sortKey, string asc)
        {
            DaoService dao = new DaoService();
            DResponse  dto;

            try
            {
                dto = new DResponse
                {
                    DataList = dao.GetData(SearchString.Replace("undefined", ""), pageIndex, pageSelected, sortKey, asc),
                    //RowsCount = dao.GetRowsCount(SearchString)
                    RowsCount = 10
                };
            }
            catch (Exception ex)
            {
                Log.Error("Napaka pri branju Aplikacij /" + ex);
                throw new ApplicationException("Napaka pri branju Aplikacij /" + ex);
            }

            return(dto);
        }
        private void GetDatabase()
        {
            if (SelectedCampaign != null)
            {
                string selectedCampaignDirectory = string.Concat("Campaign\\", SelectedCampaign.Name);
                if (Directory.Exists(selectedCampaignDirectory))
                {
                    string campaignDataBasePath = string.Concat(selectedCampaignDirectory, "\\Campaign.db");
                    if (File.Exists(campaignDataBasePath))
                    {
                        DaoService.Initialize(campaignDataBasePath);

                        /*ChampionshipList = DaoServicesChampionship.GetAllChampionship();
                         * ClubList = DaoServicesClub.GetAllClub();
                         * TeamList = DaoServicesTeam.GetAllTeam();
                         * PlayerList = DaoServicesPlayer.GetAllPlayer();*/
                    }
                }
                else
                {
                    // RAF
                }
            }
        }
Exemple #12
0
        public Api(string node)
        {
            netnode = node;
            switch (netnode)
            {
            case "testnet":
                innerTxService = new InnerTxService
                {
                    mh = mh,
                    block_mongodbConnStr  = mh.block_mongodbConnStr_testnet,
                    block_mongodbDatabase = mh.block_mongodbDatabase_testnet,
                    analy_mongodbConnStr  = mh.analy_mongodbConnStr_testnet,
                    analy_mongodbDatabase = mh.analy_mongodbDatabase_testnet
                };
                contractService = new ContractService
                {
                    mh = mh,
                    Block_mongodbConnStr     = mh.block_mongodbConnStr_testnet,
                    Block_mongodbDatabase    = mh.block_mongodbDatabase_testnet,
                    Notify_mongodbConnStr    = mh.notify_mongodbConnStr_testnet,
                    Notify_mongodbDatabase   = mh.notify_mongodbDatabase_testnet,
                    Analysis_mongodbConnStr  = mh.analy_mongodbConnStr_testnet,
                    Analysis_mongodbDatabase = mh.analy_mongodbDatabase_testnet
                };
                daoService = new DaoService
                {
                    mh              = mh,
                    mongodbConnStr  = mh.dao_mongodbConnStr_testnet,
                    mongodbDatabase = mh.dao_mongodbDatabase_testnet
                };
                nnsDomainCrediteService = new NNSDomainCreditService
                {
                    mh              = mh,
                    mongodbConnStr  = mh.notify_mongodbConnStr_testnet,
                    mongodbDatabase = mh.notify_mongodbDatabase_testnet,
                };
                blockService = new BlockService
                {
                    mh = mh,
                    Block_mongodbConnStr  = mh.block_mongodbConnStr_testnet,
                    Block_mongodbDatabase = mh.block_mongodbDatabase_testnet,
                };
                analyService = new AnalyService
                {
                    mh = mh,
                    block_mongodbConnStr  = mh.block_mongodbConnStr_testnet,
                    block_mongodbDatabase = mh.block_mongodbDatabase_testnet,
                    analy_mongodbConnStr  = mh.analy_mongodbConnStr_testnet,
                    analy_mongodbDatabase = mh.analy_mongodbDatabase_testnet,
                };
                assetService = new AssetService
                {
                    mh              = mh,
                    mongodbConnStr  = mh.block_mongodbConnStr_testnet,
                    mongodbDatabase = mh.block_mongodbDatabase_testnet,
                };
                nnsService = new NNSService
                {
                    mh = mh,
                    block_mongodbConnStr   = mh.block_mongodbConnStr_testnet,
                    block_mongodbDatabase  = mh.block_mongodbDatabase_testnet,
                    analy_mongodbConnStr   = mh.analy_mongodbConnStr_testnet,
                    analy_mongodbDatabase  = mh.analy_mongodbDatabase_testnet,
                    notify_mongodbConnStr  = mh.notify_mongodbConnStr_testnet,
                    notify_mongodbDatabase = mh.notify_mongodbDatabase_testnet,
                    //bonusSgas_mongodbConnStr = mh.bonusSgas_mongodbConnStr_testnet,
                    bonusSgas_mongodbConnStr = mh.snapshot_mongodbConnStr_testnet,
                    //bonusSgas_mongodbDatabase = mh.bonusSgas_mongodbDatabase_testnet,
                    bonusSgas_mongodbDatabase = mh.snapshot_mongodbDatabase_testnet,
                    bonusStatisticCol         = mh.bonusStatisticCol_testnet,
                    bonusSgasCol     = mh.bonusSgasCol_testnet,
                    id_sgas          = mh.id_sgas_testnet,
                    auctionStateColl = mh.auctionStateColl_testnet,
                    bonusAddress     = mh.bonusAddress_testnet,
                    //nelJsonRPCUrl = mh.nelJsonRPCUrl_testnet
                };
                domainService = new DomainService
                {
                    mh = mh,
                    Block_mongodbConnStr   = mh.block_mongodbConnStr_testnet,
                    Block_mongodbDatabase  = mh.block_mongodbDatabase_testnet,
                    Notify_mongodbConnStr  = mh.notify_mongodbConnStr_testnet,
                    Notify_mongodbDatabase = mh.notify_mongodbDatabase_testnet,
                    auctionStateColl       = mh.auctionStateColl_testnet,
                    bonusAddress           = mh.bonusAddress_testnet,
                    NNsfixedSellingAddr    = mh.NNsfixedSellingAddr_testnet,
                    NNSfixedSellingColl    = mh.NNSfixedSellingColl_testnet,
                    domainCenterColl       = mh.domainCenterColl_testnet,
                };
                break;

            case "mainnet":
                innerTxService = new InnerTxService
                {
                    mh = mh,
                    block_mongodbConnStr  = mh.block_mongodbConnStr_mainnet,
                    block_mongodbDatabase = mh.block_mongodbDatabase_mainnet,
                    analy_mongodbConnStr  = mh.analy_mongodbConnStr_mainnet,
                    analy_mongodbDatabase = mh.analy_mongodbDatabase_mainnet
                };
                contractService = new ContractService
                {
                    mh = mh,
                    Block_mongodbConnStr     = mh.block_mongodbConnStr_mainnet,
                    Block_mongodbDatabase    = mh.block_mongodbDatabase_mainnet,
                    Notify_mongodbConnStr    = mh.notify_mongodbConnStr_mainnet,
                    Notify_mongodbDatabase   = mh.notify_mongodbDatabase_mainnet,
                    Analysis_mongodbConnStr  = mh.analy_mongodbConnStr_mainnet,
                    Analysis_mongodbDatabase = mh.analy_mongodbDatabase_mainnet
                };
                nnsDomainCrediteService = new NNSDomainCreditService
                {
                    mh              = mh,
                    mongodbConnStr  = mh.notify_mongodbConnStr_mainnet,
                    mongodbDatabase = mh.notify_mongodbDatabase_mainnet,
                };
                blockService = new BlockService
                {
                    mh = mh,
                    Block_mongodbConnStr   = mh.block_mongodbConnStr_mainnet,
                    Block_mongodbDatabase  = mh.block_mongodbDatabase_mainnet,
                    Analy_mongodbConnStr   = mh.analy_mongodbConnStr_mainnet,
                    Analy_mongodbDatabase  = mh.analy_mongodbDatabase_mainnet,
                    Notify_mongodbConnStr  = mh.notify_mongodbConnStr_mainnet,
                    Notify_mongodbDatabase = mh.notify_mongodbDatabase_mainnet,
                };
                analyService = new AnalyService
                {
                    mh = mh,
                    block_mongodbConnStr  = mh.block_mongodbConnStr_mainnet,
                    block_mongodbDatabase = mh.block_mongodbDatabase_mainnet,
                    analy_mongodbConnStr  = mh.analy_mongodbConnStr_mainnet,
                    analy_mongodbDatabase = mh.analy_mongodbDatabase_mainnet,
                };
                assetService = new AssetService
                {
                    mh              = mh,
                    mongodbConnStr  = mh.block_mongodbConnStr_mainnet,
                    mongodbDatabase = mh.block_mongodbDatabase_mainnet,
                };
                nnsService = new NNSService
                {
                    mh = mh,
                    block_mongodbConnStr   = mh.block_mongodbConnStr_mainnet,
                    block_mongodbDatabase  = mh.block_mongodbDatabase_mainnet,
                    analy_mongodbConnStr   = mh.analy_mongodbConnStr_mainnet,
                    analy_mongodbDatabase  = mh.analy_mongodbDatabase_mainnet,
                    notify_mongodbConnStr  = mh.notify_mongodbConnStr_mainnet,
                    notify_mongodbDatabase = mh.notify_mongodbDatabase_mainnet,
                    //bonusSgas_mongodbConnStr = mh.bonusSgas_mongodbConnStr_mainnet,
                    bonusSgas_mongodbConnStr = mh.snapshot_mongodbConnStr_mainnet,
                    //bonusSgas_mongodbDatabase = mh.bonusSgas_mongodbDatabase_mainnet,
                    bonusSgas_mongodbDatabase = mh.snapshot_mongodbDatabase_mainnet,
                    bonusStatisticCol         = mh.bonusStatisticCol_mainnet,
                    bonusSgasCol     = mh.bonusSgasCol_mainnet,
                    id_sgas          = mh.id_sgas_mainnet,
                    auctionStateColl = mh.auctionStateColl_mainnet,
                    bonusAddress     = mh.bonusAddress_mainnet,
                    //nelJsonRPCUrl = mh.nelJsonRPCUrl_mainnet
                };
                domainService = new DomainService
                {
                    mh = mh,
                    Block_mongodbConnStr   = mh.block_mongodbConnStr_mainnet,
                    Block_mongodbDatabase  = mh.block_mongodbDatabase_mainnet,
                    Notify_mongodbConnStr  = mh.notify_mongodbConnStr_mainnet,
                    Notify_mongodbDatabase = mh.notify_mongodbDatabase_mainnet,
                    auctionStateColl       = mh.auctionStateColl_mainnet,
                    bonusAddress           = mh.bonusAddress_mainnet,
                    NNsfixedSellingAddr    = mh.NNsfixedSellingAddr_mainnet,
                    NNSfixedSellingColl    = mh.NNSfixedSellingColl_mainnet,
                    domainCenterColl       = mh.domainCenterColl_mainnet,
                };
                break;
            }

            initMonitor();
        }
Exemple #13
0
 private void TacticClick(object sender, RoutedEventArgs e)
 {
     CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToTacticEvent>().Publish(DaoService.GetTeam(1));
     IsOpen = false;
 }
Exemple #14
0
 private void ClubClick(object sender, RoutedEventArgs e)
 {
     CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToClubEvent>().Publish(DaoService.GetClub(1));
     IsOpen = false;
 }