Exemplo n.º 1
0
 static void Main(string[] args)
 {
     string conn = ""; //костыль для одноразового запуска
     IExchnageRateRepository _repo = new ExchangeRateRepository(conn);
     Parser p = new Parser();
     var    a = _repo.AddRangeAsync(p.RequestArchive()).Result;
 }
        public JsonResult GetBankData()
        {
            var exchangeRepo = new ExchangeRateRepository();
            var rates        = exchangeRepo.GetActiveBanksRatesByDate(GetTodayDateTime()).Where(i => i.BankId != 99).ToList();

            return(Json(new BankRateModelView()
            {
                Rates = rates, DateControl = DateTime.UtcNow.AddHours(-6).ToString("yyyy-MM-dd HH:mm:ss")
            }));
        }
Exemplo n.º 3
0
        public UnitOfWork(ApplicationDbContext context)
        {
            _context = context;

            Accounts             = new AccountRepository(_context);
            Assets               = new AssetRepository(_context);
            Bonds                = new BondRepository(_context);
            Contacts             = new ContactRepository(_context);
            Partners             = new PartnerRepository(_context);
            Institutions         = new InstitutionRepository(_context);
            Banks                = new InstitutionRepository(_context);
            Currencies           = new CurrencyRepository(_context);
            Countries            = new CountryRepository(_context);
            Messages             = new MessageRepository(_context);
            Portfolios           = new PortfolioRepository(_context);
            Tasks                = new TaskRepository(_context);
            Reports              = new ReportRepository(_context);
            ExchangeRates        = new ExchangeRateRepository(_context);
            Returns              = new ReturnRepository(_context);
            HoldingPeriodReturns = new ReturnRepository(_context);
            TileWidgets          = new TileWidgetRepository(_context);
        }
Exemplo n.º 4
0
 public static void UpdateExchangeRateHistory()
 {
     try
     {
         TimeSpan ts = TimeSpan.Parse(AppSettings.CustomerCurrency);
         Time = TimeSpan.Parse(DateTime.Now.ToString("HH:mm"));
         if (Time >= ts)
         {
             FrayteStatus mailstatus = new ExchangeRateRepository().ExchangeRateHistoryUpdateStatus();
             if (mailstatus.HistoryStatus == false)
             {
                 new ExchangeRateRepository().SaveExchnageRateHistory();
             }
         }
     }
     catch (Exception ex)
     {
         Logger _log = Get_Log();
         _log.Info("Error due to update exchange rate");
         _log.Error(ex);
     }
 }
        public JsonResult GetBancoCentral()
        {
            var exchangeRepo = new ExchangeRateRepository();

            return(Json(exchangeRepo.GetCentralBankRate(GetTodayDateTime())));
        }
Exemplo n.º 6
0
        public static void SendFuelSurchargeAndCurrencyEmail()
        {
            try
            {
                TimeSpan ts  = TimeSpan.Parse(AppSettings.FuelSurCharge);
                TimeSpan ts1 = TimeSpan.Parse(AppSettings.CustomerCurrency);
                Time    = TimeSpan.Parse(DateTime.Now.ToString("HH:mm"));
                current = Frayte.Services.CommonConversion.ConvertToDateTime(DateTime.UtcNow.ToString("MM/dd/yyyy"));
                DateTime comparedate = Frayte.Services.CommonConversion.ConvertToDateTime(DateTime.UtcNow.Month + "/23/" + DateTime.UtcNow.Year);

                for (int i = 1; i < 3; i++)
                {
                    FrayteStatus mailstatus = new FuelSurChargeRepository().GetSendMailStatus(DateTime.UtcNow, i);
                    var          setting    = new ReportSettingRepository().GetAllUserDetail();
                    if (setting != null)
                    {
                        foreach (var status in setting)
                        {
                            if (status.IsFuelSurCharge == true)
                            {
                                if (Time >= ts && comparedate == current)
                                {
                                    if (mailstatus.FuelMailSentOn != current)
                                    {
                                        if (i == 1)
                                        {
                                            FrayteStatus updatestatus = new FuelSurChargeRepository().UpdateStatus(DateTime.UtcNow, i);
                                            if (updatestatus.IsFuelSurCharge == false)
                                            {
                                                new ReportSettingRepository().FuelSurChargeSendEmail(status.Email, Frayte.Schedular.Utility.AppSettings.HKEmail, status.UserName, "", i);
                                            }
                                        }
                                        else if (i == 2)
                                        {
                                            FrayteStatus updatestatus = new FuelSurChargeRepository().UpdateStatus(DateTime.UtcNow, i);
                                            if (updatestatus.IsFuelSurCharge == false)
                                            {
                                                new ReportSettingRepository().FuelSurChargeSendEmail(status.Email, Frayte.Schedular.Utility.AppSettings.UKEmail, status.UserName, "", i);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                for (int j = 1; j < 3; j++)
                {
                    FrayteStatus mailstatus = new ExchangeRateRepository().GetSendMailStatus(j);
                    var          setting    = new ReportSettingRepository().GetAllUserDetail();
                    if (setting != null)
                    {
                        foreach (var status in setting)
                        {
                            if (status.IsCurrecy == true)
                            {
                                if (Time >= ts1)
                                {
                                    if (j == 1)
                                    {
                                        if (mailstatus.CurrencyMailSentOn != current)
                                        {
                                            new ReportSettingRepository().ExchangeRateSendEmail(status.Email, "", status.UserName, "", j);
                                        }
                                    }
                                    else if (j == 2)
                                    {
                                        if (mailstatus.CurrencyMailSentOn != current)
                                        {
                                            new ReportSettingRepository().ExchangeRateSendEmail(status.Email, "", status.UserName, "", j);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger _log = Get_Log();
                _log.Info("Error due to fuel sur charge and exchange rate");
                _log.Error(ex);
            }
        }
Exemplo n.º 7
0
        public List <FrayteExchangeRateHistory> ExchangeRateHistory(FrayteSearchExchangeHistory search)
        {
            List <FrayteExchangeRateHistory> _rate = new ExchangeRateRepository().GetExchangeRateHistory(search);

            return(_rate);
        }
Exemplo n.º 8
0
        public List <FrayteExchangeMonth> DistinctMonth(int OperationZoneId, string Type)
        {
            List <FrayteExchangeMonth> _month = new ExchangeRateRepository().GetDistinctMonth(OperationZoneId, Type);

            return(_month);
        }
Exemplo n.º 9
0
        public List <int> DistinctYear(int OperationZoneId, string Type)
        {
            List <int> _year = new ExchangeRateRepository().GetDistinctYear(OperationZoneId, Type);

            return(_year);
        }
Exemplo n.º 10
0
        public List <CurrencyType> GetCurrencyDetail()
        {
            var list = new ExchangeRateRepository().GetCurrency();

            return(list);
        }
Exemplo n.º 11
0
        public List <FrayteExchangeRate> GetOperationExchangeRate(int operationZoneId)
        {
            var list = new ExchangeRateRepository().GetOperationExchangeRateDetail(operationZoneId);

            return(list);
        }