using DevExpress.XtraTreeList.Columns; using Million; using Million.DbManagement; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Million_Buyer.SubForm { public partial class IndicatorLoadForm : Form { public List> datas = null; int id = 0; public Dictionary selectData = null; public IndicatorLoadForm() { InitializeComponent(); Init(); } private void Init() { tl_Indicator.ClearNodes(); datas = DBConnection.QueryGetExcuter_RealTimeIndicator(); if (datas.Count > 0) { tl_Indicator.BeginUnboundLoad(); foreach (var item in datas) { tl_Indicator.AppendNode(new object[] { item["Id"], item["Name"], ((DateTime)item["SavedDateTime"]).ToString("yyyy-MM-dd HH:mm:ss"), item["BuyRegularExpression"], item["SellRegularExpression"] }, null); } tl_Indicator.EndUnboundLoad(); } } /// /// cancel 버튼 /// /// /// private void bt_Cancel_Click(object sender, EventArgs e) { this.Close(); } /// /// ok 버튼 /// /// /// private void bt_Ok_Click(object sender, EventArgs e) { try { var data = tl_Indicator.Selection.First(); if (data != null) { var strId = data["Id"].ToString(); selectData = datas.FirstOrDefault(t => t["Id"].ToString() == strId); this.DialogResult = DialogResult.OK; } this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void bt_Delete_Click(object sender, EventArgs e) { var strId = tl_Indicator.Selection.First()["Id"].ToString(); DBConnection.QueryUpdateExcuter(CommonProperty.DbConnectionResultData, "DELETE FROM [ResultData].[dbo].[RealTimeIndicator] WHERE Id = " + strId); Init(); } } }