| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Pur.Entity.configureEntity;
- using Core.Mes.Client.Comm.Control;
- using CoreFS.CA06;using Pur.Entity;using Pur.Entity;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Server;
- using Infragistics.Win.UltraWinGrid;
- namespace Pur.Pop_upWindow
- {
- public partial class FrmPopItemWeight : FrmPmsBase
- {
- public string QstrWeightName = "";
- public string QstrWeightCode = "";
-
- public FrmPopItemWeight(OpeBase ob)
- {
- InitializeComponent();
- this.ob = ob;
-
- }
- /// <summary>
- /// 初始化界面加载数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void FrmPopItemWeight_Load(object sender, EventArgs e)
- {
- binUltraGrid("1215");
- }
- /// <summary>
- /// 刷新Grid数据源
- /// </summary>
- /// <param name="basecode"></param>
- private void binUltraGrid(string basecode)
- {
- this.dataTable1.Clear();
- DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { basecode }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- //不同颜色区分是否有效数据
- Infragistics.Win.UltraWinGrid.UltraGridRow row = null;
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- row = ultraGrid1.Rows[i];
- if (!row.Cells["VALIDFLAG"].Value.ToString().Equals("1"))
- {
- //row.Appearance.ForeColor = Color.Red;
- row.Hidden = true;
- }
- else
- {
- //row.Appearance.ForeColor = Color.Black;
- }
- }
- //内容自适应
- GridHelper.RefreshAndAutoSizeExceptRows(ultraGrid1, new UltraGridColumn[] {
- ultraGrid1.DisplayLayout.Bands[0].Columns["MEMO"]
- });
- }
- /// <summary>
- /// 筛选单位代码
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void txt_ITEM_UOM_CONEFFICIENT_TextChanged(object sender, EventArgs e)
- {
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- if (ugr.Cells["VALIDFLAG"].Value.ToString().Equals("1"))
- {
- if (ugr.Cells["BASECODE"].Value.ToString().Contains(txt_UOM_CODE_QUERY.Text) && ugr.Cells["BASENAME"].Value.ToString().Contains(txt_UOM_NAME_QUERY.Text))
- {
- ugr.Hidden = false; //显示行
- }
- else
- {
- ugr.Hidden = true; //隐藏行
- }
- }
- }
- }
- /// <summary>
- /// 按钮控件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key.ToString())
- {
- case "conFirmation":
- {
- if (ultraGrid1.ActiveRow != null)
- {
- if (ultraGrid1.ActiveRow == null || ultraGrid1.ActiveRow.Hidden == true)
- {
- MessageUtil.ShowTips("请选择一条数据");
- return;
- }
- QstrWeightName = ultraGrid1.ActiveRow.Cells["BASENAME"].Value.ToString();
- QstrWeightCode = ultraGrid1.ActiveRow.Cells["BASECODE"].Value.ToString();
- this.Close();
- }
- }
- break;
- case "ESC":
- {
- this.Close();
- }
- break;
- }
- }
- }
- }
|