using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WorkM { public partial class Xs_SendGoodsPlan_MPS : Form { public Xs_SendGoodsPlan_MPS() { InitializeComponent(); } private void cmdOK_Click(object sender, EventArgs e) { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); SQLHelper.ClsCNK3 oK3Cn = new SQLHelper.ClsCNK3(); //µÃµ½Óû§ID Int64 HBillerID; DataSet DsBiller; string HSourceBillType = ""; DsBiller = oK3Cn.RunProcReturn("select top 1 fuserid from t_User where fname='" + DBUtility.ClsPub.CurUserName + "'", "t_User"); if (DsBiller.Tables[0].Rows.Count != 0) { HBillerID = DBUtility.ClsPub.isLong(DsBiller.Tables[0].Rows[0][0]); } else { HBillerID = 16394; } // DataSet Ds1; DataSet Ds2; //µÃµ½mainid Int64 HInterID = 0; //MPSÄÚÂë Int64 HRunInterID = 0; //ÔËËãÄÚÂë ÔËËãµ¥¾ÝºÅ=¡®MPS¡¯+ÔËËãÄÚÂë Ds1 = oK3Cn.RunProcReturn("declare @InterID int set @InterID=0 exec GetICMaxNum 'ICMrpResult', @InterID output, 1, " + HBillerID.ToString() + " select ltrim(@InterID)", "GetICMaxNum"); if (Ds1.Tables[0].Rows.Count != 0) { HInterID = DBUtility.ClsPub.isLong(Ds1.Tables[0].Rows[0][0]); } Ds2 = oK3Cn.RunProcReturn("declare @InterID int set @InterID=0 exec GetICMaxNum 'PlanCalc', @InterID output, 1, " + HBillerID.ToString() + " select ltrim(@InterID)", "GetICMaxNum"); if (Ds2.Tables[0].Rows.Count != 0) { HRunInterID = DBUtility.ClsPub.isLong(Ds2.Tables[0].Rows[0][0]); } //µÃµ½µ¥¾ÝºÅ string HBillNo; HBillNo = DBUtility.Xt_BaseBillFun.get_MaxBillNo_K3("500", oK3Cn); long HItemID = DBUtility.ClsPub.isLong(txtHBillNo.Tag); double HQty = DBUtility.ClsPub.isDoule(txtHQty.Text); //·¢»õ¼Æ»®ÄÚÂ룬MPSÄÚÂ룬MPSµ¥¾ÝºÅ£¬Éú³ÉÊýÁ¿£¬ÖƵ¥ÈË oCn.RunProc("exec h_p_Xs_SendGoodsPlan_MPS " + HItemID + "," + HInterID + ",'" + HBillNo + "'," + HQty + "," + HBillerID + "," + HRunInterID); MessageBox.Show("Éú³É³É¹¦£¡","Ìáʾ"); this.Close(); } private void tc_Click(object sender, EventArgs e) { this.Close(); } } }