private bool IsInterUsed(string cableName) { TProjectBasicInfoManager libraryManager = new TProjectBasicInfoManager(); var data = libraryManager.GetDataSetByFieldsAndWhere("DISTINCT ProjectName", $"where TestCableName = '{cableName}'").Tables[0]; if (data.Rows.Count > 0) { return(true); } return(false); }
private void GroupTestStandardParams_Load(object sender, EventArgs e) { projectInfoManager = new TProjectBasicInfoManager(); lineStructLibraryDetailManager = new TCableTestLibraryManager(); RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, 12); this.radGridView1.ReadOnly = true; QueryLineCableInfo(); this.btn_apply.Click += Btn_apply_Click; this.btn_cancel.Click += Btn_cancel_Click; this.btn_batchModify.Click += Btn_batchModify_Click; this.btn_export.Click += Btn_export_Click; }
private void Init() { if (this.title != "") { this.Text = title; } projectInfo = new TProjectBasicInfo(); projectInfoManager = new TProjectBasicInfoManager(); lineStructLibraryDetailManager = new TCableTestLibraryManager(); RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, 5); QueryPlugLineStructInfo(); UpdateProjectInfo(); }
public static long InsertProjectBInfoPID() { long id = -1; TProjectBasicInfoManager objManager = new TProjectBasicInfoManager(); 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 TProjectBasicInfo QueryProjectInfo(string projectName) { TProjectBasicInfo projectInfo = new TProjectBasicInfo(); if (projectName == "") { return(projectInfo); } TProjectBasicInfoManager infoManager = new TProjectBasicInfoManager(); var dt = infoManager.GetDataSetByWhere($"where ProjectName='{projectName}'").Tables[0]; if (dt.Rows.Count < 1) { return(projectInfo); } foreach (DataRow dr in dt.Rows) { projectInfo.ProjectName = projectName; projectInfo.TestCableName = dr["TestCableName"].ToString(); projectInfo.ConductTestThreshold = double.Parse(dr["ConductTestThreshold"].ToString()); projectInfo.ConductTestVoltage = double.Parse(dr["ConductTestVoltage"].ToString()); projectInfo.ConductTestCurrentElect = double.Parse(dr["ConductTestCurrentElect"].ToString()); projectInfo.ShortCircuitTestThreshold = double.Parse(dr["ShortCircuitTestThreshold"].ToString()); projectInfo.InsulateTestThreshold = double.Parse(dr["InsulateTestThreshold"].ToString()); projectInfo.InsulateTestVoltage = double.Parse(dr["InsulateTestVoltage"].ToString()); projectInfo.InsulateTestRaiseTime = double.Parse(dr["InsulateTestRaiseTime"].ToString()); projectInfo.InsulateTestHoldTime = double.Parse(dr["InsulateTestHoldTime"].ToString()); projectInfo.VoltageWithStandardThreshold = double.Parse(dr["VoltageWithStandardThreshold"].ToString()); projectInfo.VoltageWithStandardHoldTime = double.Parse(dr["VoltageWithStandardHoldTime"].ToString()); projectInfo.VoltageWithStandardVoltage = double.Parse(dr["VoltageWithStandardVoltage"].ToString()); projectInfo.ResistanceCompensation = double.Parse(dr["ResistanceCompensation"].ToString()); projectInfo.InsulateVolCompensation = double.Parse(dr["InsulateVolCompensation"].ToString()); projectInfo.InsulateResCompensation = double.Parse(dr["InsulateResCompensation"].ToString()); projectInfo.Temperature = double.Parse(dr["Temperature"].ToString()); if (projectInfo.Temperature == 0) { projectInfo.Temperature = 25; } projectInfo.AmbientHumidity = double.Parse(dr["AmbientHumidity"].ToString()); if (projectInfo.AmbientHumidity == 0) { projectInfo.AmbientHumidity = 56; } } return(projectInfo); }
private void ProjectManage_Load(object sender, EventArgs e) { projectInfoManager = new TProjectBasicInfoManager(); RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, 6); this.radGridView1.ReadOnly = true; QueryProjectInfo(); InitFuncState(); this.tb_queryFilter.TextChanged += Tb_queryFilter_TextChanged; this.radGridView1.CellDoubleClick += RadGridView1_CellDoubleClick; this.btn_cancel.Click += Btn_cancel_Click; this.btn_openProject.Click += Btn_openProject_Click; this.btn_editProject.Click += Btn_editProject_Click; this.btn_deleteProject.Click += Btn_deleteProject_Click; this.menu_delAll.Click += Menu_delAll_Click; this.FormClosed += ProjectManage_FormClosed; }
private void FrmCableTestInfo_Load(object sender, EventArgs e) { if (this.proInfo.TestCableName == "") { TProjectBasicInfoManager infoManager = new TProjectBasicInfoManager(); var data = infoManager.GetDataSetByWhere($"where ProjectName = '{this.proInfo.ProjectName}'").Tables[0]; if (data.Rows.Count > 0) { this.proInfo.TestCableName = data.Rows[0]["TestCableName"].ToString(); } } if (this.proInfo.TestCableName != "") { this.Text = this.proInfo.TestCableName; } RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, 5); GetLineStructDetailData(this.proInfo.TestCableName); }