private static DataTable QueryTestHisDetail(string testSerial)
        {
            #region init table
            DataTable dataSource = new DataTable();
            dataSource.Columns.Add("序号");
            dataSource.Columns.Add("起点接口");
            dataSource.Columns.Add("起点接点");
            dataSource.Columns.Add("终点接口");
            dataSource.Columns.Add("终点接点");
            dataSource.Columns.Add("导通电阻(Ω)");
            dataSource.Columns.Add("导通测试结果");
            dataSource.Columns.Add("短路测试(Ω)");
            dataSource.Columns.Add("短路测试结果");
            dataSource.Columns.Add("绝缘电阻(MΩ)");
            dataSource.Columns.Add("绝缘测试结果");
            //dataSource.Columns.Add("耐压电流(Ω)");
            //dataSource.Columns.Add("耐压测试结果");
            #endregion

            THistoryDataDetailManager detailManage = new THistoryDataDetailManager();
            var data = detailManage.GetDataSetByWhere($"where TestSerialNumber = '{testSerial}'").Tables[0];
            if (data.Rows.Count <= 0)
            {
                return(dataSource);
            }
            int iRow = 1;
            foreach (DataRow dataRow in data.Rows)
            {
                DataRow dr = dataSource.NewRow();
                dr["序号"]      = iRow;
                dr["起点接口"]    = dataRow["StartInterface"].ToString();
                dr["起点接点"]    = dataRow["StartContactPoint"].ToString();
                dr["终点接口"]    = dataRow["EndInterface"].ToString();
                dr["终点接点"]    = dataRow["EndContactPoint"].ToString();
                dr["导通电阻(Ω)"] = dataRow["ConductValue"].ToString();
                dr["导通测试结果"]  = dataRow["ConductTestResult"].ToString();
                dr["短路测试(Ω)"] = dataRow["ShortCircuitValue"].ToString();
                dr["短路测试结果"]  = dataRow["ShortCircuitTestResult"].ToString();
                double insulateVal;
                if (double.TryParse(dataRow["InsulateValue"].ToString(), out insulateVal))
                {
                    dr["绝缘电阻(MΩ)"] = (insulateVal / 1000000).ToString("f1");
                }
                else
                {
                    dr["绝缘电阻(MΩ)"] = "--";
                }
                dr["绝缘测试结果"] = dataRow["InsulateTestResult"].ToString();
                dataSource.Rows.Add(dr);
                iRow++;
            }
            return(dataSource);
        }
Beispiel #2
0
        private void RadTestDataDetail_Load(object sender, EventArgs e)
        {
            historyDataInfoManager   = new THistoryDataBasicManager();
            historyDataDetailManager = new THistoryDataDetailManager();
            RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, this.radGridView1.ColumnCount);
            QueryHistoryBasicInfo(false);

            this.menu_close.Click       += Menu_close_Click;
            this.menu_exportExcel.Click += Menu_exportExcel_Click;
            this.menu_printReport.Click += Menu_printReport_Click;
            this.menu_toReport.Click    += Menu_toReport_Click;
        }
        public static long InsertHistoryDetailPID()
        {
            int id = -1;
            THistoryDataDetailManager objManager = new THistoryDataDetailManager();
            var dt = objManager.GetDataSetByWhere("order by ID DESC limit 1").Tables[0];

            if (dt.Rows.Count < 1)
            {
                return(0);
            }
            if (int.TryParse(dt.Rows[0]["ID"].ToString(), out id))
            {
                return(id + 1);
            }
            else
            {
                LogHelper.Log.Error("Option His Detail PID FAILT..." + id);
            }
            return(id);
        }
Beispiel #4
0
        private void RadTestDataBasicInfo_Load(object sender, EventArgs e)
        {
            historyDataInfoManager   = new THistoryDataBasicManager();
            historyDataDetailManager = new THistoryDataDetailManager();

            this.dateTimePicker_start.Text = DateTime.Now.ToString("yyyy-MM-dd");
            this.dateTimePicker_end.Text   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, this.radGridView1.ColumnCount);
            QueryHistoryBasicInfo();
            InitFuncState();

            this.dateTimePicker_start.ValueChanged += DateTimePicker_start_ValueChanged;
            this.dateTimePicker_end.ValueChanged   += DateTimePicker_end_ValueChanged;
            this.tb_queryFilter.TextChanged        += Tb_queryFilter_TextChanged;
            this.menu_close.Click             += Menu_close_Click;
            this.menu_detail.Click            += Menu_detail_Click;
            this.menu_likeQuery.Click         += Menu_likeQuery_Click;
            this.menu_export.Click            += Menu_export_Click;
            this.menu_deleteData.Click        += Menu_deleteData_Click;
            this.radGridView1.CellDoubleClick += RadGridView1_CellDoubleClick;
        }