public static long InsertHistoryBasicPID()
        {
            long id = -1;
            THistoryDataBasicManager objManager = new THistoryDataBasicManager();
            var dt = objManager.GetDataSetByWhere("order by ID DESC limit 1").Tables[0];

            if (dt.Rows.Count < 1)
            {
                return(0);
            }
            if (long.TryParse(dt.Rows[0]["ID"].ToString(), out id))
            {
                return(id + 1);
            }
            return(id);
        }
        public static THistoryDataBasic QueryProTestHisBasicInfo(string testSerial)
        {
            THistoryDataBasic hisBasicInfo = new THistoryDataBasic();

            if (testSerial == "")
            {
                return(hisBasicInfo);
            }
            THistoryDataBasicManager infoManager = new THistoryDataBasicManager();
            var dt = infoManager.GetDataSetByWhere($"where TestSerialNumber='{testSerial}'").Tables[0];

            if (dt.Rows.Count <= 0)
            {
                return(hisBasicInfo);
            }
            foreach (DataRow dr in dt.Rows)
            {
                hisBasicInfo.TestSerialNumber                   = testSerial;
                hisBasicInfo.ProjectName                        = dr["ProjectName"].ToString();
                hisBasicInfo.TestCableName                      = dr["TestCableName"].ToString();
                hisBasicInfo.TestStartDate                      = dr["TestStartDate"].ToString();
                hisBasicInfo.TestEndDate                        = dr["TestEndDate"].ToString();
                hisBasicInfo.TestOperator                       = dr["TestOperator"].ToString();
                hisBasicInfo.EnvironmentTemperature             = dr["EnvironmentTemperature"].ToString();
                hisBasicInfo.EnvironmentAmbientHumidity         = dr["EnvironmentAmbientHumidity"].ToString();
                hisBasicInfo.FinalTestResult                    = dr["FinalTestResult"].ToString();
                hisBasicInfo.ConductTestResult                  = dr["ConductTestResult"].ToString();
                hisBasicInfo.ConductThreshold                   = double.Parse(dr["ConductThreshold"].ToString());
                hisBasicInfo.ShortCircuitTestResult             = dr["ShortCircuitTestResult"].ToString();
                hisBasicInfo.ShortCircuitThreshold              = double.Parse(dr["ShortCircuitThreshold"].ToString());
                hisBasicInfo.InsulateTestResult                 = dr["InsulateTestResult"].ToString();
                hisBasicInfo.InsulateThreshold                  = double.Parse(dr["InsulateThreshold"].ToString());
                hisBasicInfo.InsulateVoltage                    = double.Parse(dr["InsulateVoltage"].ToString());
                hisBasicInfo.InsulateHoldTime                   = double.Parse(dr["InsulateHoldTime"].ToString());
                hisBasicInfo.VoltageWithStandardTestResult      = dr["VoltageWithStandardTestResult"].ToString();
                hisBasicInfo.VoltageWithStandardThreshold       = double.Parse(dr["VoltageWithStandardThreshold"].ToString());
                hisBasicInfo.ConductTestExceptCount             = int.Parse(dr["ConductTestExceptCount"].ToString());
                hisBasicInfo.ShortcircuitTestExceptCount        = int.Parse(dr["ShortcircuitTestExceptCount"].ToString());
                hisBasicInfo.InsulateTestExceptCount            = int.Parse(dr["InsulateTestExceptCount"].ToString());
                hisBasicInfo.VoltageWithStandardTestExceptCount = int.Parse(dr["VoltageWithStandardTestExceptCount"].ToString());
            }
            return(hisBasicInfo);
        }
Example #3
0
        private void QueryHistoryBasicInfo()
        {
            RadGridViewProperties.ClearGridView(this.radGridView1, null);
            var where = "";
            if (this.tb_queryFilter.Text.Trim() != "")
            {
                where = $"where ProjectName like '%{this.tb_queryFilter.Text}%' and TestStartDate >= '{this.dateTimePicker_start.Text}' and TestStartDate <= '{this.dateTimePicker_end.Text}'";
            }
            else
            {
                where = $"where TestStartDate >= '{this.dateTimePicker_start.Text}' and TestStartDate <= '{this.dateTimePicker_end.Text}'";
            }
            var dt = historyDataInfoManager.GetDataSetByWhere(where).Tables[0];

            if (dt.Rows.Count < 1)
            {
                return;
            }
            foreach (DataRow dr in dt.Rows)
            {
                var testSerial    = dr["TestSerialNumber"].ToString();
                var projectName   = dr["ProjectName"].ToString();
                var testCableName = dr["TestCableName"].ToString();
                var testTime      = dr["TestStartDate"].ToString();
                var tester        = dr["TestOperator"].ToString();
                var testResult    = dr["FinalTestResult"].ToString();
                if (IsExistTestProject(testSerial))
                {
                    continue;
                }
                this.radGridView1.Rows.AddNew();
                var rCount = this.radGridView1.RowCount;
                this.radGridView1.Rows[rCount - 1].Cells[0].Value = rCount;
                this.radGridView1.Rows[rCount - 1].Cells[1].Value = testSerial;
                this.radGridView1.Rows[rCount - 1].Cells[2].Value = projectName;
                this.radGridView1.Rows[rCount - 1].Cells[3].Value = testCableName;
                this.radGridView1.Rows[rCount - 1].Cells[4].Value = testTime;
                this.radGridView1.Rows[rCount - 1].Cells[5].Value = tester;
                this.radGridView1.Rows[rCount - 1].Cells[6].Value = testResult;
            }
        }
        private static string CalFinalTestResult(string project, string cableName, string testSerial)
        {
            THistoryDataBasicManager historyDataManage = new THistoryDataBasicManager();

            var where = $"where ProjectName = '{project}' and TestCableName = '{cableName}' and TestSerialNumber='{testSerial}'";
            var data = historyDataManage.GetDataSetByWhere(where).Tables[0];

            if (data.Rows.Count <= 0)
            {
                return("未测试");
            }
            var conductResult      = data.Rows[0]["ConductTestResult"].ToString();
            var shortCircuitResult = data.Rows[0]["ShortCircuitTestResult"].ToString();
            var insulateResult     = data.Rows[0]["InsulateTestResult"].ToString();

            if (conductResult == "合格" && shortCircuitResult == "合格" && insulateResult == "合格")
            {
                return("合格");
            }
            return("不合格");
        }