コード例 #1
0
        protected override void DoExecute(CodeActivityContext context)
        {
            devlog.Debug(string.Format("Called on '{0}'", ExchangeAppointment));
            var myExchangeAppointment = ExchangeAppointment.Get(context);

            devlog.Debug(string.Format("myExchangeAppointment:'{0}'", myExchangeAppointment));
            ExchangeRepository.insertOrUpdate(myExchangeAppointment);
        }
コード例 #2
0
        protected override void DoExecute(CodeActivityContext context)
        {
            devlog.Debug("Entered");
            var result      = ExchangeRepository.Updated();
            var updatedApps = new List <Models.ExchangeAppointmentDTO>(result).ToArray();

            devlog.DebugFormat("updatedApps.Length:'{0}'", updatedApps.Length);
            UpdatedAppointments.Set(context, updatedApps);
        }
コード例 #3
0
        protected override void DoExecute(CodeActivityContext context)
        {
            devlog.Debug(string.Format("Called on '{0}'and  '{1}'", ExchangeAppointment, FoundDuplicity));
            var myExchangeAppointment = ExchangeAppointment.Get(context);
            var myFoundDuplicity      = FoundDuplicity.Get(context);

            devlog.Debug(string.Format("Got '{0}' and  '{1}'", myExchangeAppointment, myFoundDuplicity));
            ExchangeRepository.ChangeInternalIdBecauseOfDuplicity(myExchangeAppointment, myFoundDuplicity);
        }
        protected override void DoExecute(CodeActivityContext context)
        {
            devlog.Debug(string.Format("Called on '{0}'and  '{1}'", ExchangeAppointment, AdapterId));
            var myExchangeAppointment = ExchangeAppointment.Get(context);
            var myAdapterId           = AdapterId.Get(context);

            devlog.Debug(string.Format("Got '{0}' and  '{1}'", myExchangeAppointment, myAdapterId));
            var dto = ExchangeRepository.ConvertToDTO(myExchangeAppointment, myAdapterId);

            AdapterAppointment.Set(context, dto);
        }
コード例 #5
0
        protected override void DoExecute(CodeActivityContext context)
        {
            devlog.Debug(string.Format("Called on '{0}'and  '{1}'", AdapterAppointment, ServiceAccountId));
            var myAdapterAppointment          = AdapterAppointment.Get(context);
            var myServiceAccountId            = ServiceAccountId.Get(context);
            var myOriginalExchangeAppointment = OriginalExchangeAppointment.Get(context);

            devlog.Debug(string.Format("Got '{0}' and  '{1}' and '{2}'", myAdapterAppointment, myServiceAccountId, myOriginalExchangeAppointment));
            var exchangeAppointment = ExchangeRepository.ConvertFromDTO(myAdapterAppointment, myServiceAccountId, myOriginalExchangeAppointment);

            ExchangeAppointment.Set(context, exchangeAppointment);
        }
