using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Text;
|
using System.Windows.Forms;
|
|
namespace EAM
|
{
|
public partial class Sc_MouldCost4 : 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=0; //ºËË㷽ʽ
|
public int HYear; //»á¼ÆÄê
|
public int HPeriod; //»á¼ÆÔÂ
|
|
public Sc_MouldCost4()
|
{
|
InitializeComponent();
|
}
|
|
private void Sc_MouldCost4_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;
|
}
|
//ºËËãÀàÐÍ
|
switch (HSetType)
|
{
|
case 0://°´²úÖµ
|
SetMateStdPrice_CZ();
|
break;
|
case 1://°´²úÁ¿
|
break;
|
case 2://×îÐÂ
|
break;
|
default:
|
break;
|
}
|
|
}
|
//°´²úÖµ
|
private void SetMateStdPrice_CZ()
|
{
|
//µÃµ½ºËËãµÄ ²úÆ·ID£¬·ÑÓÃÏîÄ¿ID£¬±¾µ¥·ÑÓÃ=±¾ÆÚÈë¿â½ð¶î/±¾ÆÚÈë¿â×ܽð¶î*±¾ÆÚ·ÑÓýð¶î£¬×Ü·ÑÓ㬱ÈÀý=±¾µ¥·ÑÓÃ/±¾ÆÚ·ÑÓýð¶î
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
DataSet oDs;
|
oDs = oCn.RunProcReturn("exec h_p_Sc_MouldCost " + HYear + "," + HPeriod, "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 Sc_MouldItemMoneyCost where HYear=" + HYear + " and HPeriod=" + HPeriod);
|
for (int i = 0; i < oDs.Tables[0].Rows.Count; i++)
|
{
|
System.Windows.Forms.Application.DoEvents();
|
|
//ÐÂÔö¼Ç¼
|
oCn.RunProc("insert into Sc_MouldItemMoneyCost " + "(HYear,HPeriod,HMaterID,HQty,HPrice" +
|
",HMoney,HSumMoney,hrate,HMaker,HMakeDate" +
|
")values(" + HYear + "," + HPeriod + "," + oDs.Tables[0].Rows[i]["HMaterID"].ToString() +
|
"," + oDs.Tables[0].Rows[i]["HQty"].ToString() + "," + oDs.Tables[0].Rows[i]["HPrice"].ToString() +
|
"," + oDs.Tables[0].Rows[i]["HMoney"].ToString() + "," + oDs.Tables[0].Rows[i]["HSumMoney"].ToString() + "," + oDs.Tables[0].Rows[i]["hrate"].ToString() +
|
",'" + DBUtility.ClsPub.CurUserName + "','" + DateTime.Today + "'" +
|
")");
|
System.Windows.Forms.Application.DoEvents();
|
pb1.Value = i + 1;
|
lblHCount.Text = pb1.Value.ToString() + "/" + pb1.Maximum.ToString();
|
System.Windows.Forms.Application.DoEvents();
|
}
|
}
|
|
}
|
}
|