1
wtt
3 天以前 db658b16ef882ddcd56c4fea35aae42d0473b57d
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace MES
{
    public partial class Sc_CheckOver : Form
    {
        public Sc_CheckOver()
        {
            InitializeComponent();
        }
 
        public long HInterID;
        public int IsOk;
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
 
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            IsOk = 2;
            this.Close();
        }
 
        private void cmdOK_Click(object sender, EventArgs e)
        {
            IsOk = 1;
            Save("ºÏ¸ñ");
            this.Close();
        }
 
        private void Xs_SellOutDayReportDlg_Activated(object sender, EventArgs e)
        {
        }
 
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            IsOk = 0;
            Show();
        }
 
        private void Show()
        {
            DataSet oDs = new DataSet();
            oDs = oCn.RunProcReturn(" Select * From h_v_Sc_ProcessReportList where HMainID=" + HInterID.ToString(), "h_v_Sc_ProcessReportList");
            if (oDs == null || oDs.Tables[0].Rows.Count == 0)
                return;
            txtHBillNo.Tag = DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0]["HMainID"]);
            txtHBillNo.Text = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["µ¥¾ÝºÅ"]);
            txtHNumber.Tag = DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0]["HMaterID"]);
            txtHNumber.Text = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["ÎïÁÏ´úÂë"]);
            txtHName.Text = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["ÎïÁÏÃû³Æ"]);
            txtHModel.Text = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["¹æ¸ñÐͺÅ"]);
            txtHQty.Text = DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[0]["ÊýÁ¿"]).ToString();
            txtHBadCount.Text = DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[0]["²»Á¼ÊýÁ¿"]).ToString();
            txtHWasterQty.Text = DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[0]["±¨·ÏÊý"]).ToString();
        }
 
        private void Save(string status)
        {
            try
            {
                oCn.BeginTran();
                int HBillStatus = 0;
                if (status == "ºÏ¸ñ")
                {
                    HBillStatus = 16;
                }
                if (status == "²»ºÏ¸ñ")
                {
                    HBillStatus = 17;
                }
                oCn.RunProc(" update Sc_ProcessReportMain set HBillStatus=" + HBillStatus + ", HCheckStatus='" + status + "' where HInterID=" + HInterID.ToString());
                MessageBox.Show("¼ìÑéÅж¨³É¹¦£¡", "Ìáʾ");
                oCn.Commit();
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
 
        private void cmdNoOK_Click(object sender, EventArgs e)
        {
            IsOk = 1;
            Save("²»ºÏ¸ñ");
            this.Close();
        }
 
 
 
 
    }
}