private void GetDartCodeInStockName() { ClsGetKoaStudioMethod clsGetKoaStudioMethod = new ClsGetKoaStudioMethod(); _dt = clsGetKoaStudioMethod.GetCodeListByMarketCallBackDataTable("999").Copy(); var Rows = from t1 in _dt.AsEnumerable() join t2 in _ds.Tables[0].AsEnumerable() on t1.Field <string>("STOCK_NAME") equals t2.Field <string>("corp_name") select new { STOCK_CODE = t1.Field <string>("STOCK_CODE").ToString().Trim(), STOCK_NAME = t1.Field <string>("STOCK_NAME").ToString().Trim(), corp_code = t2.Field <string>("corp_code").ToString().Trim(), corp_name = t2.Field <string>("corp_name").ToString().Trim() }; ClsDataGridViewUtil clsDataGridViewUtil = new ClsDataGridViewUtil(); int row = 0; clsDataGridViewUtil.RemoveGridViewRow(dgvList); foreach (var dr in Rows) { dgvList.Rows.Add(); dgvList.Rows[row].Cells["corp_code"].Value = dr.corp_code; dgvList.Rows[row].Cells["STOCK_CODE"].Value = dr.STOCK_CODE; dgvList.Rows[row].Cells["STOCK_NAME"].Value = dr.STOCK_NAME; row = row + 1; } }
public FrmCsvToDataGridView() { InitializeComponent(); SetDataGridView2(); ClsGetKoaStudioMethod clsGetKoaStudioMethod = new ClsGetKoaStudioMethod(); _dtStockCode = clsGetKoaStudioMethod.GetCodeListByMarketCallBackDataTable("999").Copy(); }
private void GetStockCodeFromStockMemo() { if (_dtStockList == null) { ClsGetKoaStudioMethod clsGetKoaStudioMethod = new ClsGetKoaStudioMethod(); _dtStockList = new DataTable(); _dtStockList = clsGetKoaStudioMethod.GetCodeListByMarketCallBackDataTable("999").Copy(); } string stockCode = ""; for (int i = 0; i < txtStockMemo.Lines.Length - 1; i++) { if (txtStockMemo.Lines[i].ToString().Trim() == "") { continue; } stockCode = ""; foreach (DataRow dr in _dtStockList.AsEnumerable().Where(Row => Row.Field <string>("STOCK_NAME") == txtStockMemo.Lines[i].ToString().Trim()).CopyToDataTable().Rows) { stockCode = dr["STOCK_CODE"].ToString(); break; } if (stockCode == "") { foreach (DataRow dr in _dtStockList.AsEnumerable().Where(Row => Row.Field <string>("STOCK_CODE") == txtStockMemo.Lines[i].ToString().Trim()).CopyToDataTable().Rows) { stockCode = dr["STOCK_CODE"].ToString(); break; } } if (stockCode != "") { ThemstStoreRecord(actionGb: "A", stockCode: stockCode); } } }
private void GetNewStockCode() { DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); RichQuery richQuery = new RichQuery(); ClsGetKoaStudioMethod clsGetKoaStudioMethod = new ClsGetKoaStudioMethod(); dt = richQuery.p_ScodeQuery(query: "1", stockCode: "", ybYongCode: "", bln3tier: false).Tables[0].Copy(); dt2 = clsGetKoaStudioMethod.GetCodeListByMarketCallBackDataTable(stockGb: "999"); int row = 0; string stockName = ""; dgv1.DataSource = dt; var rows = from t1 in dt2.AsEnumerable() join t2 in dt.AsEnumerable() on t1.Field <string>("STOCK_CODE") equals t2.Field <string>("STOCK_CODE") into tg from tcheck in tg.DefaultIfEmpty() where tcheck == null select t1; foreach (DataRow dr in rows) { if (dr["STOCK_CODE"].ToString().Trim() == "") { continue; } stockName = ClsAxKH.GetMasterCodeName(dr["STOCK_CODE"].ToString()); if (stockName.Contains("스팩") == true) { continue; } if (stockName.Contains("KOSEF") == true) { continue; } if (stockName.Contains("일본") == true) { continue; } if (stockName.Contains("TIGER") == true) { continue; } if (stockName.Contains("KBSTAR") == true) { continue; } if (stockName.Contains("KINDEX") == true) { continue; } if (stockName.Contains("국고") == true) { continue; } if (stockName.Contains("단기") == true) { continue; } if (stockName.Contains("선물") == true) { continue; } if (stockName.Contains("나스닥") == true) { continue; } if (stockName.Contains("ARIRANG") == true) { continue; } if (stockName.Contains("HANARO") == true) { continue; } if (stockName.Contains(" ETN") == true) { continue; } if (stockName.Contains("KODEX") == true) { continue; } if (stockName.Contains("QV ") == true) { continue; } if (stockName.Contains("TRUE ") == true) { continue; } if (stockName.Contains("미래에셋 ") == true) { continue; } if (stockName.Contains("삼성 ") == true) { continue; } if (stockName.Contains("신한 ") == true) { continue; } if (stockName.Contains("FOCUS ") == true) { continue; } if (stockName.Contains("SMART ") == true) { continue; } if (stockName.Contains("TREX ") == true) { continue; } if (stockName.Contains("파워 ") == true) { continue; } if (stockName.Contains("흥국 ") == true) { continue; } dgv0.Rows.Add(); dgv0.Rows[row].Cells["STOCK_CODE"].Value = dr["STOCK_CODE"].ToString(); dgv0.Rows[row].Cells["STOCK_NAME"].Value = stockName; row = row + 1; } }