1
jingh
2021-08-07 664453de41cf61be3024174f094b51b9b6acffd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace Kanban
{
    public partial class FrmICMOBillNo : Form
    {
        public FrmICMOBillNo()
        {
            InitializeComponent();
        }
 
        private void txtHICMOBillNo_KeyDown(object sender, KeyEventArgs e)
        {
            DataSet Ds;
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            long sICMOInterID = DBUtility.ClsPub.isLong(txtHICMOBillNo.Text.Trim());
            if (e.KeyCode == Keys.Return)
            {
                //得到信息
                Ds = oCn.RunProcReturn("select * from h_v_K3_ICMOBillList where hmainid=" + sICMOInterID.ToString() + " and hsubid=0", "h_v_K3_ICMOBillList");
                //写入信息
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    txtHICMOBillNo.Text = "";
                    MessageBox.Show("任务单内码错误,请重新扫描!");
                    return;
                }
                for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
                {
                    Sub_WriteInForm_SM(Ds.Tables[0], i);
                }
            }
        }
 
 
 
        //根据TABLE写入界面
        private void Sub_WriteInForm_SM(DataTable oTable, int i)
        {
            //
            this.txtHICMOBillNo.Tag = oTable.Rows[0]["HMainID"].ToString();
            this.txtHICMOBillNo.Text = oTable.Rows[0]["单据号"].ToString();
        }
 
        private void cmdOK_Click(object sender, EventArgs e)
        {
            this.Visible = false;
        }
 
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            this.Visible = false;
        }
 
        private void FrmICMOBillNo_Load(object sender, EventArgs e)
        {
            txtHICMOBillNo.Tag = "";
            txtHICMOBillNo.Text = "";
        }
 
 
 
 
    }
}