F_SAPIdnrk.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using Dongke.IBOSS.PRD.Basics.BaseControls;
  2. using Dongke.IBOSS.PRD.Basics.BaseResources;
  3. using Dongke.IBOSS.PRD.Client.CommonModule;
  4. using Dongke.IBOSS.PRD.Client.Controls.SearchBox;
  5. using Dongke.IBOSS.PRD.WCF.DataModels;
  6. using Dongke.IBOSS.PRD.WCF.Proxys;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. namespace Dongke.IBOSS.PRD.Client.Controls.SelectForm
  16. {
  17. public partial class F_SAPIdnrk : DKDockPanelBase
  18. {
  19. #region 构造函数
  20. public F_SAPIdnrk()
  21. {
  22. InitializeComponent();
  23. }
  24. #endregion
  25. #region 属性
  26. public string _IDNRK;
  27. public string _MEINS;
  28. public string _IDNRKNAME;
  29. #endregion
  30. #region 事件
  31. /// <summary>
  32. /// 查询
  33. /// </summary>
  34. /// <param name="sender"></param>
  35. /// <param name="e"></param>
  36. private void tsbtnSearch_Click(object sender, EventArgs e)
  37. {
  38. try
  39. {
  40. string IDNRK = this.txtIdnrk.Text.Trim();
  41. // 调用服务器端获取数据集
  42. ClientRequestEntity cre = new ClientRequestEntity();
  43. cre.NameSpace = "Hegii";
  44. cre.Name = "GetIdnrkCode";
  45. cre.Properties["IDNRK"] = this.txtIdnrk.Text.Trim();
  46. cre.Properties["IDNRKNAME"] = this.txtIdnrkName.Text.Trim();
  47. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  48. {
  49. return SAPDataModuleProxy.Service.DoRequest(cre);
  50. });
  51. if (sre.Status == Constant.ServiceResultStatus.Success)
  52. {
  53. // 查询成功
  54. this.dgvIdnrk.DataSource = sre.Data.Tables[0];
  55. this.tsbtnAdaptive_Click(null, null);
  56. if (this.dgvIdnrk.RowCount == 0)
  57. {
  58. DKMessageBox.ShowDialog(this, DKMessageCode.I_CMN_S_001);
  59. }
  60. }
  61. }
  62. catch (Exception ex)
  63. {
  64. // 对异常进行共通处理
  65. ExceptionManager.HandleEventException(this.ToString(),
  66. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  67. }
  68. }
  69. /// <summary>
  70. /// 自适应列宽
  71. /// </summary>
  72. /// <param name="sender"></param>
  73. /// <param name="e"></param>
  74. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  75. {
  76. this.dgvIdnrk.AutoResizeColumns();
  77. }
  78. /// <summary>
  79. /// 清空条件
  80. /// </summary>
  81. /// <param name="sender"></param>
  82. /// <param name="e"></param>
  83. private void tsbtnClear_Click(object sender, EventArgs e)
  84. {
  85. this.txtIdnrk.Text = null;
  86. }
  87. /// <summary>
  88. /// 取消
  89. /// </summary>
  90. /// <param name="sender"></param>
  91. /// <param name="e"></param>
  92. private void btnCancel_Click(object sender, EventArgs e)
  93. {
  94. this.Close();
  95. }
  96. /// <summary>
  97. /// 确认
  98. /// </summary>
  99. /// <param name="sender"></param>
  100. /// <param name="e"></param>
  101. private void btncheck_Click(object sender, EventArgs e)
  102. {
  103. DataGridViewRow currentRow = this.dgvIdnrk.CurrentRow;
  104. if (currentRow != null)
  105. {
  106. //this._invoiceLayoutID = Convert.ToInt32(currentRow.Cells["InvoiceLayoutID"].Value);
  107. _IDNRK = currentRow.Cells["IDNRK"].Value.ToString();
  108. _IDNRKNAME = currentRow.Cells["IDNRKNAME"].Value.ToString();
  109. _MEINS = currentRow.Cells["MEINS"].Value.ToString();
  110. this.DialogResult = DialogResult.OK;
  111. }
  112. }
  113. #endregion
  114. }
  115. }