1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using UAS_MES.Entity;
- using UAS_MES.DataOperate;
- namespace UAS_MES.CustomControl.TextBoxWithIcon
- {
- public partial class SnCollectionBox : EnterTextBox
- {
- public SnCollectionBox()
- {
- InitializeComponent();
- }
- DataHelper dh = SystemInf.dh;
- public override string Text
- {
- get
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (SystemInf.UpperCollection)
- return base.Text.ToUpper();
- else
- return base.Text;
-
- }
-
- set
- {
- base.Text = value;
- }
- }
- private void SnCollectionBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- if (SystemInf.GetRelation && base.Text != "")
- {
- string sn = dh.getFieldDataByCondition("SNRELATION_VIEW", "sr_sn", "content like '%" + base.Text + "%'").ToString();
- int count = int.Parse(dh.getFieldDataByCondition("SNRELATION_VIEW", "count(1) cn", "content like '%" + base.Text + "%'").ToString());
- if (sn == "" || count > 1)
- {
- MessageBox.Show("SN:" + base.Text + "未找到关联信息");
- base.Text = "";
- return ;
- }
- else
- {
- if (SystemInf.UpperCollection)
- base.Text = sn.ToUpper();
- else
- base.Text = sn;
- }
- }
- this.SelectAll();
- }
- }
- }
- }
|