private async Task OpenFileAsync(DavItem item) { try { var tokenSource = new CancellationTokenSource(); var button = new Button(); button.Content = App.ResourceLoader.GetString("Cancel"); button.HorizontalAlignment = HorizontalAlignment.Center; button.Command = new DelegateCommand(() => { tokenSource.Cancel(false); IndicatorService.GetDefault().HideBar(); }); var progress = new Progress <HttpProgress>(async httpProgress => { await Dispatcher.DispatchAsync(() => { var text = string.Format(App.ResourceLoader.GetString("DownloadingFile"), item.DisplayName); text += " - " + new ProgressToPercentConverter().Convert(httpProgress, null, null, null); IndicatorService.GetDefault().ShowBar(text, button); }); }); var file = await WebDavItemService.GetDefault().DownloadAsync(item, ApplicationData.Current.TemporaryFolder, tokenSource.Token, progress); if (!tokenSource.IsCancellationRequested) { await Launcher.LaunchFileAsync(file); } } finally { IndicatorService.GetDefault().HideBar(); } }
private async Task Move() { try { IndicatorService.GetDefault().ShowBar(); foreach (var davItem in _itemsToMove) { await WebDavItemService.GetDefault().MoveToFolder(davItem, WebDavNavigationService.CurrentItem); } } finally { IndicatorService.GetDefault().HideBar(); await WebDavNavigationService.ReloadAsync(); await NavigationService.NavigateAsync(typeof(FilesPage), WebDavNavigationService.CurrentItem, new SuppressNavigationTransitionInfo()); } for (int i = 0; i < NavigationService.Frame.BackStackDepth; i++) { if (NavigationService.Frame.BackStack[i].SourcePageType == typeof(SelectFolderPage)) { NavigationService.Frame.BackStack.RemoveAt(i); } } }
private void indicatorSelectionNext_Click(object sender, EventArgs e) { /* * Order of indicators in the combobox. * 0- Moving Average * 1- Moving Average Convergence Divergence * 2- Relative Strength Index * 3- Stochastics * 4- Williams' %R */ MapReduceAllowed = mapReduceCheck.Checked; NumberOfData = (int)numberOfDataSelector.Value; switch (indicatorSelectionComboBox.SelectedIndex) { case 0: mavParamaterTitle.Text = Code + " için Moving Average periyodunu giriniz."; mavPeriod.Maximum = IndicatorService.DataCount(Code, TargetDate); mavPeriod.Value = Math.Min(15, mavPeriod.Maximum); mavParameterPanel.BringToFront(); break; case 1: macdParameterTitle.Text = Code + " için Moving Average Convergence Divergence parametrelerini giriniz."; secondPeriod.Maximum = IndicatorService.DataCount(Code, TargetDate); firstPeriod.Maximum = secondPeriod.Maximum - 1; triggerPeriod.Maximum = firstPeriod.Maximum - 1; firstPeriod.Value = Math.Min(12, firstPeriod.Maximum); secondPeriod.Value = Math.Min(26, secondPeriod.Maximum); triggerPeriod.Value = Math.Min(9, triggerPeriod.Maximum); macdParameterPanel.BringToFront(); break; case 2: rsiParameterTitle.Text = Code + " için Relative Strength Index periyodunu giriniz."; rsiPeriod.Maximum = IndicatorService.DataCount(Code, TargetDate); rsiPeriod.Value = Math.Min(15, rsiPeriod.Maximum); rsiParameterPanel.BringToFront(); break; case 3: stochasticsParameterTitle.Text = Code + " için Stochastics Index parametrelerini giriniz."; fastKPeriod.Maximum = IndicatorService.DataCount(Code, TargetDate); fastKPeriod.Value = Math.Min(14, fastKPeriod.Maximum); fastDPeriod.Maximum = fastKPeriod.Maximum - 1; fastDPeriod.Value = Math.Min(3, fastDPeriod.Maximum); slowDPeriod.Maximum = fastDPeriod.Maximum - 1; slowDPeriod.Value = Math.Min(3, slowDPeriod.Maximum); stochasticsParameterPanel.BringToFront(); break; case 4: williamsRParameterTitle.Text = Code + " için Williams' %R periyodunu giriniz."; williamsRPeriod.Maximum = IndicatorService.DataCount(Code, TargetDate); williamsRPeriod.Value = Math.Min(15, williamsRPeriod.Maximum); williamsRParameterPanel.BringToFront(); break; } }
private async Task CreateFolderAsync() { var dialog = new ContentDialog(); dialog.Title = App.ResourceLoader.GetString("CreateNewFolder"); var box = new TextBox() { Header = App.ResourceLoader.GetString("FolderName"), AcceptsReturn = false, SelectedText = App.ResourceLoader.GetString("NewFolderName") }; dialog.Content = box; dialog.PrimaryButtonText = App.ResourceLoader.GetString("OK"); dialog.SecondaryButtonText = App.ResourceLoader.GetString("Cancel"); var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary) { IndicatorService.GetDefault().ShowBar(); await WebDavItemService.GetDefault().CreateFolder(WebDavNavigationService.CurrentItem, box.Text); await WebDavNavigationService.ReloadAsync(); IndicatorService.GetDefault().HideBar(); } }
public ActionResult NewIndicatorCategoryLabel(IndicatorCategoryLabel item) { IndicatorService IService = new IndicatorService(); IService.InsertIndicatorCategoryLabel(item); return(RedirectToAction("Edit", new { id = item.GrantTypeCodeID })); }
public ActionResult EditIndicatorLabel(IndicatorLabel item) { IndicatorService IService = new IndicatorService(); IService.UpdateIndicatorLabel(item); return(RedirectToAction("Edit", new { id = item.GrantTypeCodeID })); }
public ActionResult DeleteIndicatorLabel(int id, int grantid) { IndicatorService IService = new IndicatorService(); IService.DeleteIndicatorLabel(id); return(RedirectToAction("Edit", new { id = grantid })); }//
private void williamsRParameterNext_Click(object sender, EventArgs e) { williamsRResultTitle.Text = Code + " için Williams' %R sonucu"; WilliamsRPeriod = (int)williamsRPeriod.Value; williamsRCloseChart.Series.Clear(); williamsRIndicatorChart.Series.Clear(); var closeSeries = new Series { Name = "Kapanış", Color = System.Drawing.Color.Black, ChartType = SeriesChartType.Line }; var wsrSeries = new Series { Name = "Williams' R", Color = System.Drawing.Color.Blue, ChartType = SeriesChartType.Line }; williamsRCloseChart.Series.Add(closeSeries); williamsRIndicatorChart.Series.Add(wsrSeries); var closeData = IndicatorService.GetData(Code, TargetDate, new string[] { "Tarih", "Kapanis" }, NumberOfData); DateTime date; double[] wsr; if (MapReduceAllowed) { wsr = WilliamsR.WsrMR(Code, TargetDate, WilliamsRPeriod, NumberOfData); } else { wsr = WilliamsR.Wsr(Code, TargetDate, WilliamsRPeriod, NumberOfData); } for (int i = 0; i < wsr.Length; i++) { var close = closeData.ElementAt(i); date = close.GetElement("Tarih").Value.AsBsonDateTime.ToLocalTime(); closeSeries.Points.AddXY(date, close.GetElement("Kapanis").Value.ToDouble()); wsrSeries.Points.AddXY(date, wsr[i]); } williamsRCloseChart.ChartAreas[0].AxisY.Minimum = Math.Floor(closeData.Select(p => p.GetElement("Kapanis").Value.ToDouble()).Min()); williamsRCloseChart.ChartAreas[0].AxisY.Maximum = Math.Ceiling(closeData.Select(p => p.GetElement("Kapanis").Value.ToDouble()).Max()); williamsRIndicatorChart.ChartAreas[0].AxisY.Minimum = -100; williamsRIndicatorChart.ChartAreas[0].AxisY.Maximum = 0; williamsRCloseChart.Invalidate(); williamsRIndicatorChart.Invalidate(); williamsRResultPanel.BringToFront(); }
private async Task GetIndicatorsSvcAsync() { var indicatorsService = new IndicatorService(); var indicatorsList = await indicatorsService.GetCountryIndicatorsAsync("mexico"); gvIndicators.DataSource = indicatorsList; gvIndicators.DataBind(); }
public ActionResult EditIndicatorCategoryLabel(int id, int grantid) { IndicatorService ins = new IndicatorService(); IndicatorCategoryLabel m = ins.GetIndicatorCategoryLabel(id); ViewData["grantid"] = grantid; return(View(m)); }
// public ActionResult EditIndicatorLabel(int id, int grantid) { IndicatorService IService = new IndicatorService(); IndicatorLabel ilabel = IService.GetIndicatorLabel(id); ViewData["grantid"] = grantid; return(View(ilabel)); }
public ActionResult DeleteIndicatorTemplateItem(int id, int grantid) { IndicatorService ins = new IndicatorService(); ins.DeleteIndicatorTemplateItem(id); return(RedirectToAction("Edit", new { id = grantid })); }
private void rsiParameterNext_Click(object sender, EventArgs e) { rsiResultTitle.Text = Code + " için Relative Strength Index sonucu"; RSIPeriod = (int)rsiPeriod.Value; rsiDataResultChart.Series.Clear(); rsiIndicatorResultChart.Series.Clear(); var closeSeries = new Series { Name = "Kapanış", Color = System.Drawing.Color.Black, ChartType = SeriesChartType.Line }; var rsiSeries = new Series { Name = "Relative Strength Index", Color = System.Drawing.Color.Blue, ChartType = SeriesChartType.Line }; rsiDataResultChart.Series.Add(closeSeries); rsiIndicatorResultChart.Series.Add(rsiSeries); var closeData = IndicatorService.GetData(Code, TargetDate, new string[] { "Tarih", "Kapanis" }, NumberOfData); double[] rsi; if (MapReduceAllowed) { rsi = RelativeStrengthIndex.RsiMR(Code, TargetDate, RSIPeriod, NumberOfData); } else { rsi = RelativeStrengthIndex.Rsi(Code, TargetDate, RSIPeriod, NumberOfData); } DateTime date; for (int i = 0; i < rsi.Length; i++) { var close = closeData.ElementAt(i); date = close.GetElement("Tarih").Value.AsBsonDateTime.ToLocalTime(); closeSeries.Points.AddXY(date, close.GetElement("Kapanis").Value.ToDouble()); rsiSeries.Points.AddXY(date, rsi[i]); } rsiDataResultChart.ChartAreas[0].AxisY.Minimum = Math.Floor(closeData.Select(p => p.GetElement("Kapanis").Value.ToDouble()).Min()); rsiDataResultChart.ChartAreas[0].AxisY.Maximum = Math.Ceiling(closeData.Select(p => p.GetElement("Kapanis").Value.ToDouble()).Max()); rsiIndicatorResultChart.ChartAreas[0].AxisY.Minimum = 0; rsiIndicatorResultChart.ChartAreas[0].AxisY.Maximum = 100; rsiDataResultChart.Invalidate(); rsiIndicatorResultChart.Invalidate(); rsiResultPanel.BringToFront(); }
private async Task DownloadFilesAsync(List <DavItem> files) { FolderPicker picker = new FolderPicker(); picker.FileTypeFilter.Add("."); picker.SuggestedStartLocation = PickerLocationId.Downloads; var folder = await picker.PickSingleFolderAsync(); _tokenSource = new CancellationTokenSource(); var button = new Button(); button.Content = App.ResourceLoader.GetString("Cancel"); button.HorizontalAlignment = HorizontalAlignment.Center; button.Command = new DelegateCommand(() => { _tokenSource.Cancel(false); IndicatorService.GetDefault().HideBar(); }); _executionSession = await RequestExtendedExecutionAsync(); try { foreach (var fileToDownload in files) { if (_tokenSource.IsCancellationRequested) { IndicatorService.GetDefault().HideBar(); SelectionMode = ListViewSelectionMode.Single; return; } var progress = new Progress <HttpProgress>(async httpProgress => { if (_tokenSource.IsCancellationRequested) { return; } await Dispatcher.DispatchAsync(() => { var text = string.Format(App.ResourceLoader.GetString("DownloadingFile"), fileToDownload.DisplayName); text += Environment.NewLine + new BytesToSuffixConverter().Convert(httpProgress.BytesReceived, null, null, null) + " - " + new ProgressToPercentConverter().Convert(httpProgress, null, null, null); IndicatorService.GetDefault().ShowBar(text, button); }); if (httpProgress.BytesReceived == httpProgress.TotalBytesToReceive && files.Count - 1 == files.IndexOf(fileToDownload)) { IndicatorService.GetDefault().HideBar(); SelectionMode = ListViewSelectionMode.Single; } }); await WebDavItemService.GetDefault().DownloadAsync(fileToDownload, folder, _tokenSource.Token, progress); } _tokenSource.Cancel(); } finally { ClearExecutionSession(_executionSession); IndicatorService.GetDefault().HideBar(); } }
private async Task Connect() { IndicatorService.GetDefault().ShowBar(); try { await CheckServerStatus(); if (_serverFound) { OcsClient client = new OcsClient(new Uri(_serverUrl), new NetworkCredential(_userName, _password)); var status = await client.CheckUserLoginAsync(); if (status == HttpStatusCode.Ok) { Configuration.ServerUrl = OcsClient.GetWebDavUrl(_serverUrl); Configuration.Password = _password; Configuration.UserName = _userName; Configuration.IsFirstRun = false; Shell.HamburgerMenu.IsFullScreen = false; await NavigationService.NavigateAsync(typeof(FilesPage)); NavigationService.ClearHistory(); } else { string message = status.ToString(); if (status == HttpStatusCode.Unauthorized) { message = App.ResourceLoader.GetString("LoginFailed"); } MessageDialog dialog = new MessageDialog(message); dialog.Title = "ownCloud"; await dialog.ShowAsync(); } } else { ResponseCode = App.ResourceLoader.GetString("ServerNotFound"); MessageDialog dialog = new MessageDialog(ResponseCode); await dialog.ShowAsync(); } } catch (Exception e) { if ((uint)e.HResult == 0x80072EE7) { ResponseCode = App.ResourceLoader.GetString("ServerNotFound"); } else { MessageDialog dialog = new MessageDialog(e.Message); dialog.Title = "ownCloud"; await dialog.ShowAsync(); } } IndicatorService.GetDefault().HideBar(); }
private async Task UploadFilesAsync() { FileOpenPicker picker = new FileOpenPicker(); picker.FileTypeFilter.Add("*"); picker.SuggestedStartLocation = PickerLocationId.ComputerFolder; var files = await picker.PickMultipleFilesAsync(); _tokenSource = new CancellationTokenSource(); var button = new Button(); button.Content = App.ResourceLoader.GetString("Cancel"); button.HorizontalAlignment = HorizontalAlignment.Center; button.Command = new DelegateCommand(() => { _tokenSource.Cancel(false); IndicatorService.GetDefault().HideBar(); }); _executionSession = await RequestExtendedExecutionAsync(); try { foreach (var file in files) { if (!_tokenSource.IsCancellationRequested) { var progress = new Progress <HttpProgress>(async httpProgress => { if (_tokenSource.IsCancellationRequested) { return; } await Dispatcher.DispatchAsync(() => { var text = string.Format(App.ResourceLoader.GetString("UploadingFile"), file.DisplayName); text += Environment.NewLine + new BytesToSuffixConverter().Convert(httpProgress.BytesSent, null, null, null) + " - " + new ProgressToPercentConverter().Convert(httpProgress, null, null, null); IndicatorService.GetDefault().ShowBar(text, button); if (httpProgress.BytesSent == httpProgress.TotalBytesToSend && files.Count - 1 == files.ToList().IndexOf(file)) { IndicatorService.GetDefault().HideBar(); SelectionMode = ListViewSelectionMode.Single; } }); }); await WebDavItemService.GetDefault().UploadAsync(WebDavNavigationService.CurrentItem, file, _tokenSource.Token, progress); } } } catch (TaskCanceledException) { } finally { ClearExecutionSession(_executionSession); IndicatorService.GetDefault().HideBar(); await WebDavNavigationService.ReloadAsync(); } }
public ActionResult Edit(int id) { IndicatorService ins = new IndicatorService(); ViewData["IndicatorLabels"] = ins.GetIndicatorLabels(id); ViewData["IndicatorCategoryLabels"] = ins.GetIndicatorCategoryLabels(id); ViewData["grantid"] = id; return(View()); }
public ActionResult NewIndicatorTemplateItem(int ddlIndicator, int ddlCategory, int GrantTypeCodeID) { IndicatorService ins = new IndicatorService(); IndicatorTemplateItem item = new IndicatorTemplateItem(); item.IndicatorLabelID = ddlIndicator; item.IndicatorCategoryLabelID = ddlCategory; ins.InsertIndicatorTemplateItem(item); return(RedirectToAction("Edit", new { id = GrantTypeCodeID })); }
private static void ExportFeaturesAndLabel(string code) { string filePath = (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) ? Environment.GetEnvironmentVariable("HOME") : Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%"); filePath += "\\indicatorOutput.txt"; DateTime targetDate = IndicatorService.LastDate(code); int numberOfData = 4000; var data = IndicatorService.GetData(code, targetDate, new string[] { "Tarih", "Kapanis" }, numberOfData + 1); double[] sma = MovingAverage.Simple(code, targetDate, 14, numberOfData); double[] wma = MovingAverage.Weighted(code, targetDate, 14, numberOfData); double[] ema = MovingAverage.Exponential(code, targetDate, 14, numberOfData); MovingAverageConvergenceDivergence macd = new MovingAverageConvergenceDivergence(code, targetDate, 12, 26, 9, numberOfData); double[] rsi = RelativeStrengthIndex.Rsi(code, targetDate, 14, numberOfData); double[] williams = WilliamsR.Wsr(code, targetDate, 14, numberOfData); Stochastics stochastics = new Stochastics(code, targetDate, 14, 3, 3, numberOfData); double[] closesOut = IndicatorDataPreprocessor.GetClosesOut(numberOfData, data); double[] smaOut = IndicatorDataPreprocessor.GetSMAOut(sma); double[] wmaOut = IndicatorDataPreprocessor.GetWMAOut(wma); double[] emaOut = IndicatorDataPreprocessor.GetEMAOut(ema); double[] macdOut = IndicatorDataPreprocessor.GetMACDOut(macd); double[] rsiOut = IndicatorDataPreprocessor.GetRSIOut(rsi); double[] williamsROut = IndicatorDataPreprocessor.GetWilliamsROut(williams); double[] stochasticsOut = IndicatorDataPreprocessor.GetStochasticsOut(stochastics); int minRowCount; minRowCount = smaOut.Length; minRowCount = minRowCount < wmaOut.Length ? minRowCount : wmaOut.Length; minRowCount = minRowCount < emaOut.Length ? minRowCount : emaOut.Length; minRowCount = minRowCount < macdOut.Length ? minRowCount : macdOut.Length; minRowCount = minRowCount < rsiOut.Length ? minRowCount : rsiOut.Length; minRowCount = minRowCount < williamsROut.Length ? minRowCount : williamsROut.Length; minRowCount = minRowCount < stochasticsOut.Length ? minRowCount : stochasticsOut.Length; minRowCount = minRowCount < closesOut.Length ? minRowCount : closesOut.Length; FeatureVector vector = new FeatureVector(); vector.AddColumn("SMA", smaOut.Select(p => (object)p.ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); vector.AddColumn("WMA", wmaOut.Select(p => (object)p.ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); vector.AddColumn("EMA", emaOut.Select(p => (object)p.ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); vector.AddColumn("MACD", macdOut.Select(p => (object)p.ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); vector.AddColumn("RSI", rsiOut.Select(p => (object)p.ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); vector.AddColumn("WilliamsR", williamsROut.Select(p => (object)p.ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); vector.AddColumn("Stochastics", stochasticsOut.Select(p => (object)p.ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); vector.AddColumn("label", closesOut.Select(p => (object)string.Format("{0:0.0}", p).ToString(CultureInfo.InvariantCulture)).Take(minRowCount).ToArray()); new CSVExporter(vector).Export(filePath); Console.WriteLine("Operations completed."); }
public ActionResult Indicator() { IndicatorService InSer = new IndicatorService(); IEnumerable <IndicatorCategoryLabel> ICL = InSer.GetIndicatorCategoryLabelsAll(); ViewData["ICL"] = ICL; IEnumerable <IndicatorLabel> IL = InSer.GetIndicatorLabelsAll(); ViewData["IL"] = IL; return(View()); }
public static string GetScoreName(this int score, int indicatorId) { IndicatorService indicatorService = new IndicatorService(new IndicatorRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); return(indicatorService.Get(x => x.Id == indicatorId).Scores.OrderBy(s => s.Point) .FirstOrDefault(s => s.Point >= score) ?.Name); //var scoreService = new ScoreService(new ScoreRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); //return scoreService.Get(x => x.Id == scoreId.Value).Name; }
private void View_Load(object sender, EventArgs e) { this.Location = new Point(20, 20); this.FormBorderStyle = FormBorderStyle.FixedSingle; this.MaximizeBox = false; codeSelectionPanel.BringToFront(); /* Load codes to the combobox. */ codeSelectionComboBox.Items.AddRange(IndicatorService.GetCodeList().Select(p => p.GetElement(0).Value.ToString()).OrderBy(p => p).ToArray()); codeSelectionComboBox.SelectedIndex = 0; indicatorSelectionComboBox.SelectedIndex = 0; }
private void View_Load(object sender, EventArgs e) { Location = new Point(200, 200); FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; panelForCodeSelection.BringToFront(); comboBoxForCodeSelection.Items.AddRange(IndicatorService.GetCodeList().Select(p => p.GetElement(0).Value.ToString()).OrderBy(p => p).ToArray()); comboBoxForCodeSelection.SelectedIndex = 0; numericUpDownForNumberOfData.Minimum = 1; numericUpDownForNumberOfData.Maximum = 1000; numericUpDownForNumberOfData.Value = 300; }
public ActionResult Edit(int id) { IndicatorService ins = new IndicatorService(); IEnumerable <IndicatorCategoryLabel> m = ins.GetIndicatorTemplateCategories(id); SelectList ddlIndicator = new SelectList(ins.GetIndicatorLabels(id), "IndicatorLabelID", "Text"); ViewData["ddlIndicator"] = ddlIndicator; SelectList ddlCategory = new SelectList(ins.GetIndicatorCategoryLabels(id), "IndicatorCategoryLabelID", "Text"); ViewData["ddlCategory"] = ddlCategory; ViewData["GrantTypeCodeID"] = id; ViewData["grantid"] = id; return(View(m)); }
protected void Application_BeginRequest(object sender, EventArgs e) { Response.Headers.Remove("Server"); Response.Headers.Remove("X-Powered-By"); Response.Headers.Remove("X-AspNet-Version"); Response.Headers.Remove("X-AspNetMvc-Version"); HttpContextBase currentContext = new HttpContextWrapper(HttpContext.Current); if (currentContext.Request.Params.AllKeys.Contains("ReturnUrl")) { Response.Redirect("~/Pages/Login"); } if (HttpContext.Current.Cache["ScheduleItem_1"] == null)//(HttpContext.Current.Request.Url.ToString() == WebConfigurationManager.AppSettings["BaseURL"] + "/Pages/SystemManagement/StartService") { RegisterCacheEntry(); } if (HttpContext.Current.Cache["IsRun"] == null) { var _scheduleService = new ScheduleService(new ScheduleRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _termService = new TermService(new TermRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _mappingService = new MappingService(new MappingRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _collegeService = new CollegeService(new CollegeRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _educationalGroupService = new EducationalGroupService(new EducationalGroupRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _professorService = new ProfessorService(new ProfessorRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _educationalClassService = new EducationalClassService(new EducationalClassRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _studentEducationalClassService = new StudentEducationalClassService(new StudentEducationalClassRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _professorScoreService = new ProfessorScoreService(new ProfessorScoreRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _indicatorService = new IndicatorService(new IndicatorRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _mappingTypeService = new MappingTypeService(new MappingTypeRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _universityLevelMappingService = new UniversityLevelMappingService(new UniversityLevelMappingRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _educationalGroupScoreService = new EducationalGroupScoreService(new EducationalGroupScoreRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _logService = new LogService(new LogRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _logTypeService = new LogTypeService(new LogTypeRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _userService = new UserService(new UserRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var schedule = new ScheduleController(_scheduleService, _termService, _mappingService, _collegeService, _educationalGroupService , _professorService, _educationalClassService, _studentEducationalClassService, _professorScoreService, _indicatorService, _mappingTypeService , _universityLevelMappingService, _educationalGroupScoreService, _logService, _logTypeService, _userService); var schedules = schedule.ListAllSchedules(); foreach (var scheduleItem in schedules) { CheckScheduleTimeLapse("ScheduleItem_" + scheduleItem.Id); } } }
private async Task DeleteItems(List <DavItem> items) { ContentDialog dialog = new ContentDialog(); if (items.Count == 1) { var item = items.First(); dialog.Title = App.ResourceLoader.GetString("deleteFileConfirmation"); if (item.IsCollection) { dialog.Title = App.ResourceLoader.GetString("deleteFolderConfirmation"); } dialog.Content = item.DisplayName; } else { dialog.Title = App.ResourceLoader.GetString("deleteMultipleConfirmation"); int i = 0; foreach (var item in items) { if (i < 3) { dialog.Content += item.DisplayName + Environment.NewLine; i++; } else { dialog.Content += "..."; break; } } } dialog.PrimaryButtonText = App.ResourceLoader.GetString("yes"); dialog.SecondaryButtonText = App.ResourceLoader.GetString("no"); var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary) { IndicatorService.GetDefault().ShowBar(); await WebDavItemService.GetDefault().DeleteItemAsync(items.Cast <DavItem>().ToList()); SelectionMode = ListViewSelectionMode.Single; await WebDavNavigationService.ReloadAsync(); IndicatorService.GetDefault().HideBar(); } }
public MainJob( CurrencyService currencyService, IndicatorService indicatorService, LineService lineService, WatcherService watcherService, OrderService orderService, NotificationService notificationService, ILogger <MainJob> logger) { _currencyService = currencyService; _indicatorService = indicatorService; _lineService = lineService; _watcherService = watcherService; _orderService = orderService; _notificationService = notificationService; _logger = logger; }
private bool RegisterCacheEntry() { var _scheduleService = new ScheduleService(new ScheduleRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _termService = new TermService(new TermRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _mappingService = new MappingService(new MappingRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _collegeService = new CollegeService(new CollegeRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _educationalGroupService = new EducationalGroupService(new EducationalGroupRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _professorService = new ProfessorService(new ProfessorRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _educationalClassService = new EducationalClassService(new EducationalClassRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _studentEducationalClassService = new StudentEducationalClassService(new StudentEducationalClassRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _professorScoreService = new ProfessorScoreService(new ProfessorScoreRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _indicatorService = new IndicatorService(new IndicatorRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _mappingTypeService = new MappingTypeService(new MappingTypeRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _universityLevelMappingService = new UniversityLevelMappingService(new UniversityLevelMappingRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _educationalGroupScoreService = new EducationalGroupScoreService(new EducationalGroupScoreRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _logService = new LogService(new LogRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _logTypeService = new LogTypeService(new LogTypeRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var _userService = new UserService(new UserRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var schedule = new ScheduleController(_scheduleService, _termService, _mappingService, _collegeService, _educationalGroupService , _professorService, _educationalClassService, _studentEducationalClassService, _professorScoreService, _indicatorService, _mappingTypeService , _universityLevelMappingService, _educationalGroupScoreService, _logService, _logTypeService, _userService); if (HttpContext.Current.Cache["IsRun"] == null) { HttpContext.Current.Cache.Add("IsRun", "True", null, DateTime.MaxValue, Cache.NoSlidingExpiration, CacheItemPriority.Normal, null); } var schedules = schedule.ListAllSchedules(); foreach (var scheduleItem in schedules) { if (null != HttpContext.Current.Cache["ScheduleItem_" + scheduleItem.Id]) { return(false); } HttpContext.Current.Cache.Add("ScheduleItem_" + scheduleItem.Id, "Test", null, DateTime.MaxValue, TimeSpan.FromMinutes(2), CacheItemPriority.Normal, new CacheItemRemovedCallback(CacheItemRemovedCallback)); } return(true); }
public static string GetScoreName(this int score, int indicatorId, string professorCode, int termId) { var psCode = Convert.ToInt32(professorCode); if (indicatorId != 4) { IndicatorService indicatorService = new IndicatorService(new IndicatorRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); return(indicatorService.Get(x => x.Id == indicatorId).Scores.OrderBy(s => s.Point) .FirstOrDefault(s => s.Point >= score) ?.Name); } else { var ps = new ProfessorService(new ProfessorRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var universityStudyPlace = ps.Get(x => x.ProfessorCode == psCode && x.Term.Id == termId).UniversityStudyPlace; var ss = new ScoreService(new ScoreRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); var ulm = new UniversityLevelMappingService(new UniversityLevelMappingRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); if (universityStudyPlace != null && universityStudyPlace > 0) { var scoreId = ulm.Get(x => x.UniversityId == universityStudyPlace).Score.Id; var score1 = ss.Get(x => x.Id == scoreId); if (score1 != null) { return(score1.Name); } else { return(string.Empty); } } else { return(string.Empty); } } //var scoreService = new ScoreService(new ScoreRepository(new DatabaseFactory()), new UnitOfWork(new DatabaseFactory())); //return scoreService.Get(x => x.Id == scoreId.Value).Name; }
/// <summary> /// 调用控件线程方法 /// </summary> /// <param name="args">参数</param> public void OnInvoke(object args) { CMessage message = (CMessage)args; List <Indicator> indicators = new List <Indicator>(); IndicatorService.GetIndicators(indicators, message.m_body, message.m_bodyLength); int indicatorsSize = indicators.Count; switch (message.m_functionID) { case IndicatorServiceEx.FUNCTIONID_INDICATOR_ADDINDICATORS: AddIndicatorsToTree(indicators); break; case IndicatorServiceEx.FUNCTIONID_INDICATOR_DELETEINDICATORS: { Dictionary <String, TreeNodeA> indicatorNodes = GetIndicatorsNodes(); m_indicator = new Indicator(); for (int i = 0; i < indicatorsSize; i++) { Indicator indicator = indicators[i]; if (indicatorNodes.ContainsKey(indicator.m_indicatorID)) { m_tvList.RemoveNode(indicatorNodes[indicator.m_indicatorID]); } } break; } case IndicatorServiceEx.FUNCTIONID_INDICATOR_UPDATEINDICATORS: { Dictionary <String, TreeNodeA> indicatorNodes = GetIndicatorsNodes(); for (int i = 0; i < indicatorsSize; i++) { Indicator indicator = indicators[i]; if (indicatorNodes.ContainsKey(indicator.m_indicatorID)) { indicatorNodes[indicator.m_indicatorID].Text = indicator.m_description; } } break; } } m_window.Invalidate(); }