private void button2_Click(object sender, EventArgs e) { DataManager_D.writeLog("전체 선택함"); InfoView_D id = new InfoView_D(); id.ShowDialog(); }
//로그 데이터 받음 public static void writeLog(string contens) { string logContens = $"[{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")}]{contens}"; //로그내용 string date = $"[{DateTime.Now.ToString("yyyy_MM_dd")}]"; //로그이름txt DataManager_D.printLog(logContens, date); }
private void button6_Click(object sender, EventArgs e) { DataManager_D.writeLog("광주 선택함"); DataManager_D.AcctoTrainSttnList(DataManager_D.GWANGJU, "GWANGJU"); InfoView_D id = new InfoView_D(); id.ShowDialog(); }
private void button7_Click(object sender, EventArgs e) { DataManager_D.writeLog("울산 선택함"); DataManager_D.AcctoTrainSttnList(DataManager_D.ULSAN, "ULSAN"); InfoView_D id = new InfoView_D(); id.ShowDialog(); }
private void button5_Click(object sender, EventArgs e) { DataManager_D.writeLog("대전 선택함"); DataManager_D.AcctoTrainSttnList(DataManager_D.DAEJEON, "DAEJEON"); InfoView_D id = new InfoView_D(); id.ShowDialog(); }
private void button3_Click(object sender, EventArgs e) { DataManager_D.writeLog("서울 선택함"); DataManager_D.AcctoTrainSttnList(DataManager_D.SEOUL, "SEOUL"); InfoView_D id = new InfoView_D(); id.ShowDialog(); }
//정보 출력 private void infoClick_Click(object sender, EventArgs e) { DataManager_D.writeLog("조회 클릭"); if (trainComboStart.Text.Trim() != "" && trainComboEnd.Text.Trim() != "") { try { //도착역 확인 //지역선택 하였을때 if (DataManager_D.TrainSttnCode.Count > 0) { foreach (var item in DataManager_D.TrainSttnCode) { if (item.nodename == trainComboEnd.Text) { nodeidEnd = item.nodeid; Console.WriteLine(nodeidEnd); } } } //전체선택 하였을때 else { foreach (var item in DataManager_D.AllTrainCode) { if (item.nodename == trainComboEnd.Text) { nodeidEnd = item.nodeid; Console.WriteLine(nodeidEnd); } } } //출발역 확인 foreach (var item in DataManager_D.AllTrainCode) { if (item.nodename == trainComboStart.Text) { nodeidStart = item.nodeid; Console.WriteLine(nodeidStart); } } //데이터 출력하기위해 API 데이터 불러옴 DataManager_D.ShowInfo(nodeidStart, nodeidEnd, selectTrain()); dataGridView1.DataSource = null; dataGridView1.DataSource = DataManager_D.TrainInfo; arrPlaceLabel.Text = trainComboEnd.Text + "역 도착정보"; if (dataGridView1.RowCount == 0)//도착정보가 없을때 메세지 { MessageBox.Show("도착정보가 없습니다."); DataManager_D.writeLog("도착정보가 없습니다."); } } catch (Exception ex) { DataManager_D.writeLog(ex.Message); DataManager_D.writeLog(ex.StackTrace); throw; } } }