コード例 #6
0
        public JsonResult VratiRacune()
        {
            var racuni = ExchangeRepository.VratiSveRacuneBlagajne();

            var result = racuni.Select(it => new
            {
                it.SifraValute,
                Stanje = it.Stanje.ToString(CultureInfo.InvariantCulture),
                it.Opis
            }).ToList();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
        protected override void DoExecute(CodeActivityContext context)
        {
            var alsoIncluded = AlsoIncludedAppointments.Get(context);

            devlog.DebugFormat("alsoIncluded.Length:'{0}'", alsoIncluded.Length);
            var newAppsList = new List <Models.ExchangeAppointmentDTO>(ExchangeRepository.New());

            devlog.DebugFormat("newAppsList.Count:'{0}'", newAppsList.Count);
            newAppsList.AddRange(alsoIncluded);
            var newApps = newAppsList.ToArray();

            devlog.DebugFormat("newApps.Length:'{0}'", newApps.Length);
            NewAppointments.Set(context, newApps);
        }
コード例 #8
0
        protected override void DoExecute(CodeActivityContext context)
        {
            var internalId = InternalId.Get(context);

            devlog.DebugFormat("Entered for '{0}'", internalId);
            var found = ExchangeRepository.ExchangeAppointmentByInternalId(internalId);

            try
            {
                ExchangeAppointment.Set(context, found.Value);
                devlog.DebugFormat("found '{0}'", found.Value);
            }
            catch (NullReferenceException)
            {
                ExchangeAppointment.Set(context, null);
                devlog.DebugFormat("found nothing");
            }
        }
コード例 #9
0
ファイル: ExchangeController.cs プロジェクト: alabliuk/B3
        public void ExchangeManager(DateTime begintDate, DateTime endDate)
        {
            new ExchangeMenu().RunExchange($"Start Date: {string.Format("{0:d}", begintDate)} ~ End Data: {string.Format("{0:d}", endDate)}\n\n");

            List <CurrencyItem> cItem = new ExchangeRepository().GetAllCurrenciesObject();

            for (int y = 0; y < cItem.Count; y++)
            {
                CurrencyRate cRate = new CurrencyRate();
                try
                {
                    //RequestApi
                    cRate = GetCurrencyRate(cItem[y].simbolo, begintDate, endDate);
                }
                catch (Exception exReq)
                {
                    new LineColorLine().PrintResult($"{cItem[y].simbolo} - {cItem[y].nomeFormatado}", StatusScreen.Error);
                    new ExceptionRepository().Save($"{cItem[y].simbolo} || Currency Rate Request Error --> {exReq.Message}");
                }

                try
                {
                    if (cRate.value != null)
                    {
                        for (int x = 0; x < cRate.value.Count; x++)
                        {
                            bool isNew = new ExchangeRepository().CurrencyRateIsNew(cRate.value[x], cItem[y].simbolo);
                            if (isNew)
                            {
                                new ExchangeRepository().SaveCurrencyRate(cRate.value[x], cItem[y].simbolo);
                            }
                        }
                    }
                    new LineColorLine().PrintResult($"{cItem[y].simbolo} - {cItem[y].nomeFormatado}", StatusScreen.Success);
                }
                catch (Exception exReqBD)
                {
                    new LineColorLine().PrintResult($"{cItem[y].simbolo} - {cItem[y].nomeFormatado}", StatusScreen.Warning);
                    new ExceptionRepository().Save($"{cItem[y].simbolo} || Currency Rate Repository Error --> {exReqBD.Message}");
                }
            }

            new MainMenu().GoBackMainMenu();
        }
コード例 #10
0
        public JsonResult VratiStorniraneMenjackeTransakcije()
        {
            var transakcije = ExchangeRepository.VratiSveMenjackeTransakcije(true);

            var result = transakcije.Select(it =>
            {
                switch (it.Tip)
                {
                case Models.TipMenjackeTransakcije.Otkup:
                    return(new
                    {
                        it.Id,
                        DatumTransakcije = it.DatumTransakcije.ToString(),
                        Tip = it.Tip.ToString(),
                        Iznos = it.IznosOtkupa.ToString(CultureInfo.InvariantCulture),
                        Valuta = it.SifraValutaOtkupa.ToString()
                    });

                case Models.TipMenjackeTransakcije.Prodaja:
                    return(new
                    {
                        it.Id,
                        DatumTransakcije = it.DatumTransakcije.ToString(),
                        Tip = it.Tip.ToString(),
                        Iznos = it.IznosProdaje.ToString(CultureInfo.InvariantCulture),
                        Valuta = it.SifraValutaProdaje.ToString()
                    });

                case Models.TipMenjackeTransakcije.Konverzija:
                    return(new
                    {
                        it.Id,
                        DatumTransakcije = it.DatumTransakcije.ToString(),
                        Tip = it.Tip.ToString(),
                        Iznos = it.IznosOtkupa.ToString(CultureInfo.InvariantCulture) + "/" + it.IznosProdaje.ToString(CultureInfo.InvariantCulture),
                        Valuta = it.SifraValutaOtkupa.ToString() + "/" + it.SifraValutaProdaje.ToString()
                    });

                default: throw new ArgumentOutOfRangeException();
                }
            }).ToList();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #11
0
ファイル: ExchangeController.cs プロジェクト: alabliuk/B3
        public void UpdateCurrencyList()
        {
            Currency currency = GetCurrencies();

            for (int x = 0; x < currency.value.Count(); x++)
            {
                bool isNew = new ExchangeRepository().CurrencyIsNew(currency.value[x]);
                if (isNew)
                {
                    new ExchangeRepository().SaveCurrency(currency.value[x]);
                }
                else
                {
                    bool isUpdated = new ExchangeRepository().CurrencyIsUpdated(currency.value[x]);
                    if (isUpdated)
                    {
                        CurrencyItem exItem = new ExchangeRepository().GetOld(currency.value[x].simbolo);
                        new ExchangeRepository().SaveUpdateLog(exItem);
                        new ExchangeRepository().UpdateCurrency(currency.value[x]);
                    }
                }
            }
            new ExchangeMenu().RenderCurrencieList($"Updated list at {DateTime.Now}", "R");
        }
コード例 #12
0
ファイル: ImportEmails.cs プロジェクト: niaher/inboxy
        public async Task <Response> Handle(Request message)
        {
            var folder = await this.context.LinkedFolders
                         .Include(t => t.Inbox)
                         .SingleOrExceptionAsync(t => t.Id == message.LinkedFolderId);

            var repository = new ExchangeRepository(folder.Inbox.Email);

            await repository.Initialize(folder.NewItemsFolder, folder.ProcessedItemsFolder);

            var result = await repository.Read(new Paginator
            {
                PageSize  = int.MaxValue,
                PageIndex = 1
            });

            foreach (var item in result.Results)
            {
                var email = new ImportedEmail(folder, item);

                var alreadyAdded = this.context.ImportedEmails.Any(t =>
                                                                   t.LinkedFolderId == folder.Id &&
                                                                   t.MessageId == email.MessageId);

                if (!alreadyAdded)
                {
                    this.context.ImportedEmails.Add(email);
                }
            }

            await this.context.SaveChangesAsync();

            await repository.MoveItemsToProcessedFolder(result.Results.Select(t => t.Id).ToList());

            return(new Response());
        }
コード例 #13
0
 public ExchangeController(ExchangeRepository repository)
 {
     _repository = repository;
 }
コード例 #14
0
 protected override void RepositoryUpload(Models.ServiceAccountDTO myServiceAccount)
 {
     ExchangeRepository.Upload(myServiceAccount);
 }
コード例 #15
0
 public KonverzijaViewModel()
 {
     Valute = ExchangeRepository.VratiSveValute(izuzmiDomacu: true);
 }
コード例 #16
0
ファイル: ImportEmails.cs プロジェクト: niaher/inboxy
 public ImportEmails(ExchangeRepository repository, EmailReaderDbContext context)
 {
     this.repository = repository;
     this.context    = context;
 }
コード例 #17
0
 public UnitOfWork()
 {
     StockExchangeDbContext = new StockExchangeDbContext();
     Stocks    = new StockRepository(StockExchangeDbContext);
     Exchanges = new ExchangeRepository(StockExchangeDbContext);
 }
コード例 #18
0
 public ExchangesController(ExchangeRepository exchange)
 {
     _repo = exchange;
 }
コード例 #19
0
 public OtkupViewModel()
 {
     Valute = ExchangeRepository.VratiSveValute(izuzmiDomacu: true);
 }
コード例 #20
0
 public ExchangeService(ExchangeRepository exchangeRepository)
 {
     _exchangeRepository = exchangeRepository;
 }
コード例 #21
0
 public ExchangeController()
 {
     this.objExchangeRepository = new ExchangeRepository();
 }
コード例 #22
0
 public ExchangeController(ExchangeRepository repo, ILoggingService log)
 {
     this.repo = repo;
     this.log  = log;
 }