diff --git a/StockBL.Interface/IPersonStockFacade.cs b/StockBL.Interface/IPersonStockFacade.cs new file mode 100644 index 0000000..2c985af --- /dev/null +++ b/StockBL.Interface/IPersonStockFacade.cs @@ -0,0 +1,8 @@ +using System; + +namespace StockBL.Interface +{ + public class IPersonStockFacade + { + } +} diff --git a/StockBL.Interface/StockBL.Interface.csproj b/StockBL.Interface/StockBL.Interface.csproj new file mode 100644 index 0000000..f208d30 --- /dev/null +++ b/StockBL.Interface/StockBL.Interface.csproj @@ -0,0 +1,7 @@ + + + + net5.0 + + + diff --git a/StockBL/PersonStockFacade.cs b/StockBL/PersonStockFacade.cs new file mode 100644 index 0000000..fba7ba3 --- /dev/null +++ b/StockBL/PersonStockFacade.cs @@ -0,0 +1,10 @@ +using StockBL.Interface; +using System; + +namespace StockBL +{ + public class PersonStockFacade : IPersonStockFacade + { + + } +} diff --git a/StockBL/StockBL.csproj b/StockBL/StockBL.csproj new file mode 100644 index 0000000..5517349 --- /dev/null +++ b/StockBL/StockBL.csproj @@ -0,0 +1,11 @@ + + + + net5.0 + + + + + + + diff --git a/StockBackup132600639190932681.json b/StockBackup132600639190932681.json new file mode 100644 index 0000000..5a4f678 --- /dev/null +++ b/StockBackup132600639190932681.json @@ -0,0 +1 @@ +[{"Id":22,"StockId":"Ericsson A","StockExtId":"Ericsson A","BuyValue":107.4,"BuyDate":"2021-01-15T00:00:00","ActValue":118.8,"ActDate":"2021-03-12T00:00:00","ActAmount":100,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":100},{"Id":23,"StockId":"Unibap","StockExtId":"Unibap","BuyValue":36.4,"BuyDate":"2021-01-19T00:00:00","ActValue":34.7,"ActDate":"2021-03-12T00:00:00","ActAmount":100,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":100},{"Id":24,"StockId":"Hufvudstaden A","StockExtId":"Hufvudstaden A","BuyValue":132.1,"BuyDate":"2021-01-18T00:00:00","ActValue":125.0,"ActDate":"2021-03-12T00:00:00","ActAmount":100,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":100},{"Id":25,"StockId":"NENT Group B","StockExtId":"NENT Group B","BuyValue":435.1133,"BuyDate":"2021-02-01T00:00:00","ActValue":404.4,"ActDate":"2021-03-12T00:00:00","ActAmount":30,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":30},{"Id":26,"StockId":"NENT Group B","StockExtId":"NENT Group B","BuyValue":413.0,"BuyDate":"2021-02-09T00:00:00","ActValue":386.0,"ActDate":"2021-03-01T17:29:00","ActAmount":0,"SoldValue":19506.0,"SoldDate":"2021-02-12T00:00:00","Comment":"","PostAmount":45},{"Id":27,"StockId":"Platzer Fastigheter Holding B","StockExtId":"Platzer Fastigheter Holding B","BuyValue":103.8,"BuyDate":"2021-02-15T00:00:00","ActValue":109.4,"ActDate":"2021-03-12T00:00:00","ActAmount":100,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":100},{"Id":28,"StockId":"Poolia B","StockExtId":"Poolia B","BuyValue":6.46,"BuyDate":"2021-02-19T00:00:00","ActValue":9.14,"ActDate":"2021-03-12T00:00:00","ActAmount":200,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":200},{"Id":29,"StockId":"Latour B","StockExtId":"Latour B","BuyValue":192.5,"BuyDate":"2021-01-15T00:00:00","ActValue":202.0,"ActDate":"2021-03-07T00:00:00","ActAmount":0,"SoldValue":10840.0,"SoldDate":"2021-03-12T00:00:00","Comment":"","PostAmount":50},{"Id":30,"StockId":"ABB","StockExtId":"ABB","BuyValue":242.4,"BuyDate":"2021-02-10T00:00:00","ActValue":247.8,"ActDate":"2021-03-07T00:00:00","ActAmount":0,"SoldValue":13005.0,"SoldDate":"2021-03-12T00:00:00","Comment":"","PostAmount":50},{"Id":31,"StockId":"Tele2 B","StockExtId":"Tele2 B","BuyValue":106.55,"BuyDate":"2021-02-23T00:00:00","ActValue":110.9,"ActDate":"2021-03-07T00:00:00","ActAmount":0,"SoldValue":11660.0,"SoldDate":"2021-03-12T00:00:00","Comment":"","PostAmount":100},{"Id":32,"StockId":"SAS","StockExtId":"SAS","BuyValue":1.702,"BuyDate":"2021-01-15T00:00:00","ActValue":1.96,"ActDate":"2021-03-12T00:00:00","ActAmount":1000,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":1000},{"Id":33,"StockId":"Holmen A","StockExtId":"Holmen A","BuyValue":399.0,"BuyDate":"2021-02-01T00:00:00","ActValue":397.0,"ActDate":"2021-03-12T00:00:00","ActAmount":5,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":5},{"Id":34,"StockId":"Sagax D","StockExtId":"Sagax D","BuyValue":31.95,"BuyDate":"2021-03-04T00:00:00","ActValue":32.35,"ActDate":"2021-03-12T00:00:00","ActAmount":100,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":100},{"Id":35,"StockId":"Telia Company","StockExtId":"Telia Company","BuyValue":34.95,"BuyDate":"2021-02-18T00:00:00","ActValue":36.44,"ActDate":"2021-03-12T00:00:00","ActAmount":100,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":100},{"Id":36,"StockId":"Holmen A","StockExtId":"Holmen A","BuyValue":431.0,"BuyDate":"2021-01-25T00:00:00","ActValue":397.0,"ActDate":"2021-03-12T00:00:00","ActAmount":10,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":10},{"Id":37,"StockId":"NENT Group B","StockExtId":"NENT Group B","BuyValue":418.0,"BuyDate":"2021-02-18T00:00:00","ActValue":404.4,"ActDate":"2021-03-12T00:00:00","ActAmount":10,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":10},{"Id":38,"StockId":"Holmen A","StockExtId":"Holmen A","BuyValue":431.0,"BuyDate":"2021-01-22T00:00:00","ActValue":397.0,"ActDate":"2021-03-12T00:00:00","ActAmount":20,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":20},{"Id":39,"StockId":"Swedbank A","StockExtId":"Swedbank A","BuyValue":164.16,"BuyDate":"2021-01-26T00:00:00","ActValue":161.84,"ActDate":"2021-03-12T00:00:00","ActAmount":50,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":50},{"Id":40,"StockId":"Betsson B","StockExtId":"Betsson B","BuyValue":84.7,"BuyDate":"2021-01-18T00:00:00","ActValue":72.1,"ActDate":"2021-03-12T00:00:00","ActAmount":50,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":50},{"Id":41,"StockId":"NENT Group B","StockExtId":"NENT Group B","BuyValue":477.4,"BuyDate":"2021-01-20T00:00:00","ActValue":404.4,"ActDate":"2021-03-12T00:00:00","ActAmount":10,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":10},{"Id":42,"StockId":"Sweco A","StockExtId":"Sweco A","BuyValue":136.365,"BuyDate":"2021-02-17T00:00:00","ActValue":138.0,"ActDate":"2021-03-12T00:00:00","ActAmount":100,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":100},{"Id":43,"StockId":"Handelsbanken A","StockExtId":"Handelsbanken A","BuyValue":94.04,"BuyDate":"2021-03-05T00:00:00","ActValue":98.66,"ActDate":"2021-03-12T00:00:00","ActAmount":50,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":50},{"Id":44,"StockId":"Havsfrun Investment B","StockExtId":"Havsfrun Investment B","BuyValue":23.2,"BuyDate":"2021-03-12T00:00:00","ActValue":23.2,"ActDate":"2021-03-13T17:29:00","ActAmount":200,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":200},{"Id":45,"StockId":"SAS","StockExtId":"SAS","BuyValue":1.954,"BuyDate":"2021-03-13T00:00:00","ActValue":1.96,"ActDate":"2021-03-13T17:29:00","ActAmount":2000,"SoldValue":0.0,"SoldDate":null,"Comment":"","PostAmount":2000}] \ No newline at end of file diff --git a/StockDAL/StockPersonConnect.cs b/StockDAL/StockPersonConnect.cs new file mode 100644 index 0000000..2580fad --- /dev/null +++ b/StockDAL/StockPersonConnect.cs @@ -0,0 +1,50 @@ +using DataDomain; +using DatamodelLibrary; +using StockDAL.Interface; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StockDAL +{ + public class StockPersonConnect : IStockPersonConnect + { + public IEnumerable GetAllConnectionsByPersId(int personId) + { + using var context = new StockContext(); + var connections = (from spc in context.PersonStocks + where spc.PersonId == personId + select spc).ToList(); + return connections; + } + + public PersonStock SavePersonStockConnection(PersonStock personStock) + { + using var context = new StockContext(); + var entity = (from ps in context.PersonStocks + where ps.Id == personStock.Id + select ps).FirstOrDefault(); + if (entity == null) + { + entity = new PersonStock + { + PersonId = personStock.PersonId, + StockId = personStock.StockId, + Comment = personStock.Comment + }; + context.PersonStocks.Add(entity); + } + else + { + entity.PersonId = personStock.PersonId; + entity.StockId = personStock.StockId; + entity.Comment = personStock.Comment; + } + context.SaveChanges(); + + return entity; + } + } +} diff --git a/StockDBEFApp.sln b/StockDBEFApp.sln index 01c6cad..4114206 100644 --- a/StockDBEFApp.sln +++ b/StockDBEFApp.sln @@ -13,7 +13,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StockDAL.Interface", "Stock EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StockInfo", "StockInfo\StockInfo.csproj", "{EC122B56-FCE0-4BBD-956D-7BF46D617CF8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helpers", "Helpers\Helpers.csproj", "{5FEE920E-07B8-4185-A41F-1587643ECC26}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Helpers", "Helpers\Helpers.csproj", "{5FEE920E-07B8-4185-A41F-1587643ECC26}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockBL", "StockBL\StockBL.csproj", "{C8801F5F-1C4F-4067-ADA2-A2DA299A54A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockBL.Interface", "StockBL.Interface\StockBL.Interface.csproj", "{BFF16A7B-9962-430B-A665-03F4174A289D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -45,6 +49,14 @@ Global {5FEE920E-07B8-4185-A41F-1587643ECC26}.Debug|Any CPU.Build.0 = Debug|Any CPU {5FEE920E-07B8-4185-A41F-1587643ECC26}.Release|Any CPU.ActiveCfg = Release|Any CPU {5FEE920E-07B8-4185-A41F-1587643ECC26}.Release|Any CPU.Build.0 = Release|Any CPU + {C8801F5F-1C4F-4067-ADA2-A2DA299A54A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8801F5F-1C4F-4067-ADA2-A2DA299A54A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8801F5F-1C4F-4067-ADA2-A2DA299A54A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8801F5F-1C4F-4067-ADA2-A2DA299A54A8}.Release|Any CPU.Build.0 = Release|Any CPU + {BFF16A7B-9962-430B-A665-03F4174A289D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BFF16A7B-9962-430B-A665-03F4174A289D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BFF16A7B-9962-430B-A665-03F4174A289D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BFF16A7B-9962-430B-A665-03F4174A289D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/StockDal.Interface/IStockPersonConnect.cs b/StockDal.Interface/IStockPersonConnect.cs new file mode 100644 index 0000000..9c4ec5a --- /dev/null +++ b/StockDal.Interface/IStockPersonConnect.cs @@ -0,0 +1,15 @@ +using DataDomain; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StockDAL.Interface +{ + public interface IStockPersonConnect + { + IEnumerable GetAllConnectionsByPersId(int personId); + PersonStock SavePersonStockConnection(PersonStock personStock); + } +} diff --git a/StockInfo/Program.cs b/StockInfo/Program.cs index 0e027d6..dcd1d12 100644 --- a/StockInfo/Program.cs +++ b/StockInfo/Program.cs @@ -24,7 +24,7 @@ namespace StockInfo Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Container = Configure(); - Application.Run(new frmInitial( Container.Resolve(), Container.Resolve(), Container.Resolve(), Container.Resolve())); + Application.Run(new frmInitial( Container.Resolve(), Container.Resolve(), Container.Resolve(), Container.Resolve(), Container.Resolve())); } static IContainer Configure() @@ -34,6 +34,7 @@ namespace StockInfo builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As(); + builder.RegisterType().As(); builder.RegisterType(); return builder.Build(); } diff --git a/StockInfo/Properties/Resources.Designer.cs b/StockInfo/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e91df02 --- /dev/null +++ b/StockInfo/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace StockInfo.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StockInfo.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/StockInfo/Properties/Resources.resx b/StockInfo/Properties/Resources.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/StockInfo/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/StockInfo/StockInfo.csproj b/StockInfo/StockInfo.csproj index 1b6cad7..d99e4bb 100644 --- a/StockInfo/StockInfo.csproj +++ b/StockInfo/StockInfo.csproj @@ -31,6 +31,23 @@ + + + True + True + Resources.resx + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + PreserveNewest diff --git a/StockInfo/frmInitial.Designer.cs b/StockInfo/frmInitial.Designer.cs index 4a9565d..4f38db6 100644 --- a/StockInfo/frmInitial.Designer.cs +++ b/StockInfo/frmInitial.Designer.cs @@ -228,6 +228,7 @@ namespace StockInfo // // gpOwners // + this.gpOwners.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.gpOwners.Controls.Add(this.btnConnShares); this.gpOwners.Controls.Add(this.btnEditPerson); this.gpOwners.Controls.Add(this.cmbOwners); diff --git a/StockInfo/frmInitial.cs b/StockInfo/frmInitial.cs index 545fc3e..5e5692b 100644 --- a/StockInfo/frmInitial.cs +++ b/StockInfo/frmInitial.cs @@ -22,23 +22,27 @@ namespace StockInfo private readonly IStockMarketRepository _stockMarketRepository; private readonly IPersonRepository _personRepository; private readonly IAddressRepository _addressRepository; + private readonly IStockPersonConnect _stockPersonConnect; private frmRegisterStock regWindow; private frmMyStocks stockWindow; private frmSelling sellWindow; private frmPerson personWindow; + private frmPersonShareConnect personShareConnect; public int SelectedPersonId { get; set; } = 0; public frmInitial( - IStockRepository stockMemberRepository, + IStockRepository stockMemberRepository, IStockMarketRepository stockMarketRepository, IPersonRepository personRepository, - IAddressRepository addressRepository) + IAddressRepository addressRepository, + IStockPersonConnect stockPersonConnect) { InitializeComponent(); _stockRepository = stockMemberRepository; _stockMarketRepository = stockMarketRepository; _personRepository = personRepository; _addressRepository = addressRepository; + _stockPersonConnect = stockPersonConnect; } private void Form1_Load(object sender, EventArgs e) @@ -110,7 +114,7 @@ namespace StockInfo stockWindow.ShowDialog(); } - + private void chkEnableBackRes_CheckedChanged(object sender, EventArgs e) { @@ -180,7 +184,19 @@ namespace StockInfo private void btnConnShares_Click(object sender, EventArgs e) { - + if (SelectedPersonId == 0) + { + MessageBox.Show($"Ingen person vald ({SelectedPersonId})"); + } + else + { + var person = _personRepository.GetPersonById(SelectedPersonId); + personShareConnect = new frmPersonShareConnect(); + Cursor.Current = Cursors.WaitCursor; + personShareConnect.ConnectPerson = person; + Cursor.Current = DefaultCursor; + personShareConnect.ShowDialog(); + } } private void frmInitial_Shown(object sender, EventArgs e) @@ -196,7 +212,7 @@ namespace StockInfo { foreach (var person in owners) { - var itemIndex = cmbOwners.Items.Add(new ComboboxItem ($"{person.FirstName} {person.LastName} ({person.NickName})",person.Id)); + var itemIndex = cmbOwners.Items.Add(new ComboboxItem($"{person.FirstName} {person.LastName} ({person.NickName})", person.Id)); } } cmbOwners.Items.Add(new ComboboxItem($"< ny person> ", 0)); diff --git a/StockInfo/frmPerson.Designer.cs b/StockInfo/frmPerson.Designer.cs index 11305df..45877f1 100644 --- a/StockInfo/frmPerson.Designer.cs +++ b/StockInfo/frmPerson.Designer.cs @@ -319,6 +319,7 @@ namespace StockInfo this.Controls.Add(this.txtFirstName); this.Controls.Add(this.label1); this.Name = "frmPerson"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "frmPerson"; this.Load += new System.EventHandler(this.frmPerson_Load); this.gbAddress.ResumeLayout(false); diff --git a/StockInfo/frmPersonShareConnect.Designer.cs b/StockInfo/frmPersonShareConnect.Designer.cs index 22120a9..eec3bc6 100644 --- a/StockInfo/frmPersonShareConnect.Designer.cs +++ b/StockInfo/frmPersonShareConnect.Designer.cs @@ -29,12 +29,95 @@ namespace StockInfo /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPersonShareConnect)); + this.lstShares = new System.Windows.Forms.ListBox(); + this.listBox1 = new System.Windows.Forms.ListBox(); + this.btnToPerson = new System.Windows.Forms.Button(); + this.lblShareHolder = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lstShares + // + this.lstShares.FormattingEnabled = true; + this.lstShares.ItemHeight = 15; + this.lstShares.Location = new System.Drawing.Point(35, 35); + this.lstShares.Name = "lstShares"; + this.lstShares.Size = new System.Drawing.Size(173, 349); + this.lstShares.TabIndex = 0; + // + // listBox1 + // + this.listBox1.FormattingEnabled = true; + this.listBox1.ItemHeight = 15; + this.listBox1.Location = new System.Drawing.Point(270, 35); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(173, 349); + this.listBox1.TabIndex = 1; + // + // btnToPerson + // + this.btnToPerson.Image = ((System.Drawing.Image)(resources.GetObject("btnToPerson.Image"))); + this.btnToPerson.Location = new System.Drawing.Point(214, 202); + this.btnToPerson.Name = "btnToPerson"; + this.btnToPerson.Size = new System.Drawing.Size(49, 23); + this.btnToPerson.TabIndex = 2; + this.btnToPerson.UseVisualStyleBackColor = true; + // + // lblShareHolder + // + this.lblShareHolder.AutoSize = true; + this.lblShareHolder.Location = new System.Drawing.Point(270, 12); + this.lblShareHolder.Name = "lblShareHolder"; + this.lblShareHolder.Size = new System.Drawing.Size(80, 15); + this.lblShareHolder.TabIndex = 3; + this.lblShareHolder.Text = "[share holder]"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(35, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(102, 15); + this.label1.TabIndex = 4; + this.label1.Text = "Uncoupled Shares"; + // + // button1 + // + this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image"))); + this.button1.Location = new System.Drawing.Point(215, 173); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(49, 23); + this.button1.TabIndex = 5; + this.button1.UseVisualStyleBackColor = true; + // + // frmPersonShareConnect + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(509, 450); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Controls.Add(this.lblShareHolder); + this.Controls.Add(this.btnToPerson); + this.Controls.Add(this.listBox1); + this.Controls.Add(this.lstShares); + this.Name = "frmPersonShareConnect"; this.Text = "frmPersonShareConnect"; + this.Shown += new System.EventHandler(this.frmPersonShareConnect_Shown); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion + + private System.Windows.Forms.ListBox lstShares; + private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.Button btnToPerson; + private System.Windows.Forms.Label lblShareHolder; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; } } \ No newline at end of file diff --git a/StockInfo/frmPersonShareConnect.cs b/StockInfo/frmPersonShareConnect.cs index 4cc7a95..97f7d06 100644 --- a/StockInfo/frmPersonShareConnect.cs +++ b/StockInfo/frmPersonShareConnect.cs @@ -1,4 +1,5 @@ -using System; +using DataDomain; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -12,9 +13,16 @@ namespace StockInfo { public partial class frmPersonShareConnect : Form { + public Person ConnectPerson { get; set; } public frmPersonShareConnect() { InitializeComponent(); } + + private void frmPersonShareConnect_Shown(object sender, EventArgs e) + { + this.Text = $"{ConnectPerson.Id} - {ConnectPerson.FirstName} {ConnectPerson.LastName}'s Shares"; + this.lblShareHolder.Text = $"{ConnectPerson.FirstName} {ConnectPerson.LastName}'s Shares"; + } } } diff --git a/StockInfo/frmPersonShareConnect.resx b/StockInfo/frmPersonShareConnect.resx index 1af7de1..bf93be3 100644 --- a/StockInfo/frmPersonShareConnect.resx +++ b/StockInfo/frmPersonShareConnect.resx @@ -1,64 +1,4 @@ - - - + @@ -117,4 +57,23 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACiSURBVDhPY0AH37594wPie0D8H4ihoiQAoKYlq1evBmkm + 3QCghqgbN2789/DwIN0AoGKFj0CQlJT038nJCWYAQQzTzAzERydOnAjWjI5BCnGxYQbUHzlyBC6BjvEa + ACSsnj9//ic4OBgugY4JGXCvoqICLogN09wAyrxAcSBCDaAsGkEAyCE/IcEAUAAjKRPCGAAoiJKZCGEM + ABQkITszMAAAZBgNueqz2kUAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACmSURBVDhPYyAGfPv27T8Q3wNiPqgQaQBkwNq1a0GGLIEK + kQZABnh4ePy/efMmyJAoqDAEgCSJwU5OTv9TUlL+fwQCIF8Bqh1iAEgShHGxkfHkyZNBckeBmJksA0D4 + 6NGjIPl6sg0ICQn5/+LFiz9ANVZkGQDClZWVIDX3BsYAir1AUSBijUZiMEgz1oT0//9/kCGEMO6kDAJo + irFhyjMTEGPJzgwMAF29/539maLfAAAAAElFTkSuQmCC + + \ No newline at end of file