public SMA(DTO.DuLieuMaCK DLDK) { InitializeComponent(); ms = new BUS.Multi_Stock(); ms.ConvertFromDuLieuMaCk(DLDK); dldk = DLDK.LayDuLieu(); }
public void ConvertFromDuLieuMaCk(DTO.DuLieuMaCK Temp) { Stock StockTemp; foreach (DTO.DuLieuNgay i in Temp.LayDuLieu()) { if (this.Highest < i.GiaCaoNhat) { this.Highest = (float)i.GiaCaoNhat; } if (this.Lowest > i.GiaThapNhat) { this.Lowest = (float)i.GiaThapNhat; } StockTemp = new Stock(); StockTemp.High1 = (float)i.GiaCaoNhat; StockTemp.Low1 = (float)i.GiaThapNhat; StockTemp.Volume1 = (float)i.KhoiLuongGD; StockTemp.Open1 = (float)i.GiaMoCua; StockTemp.Close1 = (float)i.GiaDongCua; StockTemp.Date1 = i.Ngay; this.MultiStock.Add(StockTemp); this.size++; } }