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_MonthExpenseEntryBill4 : 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_MonthExpenseEntryBill4() { InitializeComponent(); } private void Pay_MonthExpenseEntryBill4_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(); SQLHelper.ClsCNK32 oCnXF = new SQLHelper.ClsCNK32(); DataSet oDs; oDs = oCnXF.RunProcReturn("exec h_p_Pay_GetMonthExpenseEntryBill " + HYear.ToString() + "," + HPeriod.ToString() + ",'" + HBDeptNumber + "','" + HEDeptNumber + "'", "gy_czygl"); if (oDs == null || oDs.Tables[0].Rows.Count == 0) { MessageBox.Show("δ²éѯµ½Ïû·ÑÊý¾Ý£¡"); return; } pb1.Maximum = oDs.Tables[0].Rows.Count; pb1.Value = 0; //ɾ³ý±¾ÆÚ¼Ç¼ oCn.RunProc("delete Pay_MonthExpenseEntryBill where HYear=" + HYear + " and HPeriod=" + HPeriod + " and (HDeptCode between '" + HBDeptNumber + "' and '" + HEDeptNumber + "') "); for (int i = 0; i < oDs.Tables[0].Rows.Count; i++) { System.Windows.Forms.Application.DoEvents(); //ÐÂÔö¼Ç¼ oCn.RunProc("insert into Pay_MonthExpenseEntryBill "+ "(HYear,HPeriod,HDeptCode,HDate,HMaker,HMakeDate "+ ",HRemark,HEmpCode,HEmpName,HExpenseType,HQty,HPrice,HMoney " + ") values " + "(" + HYear + "," + HPeriod + ",'" + DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[i]["HDeptID"]) + "','" + DBUtility.ClsPub.isDate(oDs.Tables[0].Rows[i]["Ïû·ÑÈÕÆÚ"]) + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + ",'Ïû·Ñ½ð¶îÅúÁ¿µ¼Èë','" + DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[i]["HUserNumber"]) + "','" + DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[i]["Ö°Ô±"]) + "','½ð¶î',1," + DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[i]["Ïû·Ñ½ð¶î"]) + "," + DBUtility.ClsPub.isDoule(oDs.Tables[0].Rows[i]["Ïû·Ñ½ð¶î"]) + ")"); System.Windows.Forms.Application.DoEvents(); pb1.Value = i + 1; lblHCount.Text = pb1.Value.ToString() + "/" + pb1.Maximum.ToString(); System.Windows.Forms.Application.DoEvents(); } } } }