Stock chosingcombo implemented in also created registerwindow
This commit is contained in:
28
RepositoryPattern/frmInitial.Designer.cs
generated
28
RepositoryPattern/frmInitial.Designer.cs
generated
@ -39,8 +39,11 @@ namespace RepositoryPattern
|
|||||||
this.lblStockRows = new System.Windows.Forms.Label();
|
this.lblStockRows = new System.Windows.Forms.Label();
|
||||||
this.button1 = new System.Windows.Forms.Button();
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
this.chbShowBrowser = new System.Windows.Forms.CheckBox();
|
this.chbShowBrowser = new System.Windows.Forms.CheckBox();
|
||||||
|
this.gbStockMgmnt = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnStockReg = new System.Windows.Forms.Button();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||||
this.gB1.SuspendLayout();
|
this.gB1.SuspendLayout();
|
||||||
|
this.gbStockMgmnt.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// dataGridView
|
// dataGridView
|
||||||
@ -146,11 +149,31 @@ namespace RepositoryPattern
|
|||||||
this.chbShowBrowser.UseCompatibleTextRendering = true;
|
this.chbShowBrowser.UseCompatibleTextRendering = true;
|
||||||
this.chbShowBrowser.UseVisualStyleBackColor = true;
|
this.chbShowBrowser.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// gbStockMgmnt
|
||||||
|
//
|
||||||
|
this.gbStockMgmnt.Controls.Add(this.btnStockReg);
|
||||||
|
this.gbStockMgmnt.Location = new System.Drawing.Point(411, 411);
|
||||||
|
this.gbStockMgmnt.Name = "gbStockMgmnt";
|
||||||
|
this.gbStockMgmnt.Size = new System.Drawing.Size(257, 123);
|
||||||
|
this.gbStockMgmnt.TabIndex = 8;
|
||||||
|
this.gbStockMgmnt.TabStop = false;
|
||||||
|
//
|
||||||
|
// btnStockReg
|
||||||
|
//
|
||||||
|
this.btnStockReg.Location = new System.Drawing.Point(6, 9);
|
||||||
|
this.btnStockReg.Name = "btnStockReg";
|
||||||
|
this.btnStockReg.Size = new System.Drawing.Size(96, 23);
|
||||||
|
this.btnStockReg.TabIndex = 0;
|
||||||
|
this.btnStockReg.Text = "Stock Purchase";
|
||||||
|
this.btnStockReg.UseVisualStyleBackColor = true;
|
||||||
|
this.btnStockReg.Click += new System.EventHandler(this.btnStockReg_Click);
|
||||||
|
//
|
||||||
// frmInitial
|
// frmInitial
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 509);
|
this.ClientSize = new System.Drawing.Size(800, 546);
|
||||||
|
this.Controls.Add(this.gbStockMgmnt);
|
||||||
this.Controls.Add(this.chbShowBrowser);
|
this.Controls.Add(this.chbShowBrowser);
|
||||||
this.Controls.Add(this.button1);
|
this.Controls.Add(this.button1);
|
||||||
this.Controls.Add(this.lblStockRows);
|
this.Controls.Add(this.lblStockRows);
|
||||||
@ -167,6 +190,7 @@ namespace RepositoryPattern
|
|||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||||
this.gB1.ResumeLayout(false);
|
this.gB1.ResumeLayout(false);
|
||||||
this.gB1.PerformLayout();
|
this.gB1.PerformLayout();
|
||||||
|
this.gbStockMgmnt.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
@ -184,6 +208,8 @@ namespace RepositoryPattern
|
|||||||
private System.Windows.Forms.Label lblStockRows;
|
private System.Windows.Forms.Label lblStockRows;
|
||||||
private System.Windows.Forms.Button button1;
|
private System.Windows.Forms.Button button1;
|
||||||
private System.Windows.Forms.CheckBox chbShowBrowser;
|
private System.Windows.Forms.CheckBox chbShowBrowser;
|
||||||
|
private System.Windows.Forms.GroupBox gbStockMgmnt;
|
||||||
|
private System.Windows.Forms.Button btnStockReg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@ namespace RepositoryPattern
|
|||||||
private readonly IStockMemberRepository _stockMemberRepository;
|
private readonly IStockMemberRepository _stockMemberRepository;
|
||||||
private readonly IStockMarketRepository _stockMarketRepository;
|
private readonly IStockMarketRepository _stockMarketRepository;
|
||||||
|
|
||||||
|
private frmRegisterStock regWindow;
|
||||||
|
|
||||||
public frmInitial(IProductRepository productRepository, IStockMemberRepository stockMemberRepository, IStockMarketRepository stockMarketRepository)
|
public frmInitial(IProductRepository productRepository, IStockMemberRepository stockMemberRepository, IStockMarketRepository stockMarketRepository)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -34,7 +36,8 @@ namespace RepositoryPattern
|
|||||||
{
|
{
|
||||||
if (rdbNorth.Checked)
|
if (rdbNorth.Checked)
|
||||||
{
|
{
|
||||||
dataGridView.DataSource = _productRepository.GetProducts(); }
|
dataGridView.DataSource = _productRepository.GetProducts();
|
||||||
|
}
|
||||||
else if (rdbStock.Checked)
|
else if (rdbStock.Checked)
|
||||||
{
|
{
|
||||||
dataGridView.DataSource = _stockMemberRepository.GetStocks();
|
dataGridView.DataSource = _stockMemberRepository.GetStocks();
|
||||||
@ -72,5 +75,16 @@ namespace RepositoryPattern
|
|||||||
lblStockRows.Text = stocklist.Count().ToString();
|
lblStockRows.Text = stocklist.Count().ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnStockReg_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (rdbStock.Checked)
|
||||||
|
{
|
||||||
|
_stockMarketRepository.LoadStockMarketList();
|
||||||
|
regWindow = new frmRegisterStock();
|
||||||
|
regWindow.Stocks = _stockMarketRepository.StockMarketList;
|
||||||
|
regWindow.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
73
RepositoryPattern/frmRegisterStock.Designer.cs
generated
Normal file
73
RepositoryPattern/frmRegisterStock.Designer.cs
generated
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
|
||||||
|
namespace RepositoryPattern
|
||||||
|
{
|
||||||
|
partial class frmRegisterStock
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.cmbStockChoser = new System.Windows.Forms.ComboBox();
|
||||||
|
this.btnClose = new System.Windows.Forms.Button();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// cmbStockChoser
|
||||||
|
//
|
||||||
|
this.cmbStockChoser.FormattingEnabled = true;
|
||||||
|
this.cmbStockChoser.Location = new System.Drawing.Point(174, 45);
|
||||||
|
this.cmbStockChoser.Name = "cmbStockChoser";
|
||||||
|
this.cmbStockChoser.Size = new System.Drawing.Size(179, 23);
|
||||||
|
this.cmbStockChoser.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// btnClose
|
||||||
|
//
|
||||||
|
this.btnClose.Location = new System.Drawing.Point(374, 532);
|
||||||
|
this.btnClose.Name = "btnClose";
|
||||||
|
this.btnClose.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.btnClose.TabIndex = 1;
|
||||||
|
this.btnClose.Text = "Close";
|
||||||
|
this.btnClose.UseVisualStyleBackColor = true;
|
||||||
|
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||||
|
//
|
||||||
|
// frmRegisterStock
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(471, 567);
|
||||||
|
this.Controls.Add(this.btnClose);
|
||||||
|
this.Controls.Add(this.cmbStockChoser);
|
||||||
|
this.Name = "frmRegisterStock";
|
||||||
|
this.Text = "frmRegisterStock";
|
||||||
|
this.Shown += new System.EventHandler(this.frmRegisterStock_Shown);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.ComboBox cmbStockChoser;
|
||||||
|
private System.Windows.Forms.Button btnClose;
|
||||||
|
}
|
||||||
|
}
|
||||||
46
RepositoryPattern/frmRegisterStock.cs
Normal file
46
RepositoryPattern/frmRegisterStock.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using StockDomain;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace RepositoryPattern
|
||||||
|
{
|
||||||
|
public partial class frmRegisterStock : Form
|
||||||
|
{
|
||||||
|
|
||||||
|
public Dictionary<string, DiTraderStockRow> Stocks { get; set; }
|
||||||
|
|
||||||
|
public frmRegisterStock()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadStockCombo()
|
||||||
|
{
|
||||||
|
if (Stocks.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach(var key in Stocks.Keys)
|
||||||
|
{
|
||||||
|
cmbStockChoser.Items.Add(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnClose_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void frmRegisterStock_Shown(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LoadStockCombo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
60
RepositoryPattern/frmRegisterStock.resx
Normal file
60
RepositoryPattern/frmRegisterStock.resx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<root>
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
Reference in New Issue
Block a user