frmPopActualSeat.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 Core.Mes.Client.Comm.Tool;
  11. using CoreFS.CA06;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Pur.Entity;
  14. using Pur.Entity.configureEntity;
  15. namespace Pur.Pop_upWindow
  16. {
  17. public partial class frmPopActualSeat : FrmPmsBase
  18. {
  19. private string deliveryLocation;
  20. private string deliveryLocationCode;
  21. private string tips;
  22. public string Tips
  23. {
  24. get { return tips; }
  25. set { tips = value; }
  26. }
  27. private string isJit="0";
  28. public string DeliveryLocationCode
  29. {
  30. get { return deliveryLocationCode; }
  31. set { deliveryLocationCode = value; }
  32. }
  33. public string DeliveryLocation
  34. {
  35. get { return deliveryLocation; }
  36. set { deliveryLocation = value; }
  37. }
  38. public frmPopActualSeat()
  39. {
  40. InitializeComponent();
  41. }
  42. public frmPopActualSeat(OpeBase OB,String strIsJit)
  43. {
  44. this.isJit = strIsJit;
  45. this.ob = OB;
  46. InitializeComponent();
  47. }
  48. //load
  49. private void frmPopActualSeat_Load(object sender, EventArgs e)
  50. {
  51. init();
  52. }
  53. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  54. {
  55. switch (e.Tool.Key)
  56. {
  57. case "doRefresh": // ButtonTool
  58. init();
  59. break;
  60. case "doSure": // ButtonTool
  61. doSure();
  62. break;
  63. case "doClear": // ButtonTool
  64. doClear();
  65. break;
  66. case "doClose": // ButtonTool
  67. this.Close();
  68. break;
  69. }
  70. }
  71. //清空
  72. private void doClear()
  73. {
  74. deliveryLocation="";
  75. deliveryLocationCode="";
  76. tips = "1";
  77. this.Close();
  78. }
  79. //选择
  80. private void doSure()
  81. {
  82. UltraGridRow row = ultraGrid1.ActiveRow;
  83. getData(row);
  84. }
  85. //选择行
  86. private void getData(UltraGridRow row)
  87. {
  88. try
  89. {
  90. if (row == null)
  91. {
  92. MessageUtil.ShowTips("请选交付地点");
  93. return;
  94. }
  95. String strdeliveryLocation = row.GetCellValue("invPhysicName").ToString().Trim();
  96. String strdeliveryLocationCode = row.GetCellValue("invPhysic").ToString().Trim();
  97. if (String.IsNullOrEmpty(strdeliveryLocation) && String.IsNullOrEmpty(strdeliveryLocationCode))
  98. {
  99. MessageUtil.ShowTips("数据异常,交付地点和地点编码都不能空");
  100. return;
  101. }
  102. deliveryLocation = strdeliveryLocation;
  103. deliveryLocationCode = strdeliveryLocationCode;
  104. tips = "1";
  105. this.Close();
  106. }
  107. catch (Exception ex)
  108. {
  109. MessageUtil.ShowTips("操作失败:"+ex);
  110. }
  111. }
  112. //加载数据
  113. private void init()
  114. {
  115. try
  116. {
  117. this.Cursor = Cursors.WaitCursor;
  118. tips = "0";
  119. dataSet1.Clear();
  120. PhysicSeatEntity Phouse = new PhysicSeatEntity();
  121. Phouse.Validflag = "1";
  122. Phouse.InvPhysic = tbxPhysicQ.Text.ToString().Trim();
  123. Phouse.InvPhysicName = tbxPhysicNameQ.Text.ToString().Trim();
  124. if (isJit != "0")
  125. {
  126. Phouse.OrgId = UserInfo.GetDeptid();
  127. }
  128. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.ActualSeatService", "getActualSeat", new object[] { Phouse, 0, 0 });
  129. if (dt != null)
  130. {
  131. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  132. }
  133. }
  134. catch (Exception ex)
  135. {
  136. MessageBox.Show("查询失败:" + ex.Message);
  137. }
  138. finally
  139. {
  140. this.Cursor = Cursors.Default;
  141. }
  142. }
  143. //双击选择
  144. private void ultraGrid1_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e)
  145. {
  146. //UltraGridRow row = e.Cell.Row;
  147. getData(e.Cell.Row);
  148. }
  149. }
  150. }