Query_BadSearch.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.Query
  14. {
  15. public partial class Query_BadSearch : 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. DataHelper dh;
  30. LogStringBuilder sql = new LogStringBuilder();
  31. string msid;
  32. double badqty;
  33. string macode;
  34. public Query_BadSearch(string msid, double badqty, string macode)
  35. {
  36. dh = SystemInf.dh;
  37. InitializeComponent();
  38. this.msid = msid;
  39. this.badqty = badqty;
  40. this.macode = macode;
  41. }
  42. private void Warehouse_ProdDetail_Load(object sender, EventArgs e)
  43. {
  44. FillDataGridView();
  45. }
  46. private void headBar1_MouseDown(object sender, MouseEventArgs e)
  47. {
  48. ReleaseCapture();
  49. SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
  50. }
  51. private void BatchProductDGV_CellContentClick66(object sender, DataGridViewCellEventArgs e)
  52. {
  53. if (BatchProductDGV.Columns[e.ColumnIndex].Name == "DeleteRow")
  54. {
  55. if (e.RowIndex >= 0)
  56. {
  57. string id = BatchProductDGV.Rows[e.RowIndex].Cells["msd_id"].Value.ToString();
  58. }
  59. }
  60. }
  61. private void FillDataGridView()
  62. {
  63. sql.Clear();
  64. sql.Append("select msd_id,msd_msid,msd_badname,msd_qty,msd_indate,msd_status,msd_stepcode from MES_STEPREPORTdet ");
  65. sql.Append("where msd_msid = '" + msid + "' and msd_stepcode = '" + User.CurrentStepCode + "' and msd_status = 0");
  66. DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
  67. BaseUtil.FillDgvWithDataTable(BatchProductDGV, dt);
  68. }
  69. }
  70. }