using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HOZProject
{
    public partial class UControl_Log : UserControl
    {
        public UControl_Log()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            Form fParent = this.ParentForm;
            fParent.Close();
        }
        public void ShowProcessLogInfo(string[] strLog)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Time");
            dt.Columns.Add("Name");
            dt.Columns.Add("State");
            foreach (string strItem in strLog)
            {
                string[] Nt = strItem.Split('_');
                DataRow dr = dt.NewRow();
                dr[0] = Nt[0];
                dr[1] = Nt[1];
                dr[2] = "1";
                dt.Rows.Add(dr);
            }
            dgvLog.DataSource = dt;
            lblLogCount.Text = dt.Rows.Count.ToString()+"条";
        }

        private void dgvLog_SelectionChanged(object sender, EventArgs e)
        {
            dgvLog.ClearSelection();
        }
    }
}
