Пример #1
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 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);
        }
        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("不合格");
        }
Пример #5
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;
        }