using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; using UAS_MES_NEW.DataOperate; using UAS_MES_NEW.Entity; using UAS_MES_NEW.PublicMethod; namespace UAS_MES_NEW.Warehouse { public partial class Warehouse_ProdDetail : CustomControl.BaseForm.BaseForm { [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); public const int WM_SYSCOMMAND = 0x0112; public const int SC_MOVE = 0xF010; public const int HTCAPTION = 0x0002; DataTable dbfind; DataHelper dh; LogStringBuilder sql = new LogStringBuilder(); //页面Caller string caller; string pim_inoutno; string pd_piid; public Warehouse_ProdDetail(string pim_inoutno,string pd_piid) { dh = SystemInf.dh; InitializeComponent(); this.pim_inoutno = pim_inoutno; this.pd_piid = pd_piid; } private void Warehouse_ProdDetail_Load(object sender, EventArgs e) { sql.Clear(); sql.Append("select pr_orispeccode,pd_prodcode,pr_detail,outqty ,nvl((select count(1) from prodiomac where pim_inoutno='" + pim_inoutno+"' and pim_prodcode=pd_prodcode),0) getqty "); sql.Append("from (select pd_prodcode,sum(pd_outqty) outqty from prodiodetail "); sql.Append("where pd_piid='"+pd_piid+ "'group by pd_prodcode) left join product on pr_code=pd_prodcode"); dbfind = (DataTable)dh.ExecuteSql(sql.GetString(),"select"); BaseUtil.FillDgvWithDataTable(InOutDetailDGV, dbfind); for (int i = 0; i < InOutDetailDGV.Rows.Count; i++) { InOutDetailDGV.Rows[i].Cells["ungetqty"].Value = (int.Parse(InOutDetailDGV.Rows[i].Cells["outqty"].Value.ToString()) - int.Parse(InOutDetailDGV.Rows[i].Cells["getqty"].Value.ToString())).ToString(); } } private void headBar1_MouseDown(object sender, MouseEventArgs e) { ReleaseCapture(); SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); } } }