FrmAnalyze.cs 2.7 KB

using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineStore.AutoCountClient
{
    partial class FrmAnalyze : FrmBase
    {
        public FrmAnalyze()
        {
            InitializeComponent();
        }
        public static DateTime PreStartTime = new DateTime(0);
        public static DateTime PreEndTime = new DateTime(0);
        private void FrmAnalyze_Load(object sender, EventArgs e)
        {
            if (PreStartTime.Ticks > 0 && PreEndTime.Ticks > 0)
            {
                dtpStartTime.Value = PreStartTime;
                dtpEndTime.Value = PreEndTime;
            }
            else
            {
                DateTime time1 = DateTime.Now.AddDays(-4);
                dtpStartTime.Value = new DateTime(time1.Year, time1.Month, time1.Day, 0, 0, 0);
                DateTime time = DateTime.Now.AddDays(-1);
                dtpEndTime.Value = new DateTime(time.Year, time.Month, time.Day, 23, 59, 59);
                dtpEndTime.Value = DateTime.Now;
            }
        }


        private void btnSearch_Click(object sender, EventArgs e)
        {

            DateTime startTime = dtpStartTime.Value;
            DateTime endTime = dtpEndTime.Value;

            if (startTime < DateTime.Now.AddDays(-30))
            {
                MessageBox.Show("只能查询近30天的日志!");
                dtpStartTime.Focus();
                return;
            }
            if (endTime > DateTime.Now)
            {
                MessageBox.Show("只能查询近今天之前的日志!");
                dtpEndTime.Focus();
                return;
            }

            PreStartTime = startTime;
            PreEndTime = endTime;
            string code = txtCode.Text.Trim();

            string[][] array = null;
            bool result = RobotManager.robot.sQLite.Select(code, startTime.ToString(), endTime.ToLongTimeString(), out array);
            LogUtil.error("查数据【" + code + "】【" + startTime.ToString() + "】【" + endTime.ToLongTimeString() + "】结果:" + result + "," + RobotManager.robot.sQLite.ErrInfo);
            if (array != null && array.Length > 0)
            {

            }

        }



        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }


    public class XRayHistory
    {
        public string Code = "";

        public int Height = 0;

        public int Width = 0;

        public int Count = 0;

        public string FileName = "";
    }
}