锐腾搅拌上料功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
4.5 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using DevExpress.XtraEditors;
  9. using ICSSoft.Base.Config.AppConfig;
  10. using System.Data.Linq;
  11. using System.Linq;
  12. using ICSSoft.Base.Language.Tool;
  13. using System.Reflection;
  14. using ICSSoft.Base.Config.DBHelper;
  15. using ICSSoft.Base.ReferForm;
  16. using ICSSoft.Base.Report;
  17. using ICSSoft.Base.ReferForm.AppReferForm;
  18. using ICSSoft.Frame.Data.Entity;
  19. using ICSSoft.Frame.Data.BLL;
  20. namespace ICSSoft.Frame.APP
  21. {
  22. public partial class FormICSWareHouseLotAdd : DevExpress.XtraEditors.XtraForm
  23. {
  24. String guid = "";
  25. FormICSWareHouseLotInfoUIModel modellot;
  26. int flag;
  27. #region 构造函数
  28. public FormICSWareHouseLotAdd()
  29. {
  30. InitializeComponent();
  31. }
  32. public FormICSWareHouseLotAdd(FormICSWareHouseLotInfoUIModel lotmodel,string lotnoNew,string itemname)
  33. {
  34. InitializeComponent();
  35. modellot = lotmodel;
  36. txtLotNO.Properties.ReadOnly = true;
  37. txtLotQty.Properties.ReadOnly = true;
  38. txtItemName.Properties.ReadOnly = true;
  39. txtnewLotNO.Properties.ReadOnly = true;
  40. txtLotNO.Text = modellot.LotNO;
  41. txtLotQty.Text = Convert.ToString(modellot.LotQty);
  42. txtItemName.Text = itemname;
  43. txtnewLotNO.Text = lotnoNew;
  44. }
  45. #endregion
  46. #region 关闭 退出
  47. private void btnClose_Click(object sender, EventArgs e)
  48. {
  49. this.Close();
  50. }
  51. #endregion
  52. #region 移动窗体
  53. private const int WM_NCHITTEST = 0x84;
  54. private const int HTCLIENT = 0x1;
  55. private const int HTCAPTION = 0x2;
  56. //首先必须了解Windows的消息传递机制,当有鼠标活动消息时,
  57. //系统发送WM_NCHITTEST 消息给窗体作为判断消息发生地的根据。 nchittest
  58. //假如你点击的是标题栏,窗体收到的消息值就是 HTCAPTION ,
  59. //同样地,若接受到的消息是 HTCLIENT,说明用户点击的是客户区,也就是鼠标消息发生在客户区。
  60. //重写窗体,使窗体可以不通过自带标题栏实现移动
  61. protected override void WndProc(ref Message m)
  62. {
  63. //当重载窗体的 WndProc 方法时,可以截获 WM_NCHITTEST 消息并改些该消息,
  64. //当判断鼠标事件发生在客户区时,改写改消息,发送 HTCAPTION 给窗体,
  65. //这样,窗体收到的消息就时 HTCAPTION ,在客户区通过鼠标来拖动窗体就如同通过标题栏来拖动一样。
  66. //注意:当你重载 WndProc 并改写鼠标事件后,整个窗体的鼠标事件也就随之改变了。
  67. switch (m.Msg)
  68. {
  69. case WM_NCHITTEST:
  70. base.WndProc(ref m);
  71. if ((int)m.Result == HTCLIENT)
  72. m.Result = (IntPtr)HTCAPTION;
  73. return;
  74. }
  75. //拦截双击标题栏、移动窗体的系统消息
  76. if (m.Msg != 0xA3)
  77. {
  78. base.WndProc(ref m);
  79. }
  80. }
  81. #endregion
  82. #region 新增 修改
  83. private void save_Click(object sender, EventArgs e)
  84. {
  85. try
  86. {
  87. if (txtnumber.Text.Trim() == "")
  88. {
  89. ICSBaseSimpleCode.AppshowMessageBox("请输入分批数量");
  90. return;
  91. }
  92. if (Convert.ToDecimal(txtLotQty.Text.Trim())-Convert.ToDecimal(txtnumber.Text.Trim())<=0? true:false )
  93. {
  94. ICSBaseSimpleCode.AppshowMessageBox("分批数量要小于物料在库数量");
  95. return;
  96. }
  97. ICSPalletBLL.Fenpi(modellot, Convert.ToDecimal(txtnumber.Text), txtnewLotNO.Text, AppConfig.AppConnectString);
  98. ICSBaseSimpleCode.AppshowMessageBox("成功");
  99. }
  100. catch (Exception ex)
  101. {
  102. MessageBox.Show(ex.Message);
  103. }
  104. this.Close();
  105. this.DialogResult = DialogResult.Yes;
  106. }
  107. #endregion
  108. #region 取消
  109. private void can_Click(object sender, EventArgs e)
  110. {
  111. this.Close();
  112. }
  113. #endregion
  114. }
  115. }