Make_NewPo.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.Make
  14. {
  15. public partial class Make_NewPo : CustomControl.BaseForm.BaseForm
  16. {
  17. //所有用到了headBar的部分都需要这段代码
  18. [DllImport("user32.dll")]
  19. public static extern bool ReleaseCapture();
  20. [DllImport("user32.dll")]
  21. public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
  22. [DllImport("user32.dll", EntryPoint = "GetWindowLong", CharSet = CharSet.Auto)]
  23. public static extern int GetWindowLong(HandleRef hWnd, int nIndex);
  24. [DllImport("user32.dll", EntryPoint = "SetWindowLong", CharSet = CharSet.Auto)]
  25. public static extern IntPtr SetWindowLong(HandleRef hWnd, int nIndex, int dwNewLong);
  26. public const int WM_SYSCOMMAND = 0x0112;
  27. public const int SC_MOVE = 0xF010;
  28. public const int HTCAPTION = 0x0002;
  29. /// <summary>
  30. /// 序列号
  31. /// </summary>
  32. string sncode = "";
  33. /// <summary>
  34. /// 工单号
  35. /// </summary>
  36. string macode = "";
  37. string licode = "";
  38. DataHelper dh;
  39. DataTable dt;
  40. LogStringBuilder sql = new LogStringBuilder();
  41. public Make_NewPo(string iMakeCode,string iLicode)
  42. {
  43. InitializeComponent();
  44. macode = iMakeCode;
  45. licode = iLicode;
  46. }
  47. private void Make_NewBadCode_Load(object sender, EventArgs e)
  48. {
  49. dh = SystemInf.dh;
  50. sql.Clear();
  51. //sql.Append("select nvl(mss_makecode,' ') mss_makecode,mss_linecode,sp_fsoncode,nvl(mss_id,0) mss_id,sp_soncode,mss_prodcode,sp_oneuseqty,mss_barcode,nvl(mss_qty,0) mss_qty ,nvl(mss_remain,0)mss_remain,");
  52. //sql.Append("pr_detail,nvl(mss_useqty,0) mss_useqty from stepbom left join stepproduct on sp_sbid=sb_id left join product on ");
  53. //sql.Append("pr_code=sp_mothercode left join makesourcestock on mss_craftcode=sb_craftcode ");
  54. //sql.Append("and mss_stepcode=sp_stepcode and sp_soncode=mss_prodcode and sp_fsoncode=mss_fprodcode where ");
  55. //sql.Append(" sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=2 and mss_linecode = '" + User.UserLineCode + "' order by sp_soncode");
  56. sql.Append("select * from MAKESOURCESTOCK_SUM_VIEW where mss_makecode = '" + macode + "' and mss_linecode = '" + licode + "'");
  57. DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
  58. BaseUtil.FillDgvWithDataTable(BatchProductDGV, dt);
  59. }
  60. private void headBar1_MouseDown(object sender, MouseEventArgs e)
  61. {
  62. ReleaseCapture();
  63. SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
  64. }
  65. }
  66. }