ch
2022-08-15 b80c64014ae0b49c6762823dde13ae144d383994
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace PayM
{
    public partial class Pay_WorkTimesCardBill4 : Form
    {
        public int HCode;
        public string HPathBakServer;
        public string HHardDisk;
        public int HDelDays;
 
        public string HBDeptNumber;
        public string HEDeptNumber;
        public int HDeptType;    //ÎïÁ϶Î
        public int HSetType;    //ºËË㷽ʽ
        public int HYear;       //»á¼ÆÄê
        public int HPeriod;     //»á¼ÆÔÂ
 
        public Pay_WorkTimesCardBill4()
        {
            InitializeComponent();
        }
 
        private void Pay_WorkTimesCardBill4_Load(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            HCode=1;
            this.Hide();
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
            HCode = 2;
            this.Hide();
        }
 
        private void button3_Click(object sender, EventArgs e)
        {
            HCode = 3;
            this.Hide();
        }
 
        private void timer1_Tick(object sender, EventArgs e)
        {
             
            timer1.Enabled = false;
            SetMateStdPrice();
        }
 
        //ÅжϺËËãÐÅÏ¢
        private bool AllowBegin()
        {
            return true;
        }
        //ºËËã
        private void SetMateStdPrice()
        {
            if (!AllowBegin())
            {
                MessageBox.Show("ÄúÉèÖúËËãÐÅÏ¢ÓдíÎ󣬲»ÄܽøÐкËË㣡ÇëÓë¹ÜÀíÔ±ÁªÏµ");
                return;
            }
            SetMateStdPrice_CZ();
 
        }
        //°´²úÖµ
        private void SetMateStdPrice_CZ()
        {
            //µÃµ½ºËËãµÄ ²úÆ·ID£¬·ÑÓÃÏîÄ¿ID£¬±¾µ¥·ÑÓÃ=±¾ÆÚÈë¿â½ð¶î/±¾ÆÚÈë¿â×ܽð¶î*±¾ÆÚ·ÑÓýð¶î£¬×Ü·ÑÓ㬱ÈÀý=±¾µ¥·ÑÓÃ/±¾ÆÚ·ÑÓýð¶î
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            DataSet oDs;
            oDs = oCn.RunProcReturn("exec h_p_KQ_GetWorkTimesCardBill  " + HYear.ToString() + "," + HPeriod.ToString(), "gy_czygl");
            if (oDs == null || oDs.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("δ²éѯµ½¿¼ÇÚÊý¾Ý£¡");
                return;
            }
            //Çå¿Õ ±¾ÔÂÊý¾Ý
            //oCn.RunProc 
            //
            pb1.Maximum = oDs.Tables[0].Rows.Count;
            pb1.Value = 0;
            for (int i = 0; i < oDs.Tables[0].Rows.Count; i++)
            {
                System.Windows.Forms.Application.DoEvents();
 
                //ÐÂÔö¼Ç¼
                oCn.RunProc(" exec h_p_KQ_WorkTimesCardBill_Add  " + HYear.ToString() + "," + HPeriod.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[i]["¹¤ºÅ"]) + "'");
                System.Windows.Forms.Application.DoEvents();
                pb1.Value = i + 1;
                lblHMaterName.Text = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[i]["Ö°Ô±Ãû³Æ"]);
                lblHCount.Text = pb1.Value.ToString() + "/" + pb1.Maximum.ToString();
                System.Windows.Forms.Application.DoEvents();
            }
        }
       
    }
}