| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- using com.steering.pss.sale.price.entity;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Control;
- namespace Core.StlMes.Client.SalePrice.dialog
- {
- public partial class AddPriceSuit : FrmBase
- {
- private string _AddPrice_Line_Id = "";
- public AddPriceSuit(string AddPrice_Line_Id, OpeBase ob)
- {
- InitializeComponent();
- _AddPrice_Line_Id = AddPrice_Line_Id;
- this.ob = ob;
- Query();
- }
- private void Query()
- {
- //DataTable dt = new DataTable();
- //dt.Columns.Add(new DataColumn("SUITCLASSIFY", typeof(string)));
- // dt.Columns.Add(new DataColumn("SUITVALUE", typeof(string)));
- //DataRow dr = dt.NewRow();
- //dr["SUITCLASSIFY"] = "订货单位";
- //dr["SUITVALUE"] = "中石油";
- //dt.Rows.Add(dr);
- //DataRow dr1 = dt.NewRow();
- //dr1["SUITCLASSIFY"] = "订货单位";
- //dr1["SUITVALUE"] = "中石化";
- //dt.Rows.Add(dr1);
- //DataRow dr2 = dt.NewRow();
- //dr2["SUITCLASSIFY"] = "品种";
- //dr2["SUITVALUE"] = "套管";
- //dt.Rows.Add(dr2);
- //ugPriceSuit.DataSource = dt;
- //ugPriceSuit.DataBind();
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "确认":
- // Query();
- break;
-
-
- }
- }
- private void AddPriceSuit_Load(object sender, EventArgs e)
- {
- InitForm();
- }
- private void InitForm()
- {
- string ver_type = "123101";//1为 适用项目 2为 加价优惠分类
- UltraComboEditor uce1 = new UltraComboEditor();
- SalePriceClass.InitComboEditorWithParm(uce1, "com.steering.pss.sale.price.server.CorePriceBaseSuit.GetSUITCLASSIFY", "SUIT_ID", "SUIT_NAME", this.ob, true, new object[] { ver_type });
- ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITCLASSIFY"].EditorComponent = uce1;
- ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITCLASSIFY"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- this.Controls.Add(uce1);
- uce1.Visible = false;
- }
- private void ugPriceSuit_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- if (e.Row != null)
- {
- string SUITCLASSIFY = e.Row.Cells["SUITCLASSIFY"].Value.ToString();
- suitValueBind(SUITCLASSIFY);
- //if (e.Row.Cells["VALIDFLAG"].Value.ToString() == "无效")
- //{
- // e.Row.Appearance.ForeColor = Color.Red;
- //}
- //else
- //{
- // e.Row.Appearance.ForeColor = Color.Black;
- //}
- }
- }
- private void suitValueBind(string SUITCLASSIFY)
- {
- DataTable SuitInfo = ServerHelper.GetData("com.steering.pss.sale.price.server.CorePriceBaseSuit.GetSuitInfo", new object[] { SUITCLASSIFY }, this.ob);
- if (SuitInfo != null && SuitInfo.Rows.Count > 0 && SuitInfo.Rows[0]["Table_Name"].ToString() != "")
- {
- UltraComboEditor uce1 = new UltraComboEditor();
- string sql_getFactorBind = "";
- string TableName = SuitInfo.Rows[0]["TABLE_NAME"].ToString();
- string DataValue = SuitInfo.Rows[0]["COLUMN_KEY"].ToString();
- string DataDesc = SuitInfo.Rows[0]["COLUMN_NAME"].ToString();
- string sql_getSQL = SuitInfo.Rows[0]["VAL_SQL"].ToString();
- DataTable dtFactor = ServerHelper.GetData("com.steering.pss.sale.price.server.CorePriceBaseSuit.FactorBind", new object[] { TableName, DataValue, DataDesc, sql_getSQL }, this.ob);
- if (dtFactor != null && dtFactor.Rows.Count > 0)
- {
- Object[] obj = new Object[] { "", "" };
- DataRow dr = dtFactor.NewRow();
- dr.ItemArray = obj;
- dtFactor.Rows.InsertAt(dr, 0);
- uce1.DataSource = dtFactor;
- uce1.DataMember = "";
- uce1.ValueMember = DataValue;
- uce1.DisplayMember = DataDesc;
- ClsBaseInfo.SetComboItemHeight(uce1);
- }
- ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITVALUE"].EditorComponent = uce1;
- ugPriceSuit.DisplayLayout.Bands[0].Columns["SUITVALUE"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- this.Controls.Add(uce1);
- uce1.Visible = false;
- }
- }
- }
- }
|