AddPriceSuit.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using com.steering.pss.sale.price.entity;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinEditors;
  6. using Infragistics.Win.UltraWinGrid;
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Windows.Forms;
  16. using Core.Mes.Client.Comm.Format;
  17. using Core.Mes.Client.Comm.Control;
  18. namespace Core.StlMes.Client.SalePrice.dialog
  19. {
  20. public partial class AddPriceSuit : FrmBase
  21. {
  22. private string _AddPrice_Line_Id = "";
  23. public AddPriceSuit(string AddPrice_Line_Id, OpeBase ob)
  24. {
  25. InitializeComponent();
  26. _AddPrice_Line_Id = AddPrice_Line_Id;
  27. this.ob = ob;
  28. Query();
  29. }
  30. private void Query()
  31. {
  32. //DataTable dt = new DataTable();
  33. //dt.Columns.Add(new DataColumn("SUITCLASSIFY", typeof(string)));
  34. // dt.Columns.Add(new DataColumn("SUITVALUE", typeof(string)));
  35. //DataRow dr = dt.NewRow();
  36. //dr["SUITCLASSIFY"] = "订货单位";
  37. //dr["SUITVALUE"] = "中石油";
  38. //dt.Rows.Add(dr);
  39. //DataRow dr1 = dt.NewRow();
  40. //dr1["SUITCLASSIFY"] = "订货单位";
  41. //dr1["SUITVALUE"] = "中石化";
  42. //dt.Rows.Add(dr1);
  43. //DataRow dr2 = dt.NewRow();
  44. //dr2["SUITCLASSIFY"] = "品种";
  45. //dr2["SUITVALUE"] = "套管";
  46. //dt.Rows.Add(dr2);
  47. //ugPriceSuit.DataSource = dt;
  48. //ugPriceSuit.DataBind();
  49. }
  50. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  51. {
  52. switch (e.Tool.Key)
  53. {
  54. case "确认":
  55. // Query();
  56. break;
  57. }
  58. }
  59. private void AddPriceSuit_Load(object sender, EventArgs e)
  60. {
  61. InitForm();
  62. }
  63. private void InitForm()
  64. {
  65. string ver_type = "123101";//1为 适用项目 2为 加价优惠分类
  66. UltraComboEditor uce1 = new UltraComboEditor();
  67. SalePriceClass.InitComboEditorWithParm(uce1, "com.steering.pss.sale.price.server.CorePriceBaseSuit.GetSUITCLASSIFY", "SUIT_ID", "SUIT_NAME", this.ob, true, new object[] { ver_type });
  68. ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITCLASSIFY"].EditorComponent = uce1;
  69. ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITCLASSIFY"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  70. this.Controls.Add(uce1);
  71. uce1.Visible = false;
  72. }
  73. private void ugPriceSuit_InitializeRow(object sender, InitializeRowEventArgs e)
  74. {
  75. if (e.Row != null)
  76. {
  77. string SUITCLASSIFY = e.Row.Cells["SUITCLASSIFY"].Value.ToString();
  78. suitValueBind(SUITCLASSIFY);
  79. //if (e.Row.Cells["VALIDFLAG"].Value.ToString() == "无效")
  80. //{
  81. // e.Row.Appearance.ForeColor = Color.Red;
  82. //}
  83. //else
  84. //{
  85. // e.Row.Appearance.ForeColor = Color.Black;
  86. //}
  87. }
  88. }
  89. private void suitValueBind(string SUITCLASSIFY)
  90. {
  91. DataTable SuitInfo = ServerHelper.GetData("com.steering.pss.sale.price.server.CorePriceBaseSuit.GetSuitInfo", new object[] { SUITCLASSIFY }, this.ob);
  92. if (SuitInfo != null && SuitInfo.Rows.Count > 0 && SuitInfo.Rows[0]["Table_Name"].ToString() != "")
  93. {
  94. UltraComboEditor uce1 = new UltraComboEditor();
  95. string sql_getFactorBind = "";
  96. string TableName = SuitInfo.Rows[0]["TABLE_NAME"].ToString();
  97. string DataValue = SuitInfo.Rows[0]["COLUMN_KEY"].ToString();
  98. string DataDesc = SuitInfo.Rows[0]["COLUMN_NAME"].ToString();
  99. string sql_getSQL = SuitInfo.Rows[0]["VAL_SQL"].ToString();
  100. DataTable dtFactor = ServerHelper.GetData("com.steering.pss.sale.price.server.CorePriceBaseSuit.FactorBind", new object[] { TableName, DataValue, DataDesc, sql_getSQL }, this.ob);
  101. if (dtFactor != null && dtFactor.Rows.Count > 0)
  102. {
  103. Object[] obj = new Object[] { "", "" };
  104. DataRow dr = dtFactor.NewRow();
  105. dr.ItemArray = obj;
  106. dtFactor.Rows.InsertAt(dr, 0);
  107. uce1.DataSource = dtFactor;
  108. uce1.DataMember = "";
  109. uce1.ValueMember = DataValue;
  110. uce1.DisplayMember = DataDesc;
  111. ClsBaseInfo.SetComboItemHeight(uce1);
  112. }
  113. ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITVALUE"].EditorComponent = uce1;
  114. ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITVALUE"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  115. this.Controls.Add(uce1);
  116. uce1.Visible = false;
  117. }
  118. }
  119. }
  120. }