diff --git a/DataDomain/StockMember.cs b/DataDomain/StockMember.cs index f32d888..ee6a7fe 100644 --- a/DataDomain/StockMember.cs +++ b/DataDomain/StockMember.cs @@ -21,6 +21,7 @@ namespace DataDomain // public string PostId { get; set; } public string Comment { get; set; } public long PostAmount { get; set; } + public decimal SoldStockPrice { get; set; } } } diff --git a/DatamodelLibrary/DatamodelLibrary.csproj b/DatamodelLibrary/DatamodelLibrary.csproj index ce8d401..fa24453 100644 --- a/DatamodelLibrary/DatamodelLibrary.csproj +++ b/DatamodelLibrary/DatamodelLibrary.csproj @@ -1,12 +1,14 @@ - + net5.0 - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DatamodelLibrary/Migrations/20210512210945_NewStockFields.Designer.cs b/DatamodelLibrary/Migrations/20210512210945_NewStockFields.Designer.cs new file mode 100644 index 0000000..c37f568 --- /dev/null +++ b/DatamodelLibrary/Migrations/20210512210945_NewStockFields.Designer.cs @@ -0,0 +1,177 @@ +// +using System; +using DatamodelLibrary; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace DatamodelLibrary.Migrations +{ + [DbContext(typeof(StockContext))] + [Migration("20210512210945_NewStockFields")] + partial class NewStockFields + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "5.0.6"); + + modelBuilder.Entity("DataDomain.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Destination") + .HasColumnType("TEXT"); + + b.Property("Nation") + .HasColumnType("TEXT"); + + b.Property("Street") + .HasColumnType("TEXT"); + + b.Property("Street2") + .HasColumnType("TEXT"); + + b.Property("Zipcode") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Addresses"); + }); + + modelBuilder.Entity("DataDomain.BackupRegister", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BackedUp") + .HasColumnType("TEXT"); + + b.Property("BackupDbName") + .HasColumnType("TEXT"); + + b.Property("BackupPath") + .HasColumnType("TEXT"); + + b.Property("DbName") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("BackupRegings"); + }); + + modelBuilder.Entity("DataDomain.Person", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountNo") + .HasColumnType("INTEGER"); + + b.Property("Born") + .HasColumnType("TEXT"); + + b.Property("ClearingNo") + .HasColumnType("INTEGER"); + + b.Property("Comments") + .HasColumnType("TEXT"); + + b.Property("FirstName") + .HasColumnType("TEXT"); + + b.Property("HomeAddress") + .HasColumnType("INTEGER"); + + b.Property("InvoiceAddress") + .HasColumnType("INTEGER"); + + b.Property("LastName") + .HasColumnType("TEXT"); + + b.Property("NickName") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Persons"); + }); + + modelBuilder.Entity("DataDomain.PersonStock", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Comment") + .HasColumnType("TEXT"); + + b.Property("PersonId") + .HasColumnType("INTEGER"); + + b.Property("StockId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("PersonStocks"); + }); + + modelBuilder.Entity("DataDomain.StockMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ActAmount") + .HasColumnType("INTEGER"); + + b.Property("ActDate") + .HasColumnType("TEXT"); + + b.Property("ActValue") + .HasColumnType("TEXT"); + + b.Property("BuyDate") + .HasColumnType("TEXT"); + + b.Property("BuyValue") + .HasColumnType("TEXT"); + + b.Property("Comment") + .HasColumnType("TEXT"); + + b.Property("PostAmount") + .HasColumnType("INTEGER"); + + b.Property("SoldDate") + .HasColumnType("TEXT"); + + b.Property("SoldStockPrice") + .HasColumnType("TEXT"); + + b.Property("SoldValue") + .HasColumnType("TEXT"); + + b.Property("StockExtId") + .HasColumnType("TEXT"); + + b.Property("StockId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Stocks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DatamodelLibrary/Migrations/20210512210945_NewStockFields.cs b/DatamodelLibrary/Migrations/20210512210945_NewStockFields.cs new file mode 100644 index 0000000..2693677 --- /dev/null +++ b/DatamodelLibrary/Migrations/20210512210945_NewStockFields.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DatamodelLibrary.Migrations +{ + public partial class NewStockFields : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "SoldStockPrice", + table: "Stocks", + type: "TEXT", + nullable: false, + defaultValue: 0m); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "SoldStockPrice", + table: "Stocks"); + } + } +} diff --git a/DatamodelLibrary/Migrations/StockContextModelSnapshot.cs b/DatamodelLibrary/Migrations/StockContextModelSnapshot.cs index 0b733a7..598701e 100644 --- a/DatamodelLibrary/Migrations/StockContextModelSnapshot.cs +++ b/DatamodelLibrary/Migrations/StockContextModelSnapshot.cs @@ -14,7 +14,7 @@ namespace DatamodelLibrary.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "5.0.3"); + .HasAnnotation("ProductVersion", "5.0.6"); modelBuilder.Entity("DataDomain.Address", b => { @@ -153,6 +153,9 @@ namespace DatamodelLibrary.Migrations b.Property("SoldDate") .HasColumnType("TEXT"); + b.Property("SoldStockPrice") + .HasColumnType("TEXT"); + b.Property("SoldValue") .HasColumnType("TEXT"); diff --git a/StockInfoCore/StockInfoCore.csproj b/StockInfoCore/StockInfoCore.csproj index c17cd41..f440ce9 100644 --- a/StockInfoCore/StockInfoCore.csproj +++ b/StockInfoCore/StockInfoCore.csproj @@ -7,6 +7,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -26,9 +30,5 @@ PreserveNewest - - \ No newline at end of file diff --git a/StockInfoCore/Stocks.db b/StockInfoCore/Stocks.db index 6ef8603..4a88d8a 100644 Binary files a/StockInfoCore/Stocks.db and b/StockInfoCore/Stocks.db differ diff --git a/StockInfoCore/frmMyStocks.cs b/StockInfoCore/frmMyStocks.cs index b0dbe81..5e0b605 100644 --- a/StockInfoCore/frmMyStocks.cs +++ b/StockInfoCore/frmMyStocks.cs @@ -90,6 +90,7 @@ namespace StockInfoCore txtTotalPlus.Text = TotalPlus.ToString(); txtTotalPlus.Refresh(); + lbUpdateTimes.Items.Add($"{DateTime.Now.ToLongTimeString()} - {txtTotDiff.Text.Substring(0, txtTotDiff.Text.Length - 2)}"); } @@ -98,7 +99,7 @@ namespace StockInfoCore _stockMarketRepository.LoadStockMarketList(); Stocks = _stockMarketRepository.StockMarketList; ReloadData(); - lbUpdateTimes.Items.Add($"{DateTime.Now.ToLongTimeString()} - {txtTotDiff.Text.Substring(0, txtTotDiff.Text.Length-2)}"); +// lbUpdateTimes.Items.Add($"{DateTime.Now.ToLongTimeString()} - {txtTotDiff.Text.Substring(0, txtTotDiff.Text.Length-2)}"); } private void lvMyStocks_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)