丸井供应商桌面条码生成程序
yxj
2021-10-20 bba8650eb94f7b5a7341ab7b6268ef4d9ee62877
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Pub_Class;
 
namespace SCM
{
    public partial class Gy_SourceBillList_Touch : Form
    {
        public Gy_SourceBillList_Touch()
        {
            InitializeComponent();
        }
        //定义
        public const Int16 HTagCol = 0;
        public const Int16 HSnoCol = 1;
        public const Int16 HMainIDCol = 2;
        public const Int16 HSubIDCol = 3;
        public const Int16 HMaterNumberCol = 4;
        public const Int16 HMaterNameCol = 5;
        public const Int16 HMaterModelCol = 6;
        public const Int16 HUnitNameCol = 7;
        public const Int16 HBatchNoCol = 8;
        public const Int16 HQtyCol = 9;
        public const Int16 HRelationQtyCol = 10;
 
        public frmBillQueryCondition_Base frmCondition;
        const string ModCaption = "源单列表";
        ClsGridViewSum oSumGrid = new ClsGridViewSum();
        public Int32 iTopRow = 0;//画横线
        SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
        //
 
        #region  固定代码
 
        //清空界面
        public void Sub_ClearBill()
        {
            cmbHSourceBillType.Items.Clear();
            //
            cmbHSourceBillType.Items.Add("生产订单");
            cmbHSourceBillType.Items.Add("生产汇报单");
            cmbHSourceBillType.Items.Add("收料通知单");
            cmbHSourceBillType.SelectedIndex = 0;
            //
            txtHSourceBillNo.Text = "";
            initGrid();
            txtHSourceBillNo.Focus();
        }
 
        private void Gy_SourceBillList_Touch_Load(object sender, EventArgs e)
        {
            //设置动态URL
            oWeb.Url = SCM.ClsPub1.WEBSURL;
            //
            frmCondition = new frmBillQueryCondition_Base();
            this.Text = ModCaption;
            //lblCaption.Text = ModCaption;
            oSumGrid.ogrdMain = grdMain;  //初始化 new
            oSumGrid.oGridsum = grdSum;
            initGrid();
            cmbHSourceBillType.SelectedIndex = 0;
        }
 
        //时间控件
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled=false;
            Sub_ClearBill();
        }
 
        private void timer2_Tick(object sender, EventArgs e)
        {
            timer2.Enabled = false;
        }
 
        private void grdMain_Paint(object sender, PaintEventArgs e)
        {
            GraphicsGrid();
        }
 
        private void GraphicsGrid()
        {
            //画底线
            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain);
            //画横线
            //DBUtility.Xt_BaseBillFun.GraphicsRowGrid(grdMain, iTopRow, iTopRow + 50, Fun_GetCol("hmainid"));
        }
 
        private Int32 Fun_GetCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain);
        }
 
        //保存列宽
        private void bclk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
        }
 
        //默认列宽
        private void mrlk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
        }
 
        #endregion
 
        #region 窗体处理方法
 
        //初始化GRID
        private void initGrid()
        {
            grdMain.RowCount = 0;
            grdMain.ColumnCount = 11;                       //总列数
            ClsPub1.initGridFst(grdMain, this.Name);
            //
            grdMain.Columns[HSnoCol].HeaderText = "序号";
            grdMain.Columns[HMaterNumberCol].HeaderText = "物料代码";
            grdMain.Columns[HMaterNameCol].HeaderText = "物料名称";
            grdMain.Columns[HMaterModelCol].HeaderText = "规格型号";
            grdMain.Columns[HUnitNameCol].HeaderText = "计量单位";
            grdMain.Columns[HBatchNoCol].HeaderText = "批次";
            grdMain.Columns[HQtyCol].HeaderText = "数量";
            grdMain.Columns[HRelationQtyCol].HeaderText = "未关联数量";
            //
            grdMain.Columns[HTagCol].Visible = false;
            grdMain.Columns[HMainIDCol].Visible = false;
            grdMain.Columns[HSubIDCol].Visible = false;
            //
            string sAllowCol = HTagCol.ToString();
            string sTotalCol = HTagCol.ToString();
            //格式化网格
            ClsPub1.initGridLast(sAllowCol, sTotalCol, oSumGrid);
            grdMain.RowTemplate.Height = 60;
            grdMain.RowTemplate.MinimumHeight = 60;
            grdMain.RowsDefaultCellStyle.Font = new Font("宋体", 22);
        }
 
        #endregion
 
 
        #region 返回源单信息
 
        //返回源单信息
        private void txtHSourceBillNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Return)
            {
                initGrid();
                Display();
                txtHSourceBillNo.Focus();
                txtHSourceBillNo.SelectAll();
            }
        }
 
        private void Display()
        {
            string HSourceBillNo = "";      //源单单号
            string HSourceBillType = "";    //源单类型
 
            HSourceBillNo = txtHSourceBillNo.Text.Trim();
            HSourceBillType = cmbHSourceBillType.Text;
 
            if (HSourceBillNo == "")
            {
                MessageBox.Show("源单单号不能为空!");
                return;
            }
 
            //得到信息
            DataSet DS = oWeb.getDataSetBySQL("exec h_p_SourceBillList_Touch '" + HSourceBillType + "','" + HSourceBillNo + "'", "h_p_SourceBillList_Touch", ref DBUtility.ClsPub.sExeReturnInfo);
 
            if (DS.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("没有找到相关源单信息!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            //写入信息
            for (int i = 0; i < DS.Tables[0].Rows.Count; i++)
            {
            Sub_WriteInForm(DS.Tables[0], i);
 
            }
        }
 
        //根据TABLE写入界面
        private void Sub_WriteInForm(DataTable oTable, int i)
        {
            if (i >= grdMain.RowCount - 1)
                grdMain.Rows.Add();
 
            grdMain.Rows[i].Cells[HSnoCol].Value = ClsPub.isStrNull(i + 1);
            grdMain.Rows[i].Cells[HMainIDCol].Value = oTable.Rows[i]["hmainid"].ToString();
            grdMain.Rows[i].Cells[HSubIDCol].Value = oTable.Rows[i]["hsubid"].ToString();
            grdMain.Rows[i].Cells[HMaterNumberCol].Value = oTable.Rows[i]["物料代码"].ToString();
            grdMain.Rows[i].Cells[HMaterNameCol].Value = oTable.Rows[i]["物料名称"].ToString();
            grdMain.Rows[i].Cells[HMaterModelCol].Value = oTable.Rows[i]["规格型号"].ToString();
            grdMain.Rows[i].Cells[HUnitNameCol].Value = oTable.Rows[i]["计量单位"].ToString();
            grdMain.Rows[i].Cells[HBatchNoCol].Value = oTable.Rows[i]["批次"].ToString();
            grdMain.Rows[i].Cells[HQtyCol].Value = oTable.Rows[i]["数量"].ToString();
            grdMain.Rows[i].Cells[HRelationQtyCol].Value = oTable.Rows[i]["未关联数量"].ToString();
        }
 
        #endregion
 
        //确定
        private void btnOK_Click(object sender, EventArgs e)
        {
 
        }
 
        //退出
        private void btnTC_Click(object sender, EventArgs e)
        {
 
        }
 
        //双击列表
        private void grdMain_DoubleClick(object sender, EventArgs e)
        {
 
        }
 
 
 
    }
}