using ProjectManagementSystem.Common.Core;
using ProjectManagementSystem.Common.Extenions;
using ProjectManagementSystem.Common.Logger;
using ProjectManagementSystem.Common.WebApi;
using ProjectManagementSystem.Device.CommandCallback;
using ProjectManagementSystem.Device.Extenions;
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 ProjectManagementSystem.UI
{
    public partial class DebugPackUI : UserControl, IDisplayUI
    {
        public DebugPackUI()
        {
            InitializeComponent();
        }

        public bool Init()
        {
            dataGridUI1.dataGridView1.CellClick += DataGridView1_CellClick;
            return true;
        }

        private void DataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            textBox1.Text = dataGridUI1.GetCurrentColValue("Id");
        }

        public void UpdateDisplay()
        {
            if (!this.Visible) return;

            var dataList = PackControl.Instance.StationDictionary.Values.OrderBy(d => d.Id).ToList();
            dataGridUI1.ShowDataGrid(dataList);
        }




    }
}
