frmSuppSel.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 com.hnshituo.pur.vo;
  10. using Core.Mes.Client.Comm.Control;
  11. using CoreFS.CA06;using Pur.Entity;
  12. using Pur.Entity.configureEntity;
  13. using Infragistics.Win;
  14. using Pur.Entity;
  15. namespace Pur.configure
  16. {
  17. public partial class frmSuppSel : FrmPmsBase
  18. {
  19. public frmSuppSel(OpeBase ob)
  20. {
  21. InitializeComponent();
  22. this.ob = ob;
  23. Query();
  24. ultraGrid1.DisplayLayout.Bands[0].Override.AllowUpdate = DefaultableBoolean.False;
  25. }
  26. private string SUPP_NAME;
  27. public string strSUPP_NAME
  28. {
  29. get { return SUPP_NAME; }
  30. }
  31. private string SUPP_CODE;
  32. public string strSUPP_CODE
  33. {
  34. get { return SUPP_CODE; }
  35. }
  36. private string SUPP_TAX_RATE;
  37. public string strSUPP_TAX_RATE
  38. {
  39. get { return SUPP_TAX_RATE; }
  40. }
  41. /// <summary>
  42. /// 获取供应商
  43. /// </summary>
  44. private void getSupp(DataTable dt)
  45. {
  46. dataTable1.Rows.Clear();
  47. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);//绑定物料分类表
  48. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  49. {
  50. ultraGrid1.Rows[i].Cells["col_sel"].Value = "选择..";
  51. }
  52. }
  53. /// <summary>
  54. /// 单击选择按钮
  55. /// </summary>
  56. /// <param name="sender"></param>
  57. /// <param name="e"></param>
  58. private void ultraGrid1_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  59. {
  60. conFirmation();
  61. }
  62. /// <summary>
  63. /// 双击列表行
  64. /// </summary>
  65. /// <param name="sender"></param>
  66. /// <param name="e"></param>
  67. private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  68. {
  69. conFirmation();
  70. }
  71. private void conFirmation()
  72. {
  73. if (ultraGrid1.ActiveRow != null)
  74. {
  75. SUPP_NAME = ultraGrid1.ActiveRow.Cells["SUPPNAME"].Value.ToString();
  76. SUPP_CODE = ultraGrid1.ActiveRow.Cells["SUPPCODE"].Value.ToString();
  77. SUPP_TAX_RATE = ultraGrid1.ActiveRow.Cells["SUPPTAXRATE"].Value.ToString();
  78. this.Close();
  79. }
  80. else
  81. {
  82. MessageBox.Show("请选择供应商行信息","提示");
  83. }
  84. }
  85. private void Query()
  86. {
  87. Supp EntitySupp = new Supp();
  88. if (txt_SuppCode.Text.Trim() != "")
  89. {
  90. EntitySupp.SuppCode = txt_SuppCode.Text.Trim();
  91. }
  92. if (txt_SuppName.Text.Trim() != "")
  93. {
  94. EntitySupp.SuppName = txt_SuppName.Text.Trim();
  95. }
  96. EntitySupp.Validflag = "1";
  97. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.SuppService", "get_Supp", new object[] { EntitySupp});
  98. getSupp(dt);
  99. }
  100. /// <summary>
  101. /// 按钮控件
  102. /// </summary>
  103. /// <param name="sender"></param>
  104. /// <param name="e"></param>
  105. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  106. {
  107. switch (e.Tool.Key)
  108. {
  109. case "doQuery": // ButtonTool
  110. Query();
  111. break;
  112. case "doSure": // ButtonTool
  113. conFirmation();
  114. break;
  115. case "doExit": // ButtonTool
  116. this.Close();
  117. break;
  118. }
  119. }
  120. private void frmSuppSel_Load(object sender, EventArgs e)
  121. {
  122. }
  123. }
  124. }