Start intergration of scrap-routine
This commit is contained in:
@ -22,7 +22,7 @@ namespace RepositoryPattern
|
|||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Container = Configure();
|
Container = Configure();
|
||||||
Application.Run(new Form1(Container.Resolve<IProductRepository>(),Container.Resolve<IStockMemberRepository>()));
|
Application.Run(new frmInitial(Container.Resolve<IProductRepository>(),Container.Resolve<IStockMemberRepository>()));
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setting dependency injection
|
/// Setting dependency injection
|
||||||
@ -33,7 +33,7 @@ namespace RepositoryPattern
|
|||||||
var builder = new ContainerBuilder();
|
var builder = new ContainerBuilder();
|
||||||
builder.RegisterType<ProductRepository>().As<IProductRepository>();
|
builder.RegisterType<ProductRepository>().As<IProductRepository>();
|
||||||
builder.RegisterType<StockMemberRepository>().As<IStockMemberRepository>();
|
builder.RegisterType<StockMemberRepository>().As<IStockMemberRepository>();
|
||||||
builder.RegisterType<Form1>();
|
builder.RegisterType<frmInitial>();
|
||||||
return builder.Build();
|
return builder.Build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
namespace RepositoryPattern
|
namespace RepositoryPattern
|
||||||
{
|
{
|
||||||
partial class Form1
|
partial class frmInitial
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
@ -32,20 +32,22 @@ namespace RepositoryPattern
|
|||||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||||
this.lblTotalRecords = new System.Windows.Forms.Label();
|
this.lblTotalRecords = new System.Windows.Forms.Label();
|
||||||
this.gB1 = new System.Windows.Forms.GroupBox();
|
this.gB1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnReload = new System.Windows.Forms.Button();
|
||||||
this.rdbStock = new System.Windows.Forms.RadioButton();
|
this.rdbStock = new System.Windows.Forms.RadioButton();
|
||||||
this.rdbNorth = new System.Windows.Forms.RadioButton();
|
this.rdbNorth = new System.Windows.Forms.RadioButton();
|
||||||
this.btnReload = new System.Windows.Forms.Button();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||||
this.gB1.SuspendLayout();
|
this.gB1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// dataGridView
|
// dataGridView
|
||||||
//
|
//
|
||||||
|
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dataGridView.Location = new System.Drawing.Point(12, 12);
|
this.dataGridView.Location = new System.Drawing.Point(12, 16);
|
||||||
this.dataGridView.Name = "dataGridView";
|
this.dataGridView.Name = "dataGridView";
|
||||||
this.dataGridView.RowTemplate.Height = 25;
|
this.dataGridView.RowTemplate.Height = 25;
|
||||||
this.dataGridView.Size = new System.Drawing.Size(776, 393);
|
this.dataGridView.Size = new System.Drawing.Size(776, 389);
|
||||||
this.dataGridView.TabIndex = 0;
|
this.dataGridView.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// lblTotalRecords
|
// lblTotalRecords
|
||||||
@ -62,34 +64,12 @@ namespace RepositoryPattern
|
|||||||
this.gB1.Controls.Add(this.btnReload);
|
this.gB1.Controls.Add(this.btnReload);
|
||||||
this.gB1.Controls.Add(this.rdbStock);
|
this.gB1.Controls.Add(this.rdbStock);
|
||||||
this.gB1.Controls.Add(this.rdbNorth);
|
this.gB1.Controls.Add(this.rdbNorth);
|
||||||
this.gB1.Location = new System.Drawing.Point(220, 410);
|
this.gB1.Location = new System.Drawing.Point(157, 411);
|
||||||
this.gB1.Name = "gB1";
|
this.gB1.Name = "gB1";
|
||||||
this.gB1.Size = new System.Drawing.Size(248, 35);
|
this.gB1.Size = new System.Drawing.Size(248, 35);
|
||||||
this.gB1.TabIndex = 3;
|
this.gB1.TabIndex = 3;
|
||||||
this.gB1.TabStop = false;
|
this.gB1.TabStop = false;
|
||||||
//
|
//
|
||||||
// rdbStock
|
|
||||||
//
|
|
||||||
this.rdbStock.AutoSize = true;
|
|
||||||
this.rdbStock.Location = new System.Drawing.Point(98, 9);
|
|
||||||
this.rdbStock.Name = "rdbStock";
|
|
||||||
this.rdbStock.Size = new System.Drawing.Size(54, 19);
|
|
||||||
this.rdbStock.TabIndex = 1;
|
|
||||||
this.rdbStock.Text = "Stock";
|
|
||||||
this.rdbStock.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// rdbNorth
|
|
||||||
//
|
|
||||||
this.rdbNorth.AutoSize = true;
|
|
||||||
this.rdbNorth.Checked = true;
|
|
||||||
this.rdbNorth.Location = new System.Drawing.Point(7, 9);
|
|
||||||
this.rdbNorth.Name = "rdbNorth";
|
|
||||||
this.rdbNorth.Size = new System.Drawing.Size(84, 19);
|
|
||||||
this.rdbNorth.TabIndex = 0;
|
|
||||||
this.rdbNorth.TabStop = true;
|
|
||||||
this.rdbNorth.Text = "NorthWind";
|
|
||||||
this.rdbNorth.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// btnReload
|
// btnReload
|
||||||
//
|
//
|
||||||
this.btnReload.Location = new System.Drawing.Point(158, 9);
|
this.btnReload.Location = new System.Drawing.Point(158, 9);
|
||||||
@ -100,16 +80,38 @@ namespace RepositoryPattern
|
|||||||
this.btnReload.UseVisualStyleBackColor = true;
|
this.btnReload.UseVisualStyleBackColor = true;
|
||||||
this.btnReload.Click += new System.EventHandler(this.btnReload_Click);
|
this.btnReload.Click += new System.EventHandler(this.btnReload_Click);
|
||||||
//
|
//
|
||||||
// Form1
|
// rdbStock
|
||||||
|
//
|
||||||
|
this.rdbStock.AutoSize = true;
|
||||||
|
this.rdbStock.Checked = true;
|
||||||
|
this.rdbStock.Location = new System.Drawing.Point(98, 9);
|
||||||
|
this.rdbStock.Name = "rdbStock";
|
||||||
|
this.rdbStock.Size = new System.Drawing.Size(54, 19);
|
||||||
|
this.rdbStock.TabIndex = 1;
|
||||||
|
this.rdbStock.TabStop = true;
|
||||||
|
this.rdbStock.Text = "Stock";
|
||||||
|
this.rdbStock.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// rdbNorth
|
||||||
|
//
|
||||||
|
this.rdbNorth.AutoSize = true;
|
||||||
|
this.rdbNorth.Location = new System.Drawing.Point(7, 9);
|
||||||
|
this.rdbNorth.Name = "rdbNorth";
|
||||||
|
this.rdbNorth.Size = new System.Drawing.Size(84, 19);
|
||||||
|
this.rdbNorth.TabIndex = 0;
|
||||||
|
this.rdbNorth.Text = "NorthWind";
|
||||||
|
this.rdbNorth.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// 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, 450);
|
this.ClientSize = new System.Drawing.Size(800, 509);
|
||||||
this.Controls.Add(this.gB1);
|
this.Controls.Add(this.gB1);
|
||||||
this.Controls.Add(this.lblTotalRecords);
|
this.Controls.Add(this.lblTotalRecords);
|
||||||
this.Controls.Add(this.dataGridView);
|
this.Controls.Add(this.dataGridView);
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
this.Name = "Form1";
|
this.Name = "frmInitial";
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
this.Text = "Repository Pattern";
|
this.Text = "Repository Pattern";
|
||||||
this.Load += new System.EventHandler(this.Form1_Load);
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
@ -11,12 +11,12 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
namespace RepositoryPattern
|
namespace RepositoryPattern
|
||||||
{
|
{
|
||||||
public partial class Form1 : Form
|
public partial class frmInitial : Form
|
||||||
{
|
{
|
||||||
IProductRepository _productRepository;
|
IProductRepository _productRepository;
|
||||||
private readonly IStockMemberRepository _stockMemberRepository;
|
private readonly IStockMemberRepository _stockMemberRepository;
|
||||||
|
|
||||||
public Form1(IProductRepository productRepository,IStockMemberRepository stockMemberRepository)
|
public frmInitial(IProductRepository productRepository,IStockMemberRepository stockMemberRepository)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_productRepository = productRepository;
|
_productRepository = productRepository;
|
||||||
22
StockDomain/DiTraderStockRow.cs
Normal file
22
StockDomain/DiTraderStockRow.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StockDomain
|
||||||
|
{
|
||||||
|
public class DiTraderStockRow
|
||||||
|
{
|
||||||
|
public string StockName { get; set; }
|
||||||
|
public decimal ProcChange { get; set; }
|
||||||
|
public decimal RealChange { get; set; }
|
||||||
|
public decimal BuyPrice { get; set; }
|
||||||
|
public decimal SellPrice { get; set; }
|
||||||
|
public decimal LatestPrice { get; set; }
|
||||||
|
public decimal HighestPrice { get; set; }
|
||||||
|
public decimal LowestPrice { get; set; }
|
||||||
|
public long Volume { get; set; }
|
||||||
|
public TimeSpan TimeOfDay { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,7 +12,7 @@ namespace StockDomain
|
|||||||
public string StockExtId { get; set; }
|
public string StockExtId { get; set; }
|
||||||
public decimal BuyValue { get; set; }
|
public decimal BuyValue { get; set; }
|
||||||
public DateTime BuyDate { get; set; }
|
public DateTime BuyDate { get; set; }
|
||||||
public long BuytAmount { get; set; }
|
public long BuyAmount { get; set; }
|
||||||
public decimal ActValue { get; set; }
|
public decimal ActValue { get; set; }
|
||||||
public DateTime ActDate { get; set; }
|
public DateTime ActDate { get; set; }
|
||||||
public long ActAmount { get; set; }
|
public long ActAmount { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user