frmPopInStockQtyDetail.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm.Control;
  10. using CoreFS.CA06;
  11. using Pur.Entity.ck;
  12. using Pur.Entity.configureEntity;
  13. using Pur.Entity;
  14. using com.hnshituo.pur.vo;
  15. namespace Pur.Pop_upWindow
  16. {
  17. public partial class frmPopInStockQtyDetail : FrmPmsBase
  18. {
  19. private string itemUnique;
  20. private string tabShow="0";
  21. public frmPopInStockQtyDetail()
  22. {
  23. InitializeComponent();
  24. }
  25. public frmPopInStockQtyDetail(OpeBase OB,String strItemUnique,string TabShow)
  26. {
  27. this.ob = OB;
  28. if (String.IsNullOrEmpty(strItemUnique))
  29. {
  30. MessageBox.Show("未选择物料!");
  31. }
  32. itemUnique = strItemUnique;
  33. tabShow = TabShow;
  34. InitializeComponent();
  35. }
  36. private void frmPopInStockQtyDetail_Load(object sender, EventArgs e)
  37. {
  38. init();
  39. }
  40. /// <summary>
  41. /// 初始化数据
  42. /// </summary>
  43. private void init()//初始化数据
  44. {
  45. try
  46. {
  47. this.Cursor = Cursors.WaitCursor;
  48. //默认选择的数tab
  49. if (tabShow == "0")
  50. {
  51. ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[0];
  52. }
  53. else
  54. {
  55. ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[1];
  56. }
  57. //查看库存
  58. dataTable1.Clear();
  59. CkStorage CkSto = new CkStorage();
  60. CkSto.Validflag = "1";
  61. CkSto.ItemUnique = itemUnique;
  62. CkSto.InvOrigQty = 0.0;
  63. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkStorageService", "find_Storage", new object[] { CkSto });
  64. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  65. //查看在途库存
  66. dataTable2.Clear();
  67. OrderC orderc = new OrderC();
  68. orderc.ItemUnique = itemUnique;
  69. orderc.Validflag = "1";
  70. orderc.DeleteName = "1";//仅查询在途库存大于0的
  71. DataTable dt11 = this.execute<DataTable>("com.hnshituo.pur.order.service.OrderCService", "doQueryOrderC", new object[] { orderc });
  72. GridHelper.CopyDataToDatatable(dt11, dataTable2, true);
  73. //查看物料
  74. string[] str = itemUnique.Split('@');
  75. String stritemCode = str[0];
  76. string stritemAttrId = str[1];
  77. string stritemstandardsId = str[2];
  78. string stritemUomId = str[3];
  79. if (!String.IsNullOrEmpty(stritemCode))
  80. {
  81. MatEntity mat = this.execute<MatEntity>("com.hnshituo.pur.configure.service.MatService", "findById", new object[] { stritemCode });
  82. if (mat != null)
  83. {
  84. txt_itemCode.Text = mat.ItemCode == null ? "" : mat.ItemCode;
  85. txt_itemName.Text = mat.ItemName == null ? "" : mat.ItemName;
  86. }
  87. }
  88. if (!string.IsNullOrEmpty(stritemAttrId))
  89. {
  90. PurMatAttrsEntity matAttr = this.execute<PurMatAttrsEntity>("com.hnshituo.pur.configure.service.MatAttrsService", "findById", new object[] { stritemAttrId });
  91. if (matAttr != null)
  92. {
  93. txt_itemAttr.Text = matAttr.ItemAttr == null ? "" : matAttr.ItemAttr;
  94. txt_itemAttrId.Text = matAttr.ItemAttrId == null ? "" : matAttr.ItemAttrId;
  95. }
  96. }
  97. if (!string.IsNullOrEmpty(stritemstandardsId))
  98. {
  99. PurStandardsEntity matStandards = this.execute<PurStandardsEntity>("com.hnshituo.pur.configure.service.MatStandardsService", "findById", new object[] { stritemstandardsId });
  100. if (matStandards != null)
  101. {
  102. txt_itemStandardsId.Text = matStandards.StandardsId == null ? "" : matStandards.StandardsId;
  103. txt_itemStandCode.Text = matStandards.StandardsCode == null ? "" : matStandards.StandardsCode;
  104. }
  105. }
  106. if (!string.IsNullOrEmpty(stritemUomId))
  107. {
  108. PurMatUomsEntity matUom = this.execute<PurMatUomsEntity>("com.hnshituo.pur.configure.service.MatUomsService", "findById", new object[] { stritemUomId });
  109. if (matUom != null)
  110. {
  111. }
  112. }
  113. }
  114. finally
  115. {
  116. this.Cursor = Cursors.Default;
  117. }
  118. }
  119. /// <summary>
  120. /// 刷新数据
  121. /// </summary>
  122. /// <param name="sender"></param>
  123. /// <param name="e"></param>
  124. private void btn_refresh_Click(object sender, EventArgs e)//刷新数据
  125. {
  126. init();
  127. }
  128. }
  129. }