private void AddTileFromCoronaData(CoronaData data, int tabIndex, int createIndex) { MetroTile tile = new MetroTile { ActiveControl = null, Name = $"Tile{data.StateDtFormat}", Size = new Size(370, 100), TabIndex = tabIndex++, Text = $"{data.StateDtLongFormat}", UseSelectable = true }; tile.Click += new EventHandler(CoronaTile_Click); if (createIndex == 0) { tile.Location = new Point(8, 8); tile.Dock = DockStyle.None; } else { tile.Dock = DockStyle.Top; } FlwpCorona.Controls.Add(tile); }
private List <CoronaData> CreateCoronaList(DataRowCollection rowCollection) { List <CoronaData> list = new List <CoronaData>(); foreach (DataRow row in rowCollection) { CoronaData data = CreateCoronaData(row); list.Add(data); } return(list); }
private void AddTiles(List <CoronaData> coronaDatas) { FlwpCorona.Controls.Clear(); int tabIndex = 3; for (int i = 0; i < coronaDatas.Count - 1; i++) { CoronaData data = coronaDatas[i]; AddTileFromCoronaData(data, tabIndex++, i); } }
private void CoronaTile_Click(object sender, EventArgs e) { MetroTile tile = sender as MetroTile; if (tile == null) { return; } CoronaData coronaData = FindCoronaData(tile); DgvDetail.DataSource = coronaData.GetDataTable(); MetroTabControl.SelectedTab = MtpDetail; }
private void DrawChart(List <CoronaData> datas) { foreach (var item in ChartNewCumal.Series) { item.Points.Clear(); } for (int i = datas.Count - 1; i > 0; i--) { CoronaData currentData = datas[i - 1]; CoronaData prevData = datas[i]; ChartNewCumal.Series["누적"].Points.AddXY(currentData.StateDtFormat, currentData.DecideCnt); ChartNewCumal.Series["신규"].Points.AddY(currentData.DecideCnt - prevData.DecideCnt); } }
private CoronaData CreateCoronaData(DataRow dataRow) { CoronaData data = new CoronaData() { AccDefRate = float.Parse(dataRow["accDefRate"].ToString()), AccExamCnt = int.Parse(dataRow["accExamCnt"].ToString()), AccExamCompCnt = int.Parse(dataRow["accExamCompCnt"].ToString()), CareCnt = int.Parse(dataRow["careCnt"].ToString()), ClearCnt = int.Parse(dataRow["clearCnt"].ToString()), CreateDt = DateTime.Parse(dataRow["createDt"].ToString()), DeathCnt = int.Parse(dataRow["deathCnt"].ToString()), DecideCnt = int.Parse(dataRow["decideCnt"].ToString()), ExamCnt = int.Parse(dataRow["examCnt"].ToString()), ResultLNegCnt = int.Parse(dataRow["resutlNegCnt"].ToString()), StateDt = DateTime.Parse(dataRow["stateDt"].ToString().Insert(4, "-").Insert(7, "-")) }; return(data); }