CNAS取数仪器端升级
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

65 строки
2.1KB

  1. using CnasSynchrousModel;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. namespace CNAS_DBSync
  11. {
  12. public partial class frmSplitParam : Form
  13. {
  14. public CnasConditionMapValue conditionvalue { get; set; }
  15. public frmSplitParam(CnasConditionMapValue conditionvalue)
  16. {
  17. InitializeComponent();
  18. this.conditionvalue = conditionvalue;
  19. }
  20. private void btnOK_Click(object sender, EventArgs e)
  21. {
  22. if (this.txtPrama1.Text == "")
  23. {
  24. MessageBox.Show("参数1不能为空。");
  25. return;
  26. }
  27. if (this.cbxPrama2.Text == "")
  28. {
  29. MessageBox.Show("参数2不能为空。");
  30. return;
  31. }
  32. if (this.cbxPrama2.Text != "L" && this.cbxPrama2.Text != "R")
  33. {
  34. MessageBox.Show("参数2不符合规则,请重新选择。");
  35. return;
  36. }
  37. this.conditionvalue.Value = "{"+ this.txtPrama1.Text + ","+ this.cbxPrama2.Text + "}";
  38. this.DialogResult = DialogResult.OK;
  39. this.Close();
  40. }
  41. private void frmSplitParam_Load(object sender, EventArgs e)
  42. {
  43. if (this.conditionvalue == null) return;
  44. if (this.conditionvalue.Value == null) return;
  45. if (this.conditionvalue.Condition != MapCondition.SubString) return;
  46. //根据旧值显示控件默认值
  47. if (this.conditionvalue.Value.ToString()!= "")
  48. {
  49. string[] strConditionValues = this.conditionvalue.Value.ToString().Split(new string[] { "{",",","}" }, StringSplitOptions.RemoveEmptyEntries);
  50. if (strConditionValues.Length == 2)
  51. {
  52. this.txtPrama1.Text = strConditionValues[0];
  53. this.cbxPrama2.Text = strConditionValues[1];
  54. }
  55. }
  56. }
  57. }
  58. }