|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using CnasSynchrousModel;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
-
- namespace CNAS_DBSync
- {
- public partial class frmStartEndSubstring : Form
- {
- public CnasConditionMapValue conditionvalue { get; set; }
- public frmStartEndSubstring(CnasConditionMapValue conditionvalue)
- {
- InitializeComponent();
-
- this.conditionvalue = conditionvalue;
- }
-
- private void frmStartEndSubstring_Load(object sender, EventArgs e)
- {
- if (this.conditionvalue == null) return;
- if (this.conditionvalue.Value == null) return;
- if (this.conditionvalue.Condition != MapCondition.SubstringStartEnd) return;
-
- //根据旧值显示控件默认值
- if (this.conditionvalue.Value.ToString() != "")
- {
- string[] strConditionValues = this.conditionvalue.Value.ToString().Split(new string[] { "{", ",", "}" }, StringSplitOptions.RemoveEmptyEntries);
- if (strConditionValues.Length == 2)
- {
- this.txtPrama1.Text = strConditionValues[0];
- this.cbxPrama2.Text = strConditionValues[1];
- }
- }
- }
-
- private void btnOK_Click(object sender, EventArgs e)
- {
- if (this.txtPrama1.Text == "")
- {
- MessageBox.Show("参数1不能为空。");
- return;
- }
- if (this.cbxPrama2.Text == "")
- {
- MessageBox.Show("参数2不能为空。");
- return;
- }
- if (this.cbxPrama2.Text != "S" && this.cbxPrama2.Text != "E")
- {
- MessageBox.Show("参数2不符合规则,请重新选择。");
- return;
- }
-
- this.conditionvalue.Value = "{" + this.txtPrama1.Text + "," + this.cbxPrama2.Text + "}";
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
- }
- }
|