Alla aktier + uppdattimes

This commit is contained in:
2021-02-08 00:01:39 +01:00
parent f51d6e9689
commit e4fee01015
5 changed files with 78 additions and 8 deletions

View File

@ -1,4 +1,5 @@
using Autofac;
using Microsoft.Extensions.Configuration;
using StockDal;
using StockDal.Interface;
using System;
@ -22,7 +23,7 @@ namespace RepositoryPattern
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Container = Configure();
Application.Run(new frmInitial(Container.Resolve<IProductRepository>(),Container.Resolve<IStockMemberRepository>(),Container.Resolve<IStockMarketRepository>()));
Application.Run(new frmInitial(Container.Resolve<IProductRepository>(), Container.Resolve<IStockMemberRepository>(), Container.Resolve<IStockMarketRepository>()));
}
/// <summary>
/// Setting dependency injection

View File

@ -10,6 +10,11 @@
<PackageReference Include="Autofac" Version="6.1.0" />
<PackageReference Include="Dapper" Version="2.0.78" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.29" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="87.0.4280.8800" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
</ItemGroup>
@ -20,4 +25,10 @@
<ProjectReference Include="..\StockDomain\StockDomain.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="App.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -49,6 +49,8 @@ namespace RepositoryPattern
this.txtCurrValue = new System.Windows.Forms.TextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.chkAutoReload = new System.Windows.Forms.CheckBox();
this.lbUpdateTimes = new System.Windows.Forms.ListBox();
this.label4 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lvMyStocks
@ -205,11 +207,31 @@ namespace RepositoryPattern
this.chkAutoReload.UseVisualStyleBackColor = true;
this.chkAutoReload.CheckedChanged += new System.EventHandler(this.chkAutoReload_CheckedChanged);
//
// lbUpdateTimes
//
this.lbUpdateTimes.FormattingEnabled = true;
this.lbUpdateTimes.ItemHeight = 15;
this.lbUpdateTimes.Location = new System.Drawing.Point(14, 375);
this.lbUpdateTimes.Name = "lbUpdateTimes";
this.lbUpdateTimes.Size = new System.Drawing.Size(120, 94);
this.lbUpdateTimes.TabIndex = 8;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 354);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(76, 15);
this.label4.TabIndex = 9;
this.label4.Text = "LatestUpdate";
//
// frmMyStocks
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(935, 481);
this.Controls.Add(this.label4);
this.Controls.Add(this.lbUpdateTimes);
this.Controls.Add(this.chkAutoReload);
this.Controls.Add(this.label3);
this.Controls.Add(this.txtCurrValue);
@ -248,5 +270,7 @@ namespace RepositoryPattern
private System.Windows.Forms.TextBox txtCurrValue;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.CheckBox chkAutoReload;
private System.Windows.Forms.ListBox lbUpdateTimes;
private System.Windows.Forms.Label label4;
}
}

View File

@ -60,8 +60,10 @@ namespace RepositoryPattern
private void TotalReload()
{
_stockMarketRepository.LoadStockMarketList();
Stocks = _stockMarketRepository.StockMarketList;
ReloadData();
lbUpdateTimes.Items.Add(DateTime.Now.ToString());
}
private void lvMyStocks_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)