Warehouse_ProdDetail.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Runtime.InteropServices;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using UAS_MES_NEW.DataOperate;
  11. using UAS_MES_NEW.Entity;
  12. using UAS_MES_NEW.PublicMethod;
  13. namespace UAS_MES_NEW.Warehouse
  14. {
  15. public partial class Warehouse_ProdDetail : CustomControl.BaseForm.BaseForm
  16. {
  17. [DllImport("user32.dll")]
  18. public static extern bool ReleaseCapture();
  19. [DllImport("user32.dll")]
  20. public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
  21. public const int WM_SYSCOMMAND = 0x0112;
  22. public const int SC_MOVE = 0xF010;
  23. public const int HTCAPTION = 0x0002;
  24. DataTable dbfind;
  25. DataHelper dh;
  26. LogStringBuilder sql = new LogStringBuilder();
  27. //页面Caller
  28. string caller;
  29. string pim_inoutno;
  30. string pd_piid;
  31. public Warehouse_ProdDetail(string pim_inoutno,string pd_piid)
  32. {
  33. dh = SystemInf.dh;
  34. InitializeComponent();
  35. this.pim_inoutno = pim_inoutno;
  36. this.pd_piid = pd_piid;
  37. }
  38. private void Warehouse_ProdDetail_Load(object sender, EventArgs e)
  39. {
  40. sql.Clear();
  41. sql.Append("select pd_ordercode,pd_prodcode,pr_detail,outqty ,nvl((select count(1) from prodiomac where pim_inoutno='" + pim_inoutno+"' and pim_prodcode=pd_prodcode),0) getqty ");
  42. sql.Append("from (select pd_ordercode,pd_prodcode,sum(pd_outqty) outqty from prodiodetail ");
  43. sql.Append("where pd_piid='"+pd_piid+ "'group by pd_prodcode,pd_ordercode) left join product on pr_code=pd_prodcode");
  44. dbfind = (DataTable)dh.ExecuteSql(sql.GetString(),"select");
  45. BaseUtil.FillDgvWithDataTable(InOutDetailDGV, dbfind);
  46. for (int i = 0; i < InOutDetailDGV.Rows.Count; i++)
  47. {
  48. 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();
  49. }
  50. }
  51. private void headBar1_MouseDown(object sender, MouseEventArgs e)
  52. {
  53. ReleaseCapture();
  54. SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
  55. }
  56. }
  57. }