| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- 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 frmPopItemUon : FrmPmsBase
- {
- public string QstrWeightName = "";
- public string QstrWeightCode = "";
- public string QstrUOMCode = "";
- public string QstrUOMName = "";
- public string QstrItemUomConefficient = "";
- private string QstrWeight = "";
- public frmPopItemUon(OpeBase ob, string strWeight)
- {
- InitializeComponent();
- this.ob = ob;
- QstrWeight = strWeight;
- }
- /// <summary>
- /// 初始化界面加载数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void frmPopItemUon_Load(object sender, EventArgs e)
- {
- //binUltraGrid("1215");
- get_PurUoms();
- }
- /// <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="PurPlanMEntity"></param>
- public void get_PurUoms()
- {
- PurUomsEntity UomsEntity = new PurUomsEntity();
- if (QstrWeight != "")
- {
- UomsEntity.WeightUnitCode = QstrWeight;
- }
- //if (QstrWeight != "")
- //{
- // foreach (DataRow dr in dt.Rows)
- // {
- // if (dr["BASECODE"].ToString().Trim() == QstrWeight.Trim())
- // {
- // dt.Rows.Remove(dr);
- // }
- // }
- //}
- UomsEntity.Validflag = "1";
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.UomsService", "find", new object[] { UomsEntity, 0, 0 });
- //按创建时间降序
- if (dt.Rows.Count > 0)
- {
- dt.DefaultView.Sort = "CREATETIME DESC";
- dt = dt.DefaultView.ToTable();
- }
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable3, true);//绑定物料分类表
- }
- /// <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["UOMCODE"].Value.ToString().Contains(txt_UOM_CODE_QUERY.Text) && ugr.Cells["UOMNAME"].Value.ToString().Contains(txt_UOM_NAME_QUERY.Text) && ugr.Cells["WEIGHTUNIT"].Value.ToString().Contains(txt_WEIGHT_UNIT_QUERY.Text) && ugr.Cells["WEIGHTUNITCODE"].Value.ToString().Contains(txt_WEIGHT_UNIT_CODE_QUERY.Text))
- {
- ugr.Hidden = false; //显示行
- }
- else
- {
- ugr.Hidden = true; //隐藏行
- }
- }
- }
- }
- /// <summary>
- /// 筛选单位名称
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- /// <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["WEIGHTUNIT"].Value.ToString();
- QstrWeightCode = ultraGrid1.ActiveRow.Cells["WEIGHTUNITCODE"].Value.ToString();
- QstrUOMName = ultraGrid1.ActiveRow.Cells["UOMNAME"].Value.ToString();
- QstrUOMCode = ultraGrid1.ActiveRow.Cells["UOMCODE"].Value.ToString();
- QstrItemUomConefficient = ultraGrid1.ActiveRow.Cells["UOMCONEFFICIENT"].Value.ToString();
- this.Close();
- }
- }
- break;
- case "ESC":
- {
- this.Close();
- }
- break;
- }
- }
- }
- }
|