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
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 WorkM
{
    public partial class Sc_ICMOBillList_K3Dlg : Form
    {
        public Sc_ICMOBillList_K3Dlg()
        {
            InitializeComponent();
        }
        public string sWhere = "";
 
        public int IsOk;
 
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            IsOk = 2;
            this.Visible = false;
        }
 
        private bool AllowOK()
        {
            if (DBUtility.ClsPub.isLong(txtHRoutingID.Tag) == 0)
            {
                MessageBox.Show("¹¤ÒÕ·Ïß²»ÄÜΪ¿Õ£¡");
                return false;
            }
            return true;
        }
 
        private void cmdOK_Click(object sender, EventArgs e)
        {
            if (!AllowOK())
            {
                return;
            }
            //
            IsOk = 1;
            this.Visible = false;
        }
 
        private void Sc_ICMOBillList_K3Dlg_Activated(object sender, EventArgs e)
        {
            IsOk = 0;
        }
 
        private void cmdHBDeptID_Click(object sender, EventArgs e)
        {
            DAL.Cls_S_Gy_RoutingBill oGy_RoutingBill = new DAL.Cls_S_Gy_RoutingBill();
            if (oGy_RoutingBill.Refresh(sWhere))  //Ñ¡ÔñÔ­µ¥
            {
                FillSelectData(oGy_RoutingBill.oBillSelectColl);
            }
        }
 
        private void txtHBDeptID_TextChanged(object sender, EventArgs e)
        {
            if (txtHRoutingID.Text.Trim() == "")
                txtHRoutingID.Tag = "0";
        }
 
        //
        private void FillSelectData(List<DBUtility.BillSelect> oList)
        {
            DataSet Ds;
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            int i = -1;
            foreach (DBUtility.BillSelect oSelectRow in oList)
            {
                i = i + 1;
                //¹¤ÒÕ·Ïß
                if (oSelectRow.BillType == "3301")
                {
                    //µÃµ½ÐÅÏ¢
                    Ds = oCn.RunProcReturn("select * from h_v_Gy_RoutingBillList  where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_Gy_RoutingBillList");
                    //дÈëÐÅÏ¢
                    Sub_WriteInForm(Ds.Tables[0], i);
                }
            }
        }
        //¸ù¾ÝTABLEдÈë½çÃæ
        private void Sub_WriteInForm(DataTable oTable, int i)
        {
            //¼ÓÔØ±íÍ·
            this.txtHRoutingID.Tag = oTable.Rows[0]["HMainID"].ToString();
            this.txtHRoutingID.Text = oTable.Rows[0]["¹¤ÒÕÃû³Æ"].ToString();
        }
 
 
 
 
 
    }
}