| | |
| | | this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; |
| | | this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | |
| | | txt_SampleSize1.Leave += txt_SampleSize1_Leave; |
| | | txt_SampleSize2.Leave += txt_SampleSize2_Leave; |
| | | // 添加抽样方法下拉框事件 |
| | | this.txt_SampleMethod.SelectedIndexChanged += Txt_SampleMethod_SelectedIndexChanged; |
| | | |
| | |
| | | // 设置GridView参数 |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gridView2); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gridView3); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) => |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "checkStatus", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }, tips); |
| | |
| | | if (comboBox != null) |
| | | { |
| | | string selectedValue = comboBox.Text.Trim(); |
| | | |
| | | int sampleSize = 0; |
| | | |
| | | if (selectedValue == "匀速") |
| | | { |
| | | // 选择匀速时:启用匀速抽样数,禁用随机抽样数 |
| | |
| | | txt_SampleSize2.Properties.ReadOnly = true; |
| | | txt_SampleSize2.Properties.Appearance.BackColor = Color.WhiteSmoke; |
| | | txt_SampleSize2.Text = ""; // 清空随机抽样数 |
| | | |
| | | if (int.TryParse(txt_SampleSize1.Text.Trim(), out int size)) |
| | | sampleSize = size; |
| | | } |
| | | else if (selectedValue == "随机") |
| | | { |
| | |
| | | txt_SampleSize1.Properties.ReadOnly = true; |
| | | txt_SampleSize1.Properties.Appearance.BackColor = Color.WhiteSmoke; |
| | | txt_SampleSize1.Text = ""; // 清空匀速抽样数 |
| | | |
| | | if (int.TryParse(txt_SampleSize2.Text.Trim(), out int size)) |
| | | sampleSize = size; |
| | | } |
| | | else |
| | | { |
| | |
| | | txt_SampleSize2.Properties.Appearance.BackColor = Color.WhiteSmoke; |
| | | txt_SampleSize2.Text = ""; |
| | | } |
| | | |
| | | UpdateGridViewColumns(sampleSize); |
| | | } |
| | | } |
| | | |
| | | private void UpdateGridViewColumns(int sampleSize) |
| | | { |
| | | if (sampleSize < 0 || sampleSize > 16) |
| | | return; |
| | | |
| | | // 获取所有值列(值1到值16) |
| | | var valueColumns = new[] |
| | | { |
| | | gridColumn11, // 值1 |
| | | gridColumn12, // 值2 |
| | | gridColumn13, // 值3 |
| | | gridColumn14, // 值4 |
| | | gridColumn15, // 值5 |
| | | gridColumn16, // 值6 |
| | | gridColumn18, // 值7 |
| | | gridColumn19, // 值8 |
| | | gridColumn36, // 值9 |
| | | gridColumn37, // 值10 |
| | | gridColumn38, // 值11 |
| | | gridColumn39, // 值12 |
| | | gridColumn40, // 值13 |
| | | gridColumn49, // 值14 |
| | | gridColumn50, // 值15 |
| | | gridColumn51 // 值16 |
| | | }; |
| | | |
| | | // 设置列的可见性 |
| | | for (int i = 0; i < valueColumns.Length; i++) |
| | | { |
| | | if (valueColumns[i] != null) |
| | | { |
| | | valueColumns[i].Visible = i < sampleSize; |
| | | } |
| | | } |
| | | |
| | | // 刷新GridView |
| | | gridView2.BestFitColumns(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | itemName = txt_ItemName.Text.Trim(), // 产品名称 |
| | | itemModel = txt_ItemModel.Text.Trim(), // 规格型号 |
| | | brand = txt_Brand.Text.Trim(), // 商标 |
| | | productionDate = txt_ProductionDate.Text.Trim(), // 生产日期 |
| | | productionDate = txt_productionDate.Text.Trim(), // 生产日期 |
| | | temperature = txt_Temperature.Text.Trim(), // 室温 |
| | | voltage = txt_Voltage.Text.Trim(), // 电压 |
| | | lineNo = txt_LineNo.Text.Trim(), // 线号 |
| | | batch = txt_Batch.Text.Trim(), // 批量 |
| | | classes = txt_Classes.Text.Trim(), // 班次 |
| | | checkResult = txt_CheckResult.Text.Trim(), // 检验结果 |
| | | acRe_A = txt_AcRe_A.Text.Trim(), // AC/Re A类 |
| | | acRe_B = txt_AcRe_B.Text.Trim(), // AC/Re B类 |
| | | acRe_C = txt_AcRe_C.Text.Trim(), // AC/Re C类 |
| | | checkResult = txt_checkResult.Text.Trim(), // 检验结果 |
| | | acRe_A = txt_acReA.Text.Trim(), // AC/Re A类 |
| | | acRe_B = txt_acReB.Text.Trim(), // AC/Re B类 |
| | | acRe_C = txt_acReC.Text.Trim(), // AC/Re C类 |
| | | processResults = txt_ProcessResults.Text.Trim(), // 处理结果 |
| | | sampleMethod = txt_SampleMethod.Text.Trim(), // 抽样 |
| | | sampleSize1 = txt_SampleSize1.Text.Trim(), // 匀速抽样数 |
| | | sampleSize2 = txt_SampleSize2.Text.Trim(), // 随机抽样数 |
| | | sampleSize3 = txt_SampleSize3.Text.Trim(), // 样本数 |
| | | jy_USER = txt_JY_USER.Text.Trim(), // 检验人 |
| | | jy_DATE = txt_JY_DATE.Text.Trim(), // 检验时间 |
| | | jy_USER = txt_jyUSER.Text.Trim(), // 检验人 |
| | | jy_DATE = txt_jyDATE.Text.Trim(), // 检验时间 |
| | | sp_USER = txt_SP_USER.Text.Trim(), // 审批人 |
| | | sp_DATE = txt_SP_DATE.Text.Trim(), // 审批日期 |
| | | remark = txt_Remark.Text.Trim(), // 备注 |
| | |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gridControl2, gridView3); |
| | | } |
| | | } |
| | | if (int.TryParse(txt_SampleSize1.Text.Trim(), out int size)) |
| | | { |
| | | UpdateGridViewColumns(size); |
| | | } |
| | | else |
| | | { |
| | | UpdateGridViewColumns(0); |
| | | } |
| | | } |
| | | else |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void txt_SampleSize1_Leave(object sender, EventArgs e) |
| | | { |
| | | if (txt_SampleMethod.Text.Trim() == "匀速") |
| | | { |
| | | if (int.TryParse(txt_SampleSize1.Text.Trim(), out int size)) |
| | | { |
| | | UpdateGridViewColumns(size); |
| | | } |
| | | else |
| | | { |
| | | UpdateGridViewColumns(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void txt_SampleSize2_Leave(object sender, EventArgs e) |
| | | { |
| | | if (txt_SampleMethod.Text.Trim() == "随机") |
| | | { |
| | | if (int.TryParse(txt_SampleSize2.Text.Trim(), out int size)) |
| | | { |
| | | UpdateGridViewColumns(size); |
| | | } |
| | | else |
| | | { |
| | | UpdateGridViewColumns(0); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |