//管柱设置--重置 private void ucBtnExt4_BtnClick(object sender, EventArgs e) { ucTextBoxEx28.InputText = ""; ucTextBoxEx27.InputText = ""; ucTextBoxEx26.InputText = ""; //套管 UCTextBoxEx temp = null; foreach (Control ctrl in this.panelEx7.Controls)//在这个面板中找到最新的label { int index = 200; while (index <= 205) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + index)) { temp = (HZH_Controls.Controls.UCTextBoxEx)ctrl; temp.InputText = ""; } index++; } } //钻杆 foreach (Control ctrl in this.panelEx5.Controls)//在这个面板中找到最新的label { int index = 36; while (index <= 50) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + index)) { temp = (HZH_Controls.Controls.UCTextBoxEx)ctrl; temp.InputText = ""; } index++; } } //钻铤 foreach (Control ctrl in this.panelEx6.Controls)//在这个面板中找到最新的label { int index = 100; while (index <= 114) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + index)) { temp = (HZH_Controls.Controls.UCTextBoxEx)ctrl; temp.InputText = ""; } index++; } } }
//管柱设置 private void ucBtnExt3_BtnClick(object sender, EventArgs e) { //环空容积 try { if (ucTextBoxEx28.InputText.Length != 0) { double hkrj = double.Parse(ucTextBoxEx28.InputText); u.SetValue(37, hkrj); } } catch (Exception excep) { FrmDialog.ShowDialog(this, "环空容积设置存在非法输入\n" + excep.Message, "输入提示"); return; } //裸眼段 try { if (ucTextBoxEx27.InputText.Length != 0) { double nj = double.Parse(ucTextBoxEx28.InputText); u.SetValue(35, nj); } if (ucTextBoxEx26.InputText.Length != 0) { double xs = double.Parse(ucTextBoxEx26.InputText); u.SetValue(36, xs); } } catch (Exception excep) { FrmDialog.ShowDialog(this, "裸眼段存在非法输入\n" + excep.Message, "输入提示"); return; } //套管 try { UCTextBoxEx temp = null; foreach (Control ctrl in this.panelEx7.Controls)//在这个面板中找到最新的label { int index = 200; while (index <= 205) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + index)) { temp = (HZH_Controls.Controls.UCTextBoxEx)ctrl; if (temp.InputText.Length != 0) { double value = double.Parse(temp.InputText); u.SetValue(index - 171, value); } } index++; } } } catch (Exception excep) { FrmDialog.ShowDialog(this, "套管存在非法输入\n" + excep.Message, "输入提示"); return; } //钻杆 try { UCTextBoxEx temp = null; foreach (Control ctrl in this.panelEx5.Controls)//在这个面板中找到最新的label { int index = 36; while (index <= 45) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + index)) { temp = (HZH_Controls.Controls.UCTextBoxEx)ctrl; if (temp.InputText.Length != 0) { double value = double.Parse(temp.InputText); u.SetValue(index + 2, value); } } index++; } } } catch (Exception excep) { FrmDialog.ShowDialog(this, "钻杆存在非法输入\n" + excep.Message, "输入提示"); return; } //钻铤 try { UCTextBoxEx temp = null; foreach (Control ctrl in this.panelEx6.Controls)//在这个面板中找到最新的label { int index = 100; while (index <= 114) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + index)) { temp = (HZH_Controls.Controls.UCTextBoxEx)ctrl; if (temp.InputText.Length != 0) { double value = double.Parse(temp.InputText); u.SetValue(index - 52, value); } } index++; } } } catch (Exception excep) { FrmDialog.ShowDialog(this, "钻铤存在非法输入\n" + excep.Message, "输入提示"); return; } FrmDialog.ShowDialog(this, "数据库更新成功", "输入提示"); FrmDialog.ShowDialog(this, "按照之前的表,钻杆最多两个、钻铤和套管最多三个", "输入提示"); }