| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- 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 Core.StlMes.Client.YdmPipeManage.Entity;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeManage.Tool;
- namespace Core.StlMes.Client.YdmPipeManage.Dialog
- {
- public partial class FrmMaterialDialog : FrmBase
- {
- private string _materialNo;
- private OpeBase _ob;
- private SlmBaseMaterialEntity baseEntity = null;
- private ComPscEntity pscEntity = null;
- private string _productFlag;
- public ComPscEntity PscEntity
- {
- get { return pscEntity; }
- set { pscEntity = value; }
- }
- public SlmBaseMaterialEntity BaseEntity
- {
- get { return baseEntity; }
- set { baseEntity = value; }
- }
- public FrmMaterialDialog(string materialNo,string productFlag, OpeBase ob)
- {
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- InitializeComponent();
- _materialNo = materialNo;
- _ob = ob;
- _productFlag = productFlag;
- }
- private void FrmMaterialDialog_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<SlmBaseMaterialEntity>(UltraGridMaterial.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<ComPscEntity>(UltraGridPsc.DisplayLayout.Bands[0]);
- BaseMethod.setOtherColumnReadOnly(UltraGridMaterial, new string[] { "Chc" });
- BaseMethod.setOtherColumnReadOnly(UltraGridPsc, new string[] { "Chc" });
- DoQueryPsc();
- }
- public void DoQueryMaterial(string producCode, string steelCode, string stdstyle)
- {
- List<SlmBaseMaterialEntity> listSource = EntityHelper.GetData<SlmBaseMaterialEntity>(
- "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getMaterial", new object[] { producCode, steelCode, stdstyle }, _ob);
- slmBaseMaterialEntityBindingSource.DataSource = listSource;
- }
- public void DoQueryMaterial1()
- {
- List<SlmBaseMaterialEntity> listSource = EntityHelper.GetData<SlmBaseMaterialEntity>(
- "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getMaterial1", new object[] { }, _ob);
- slmBaseMaterialEntityBindingSource.DataSource = listSource;
- }
- private void DoQueryPsc()
- {
- //成品盘盈
- if (_productFlag == "0")
- {
- List<ComPscEntity> listSource = EntityHelper.GetData<ComPscEntity>(
- "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getPsc", new object[] { }, _ob);
- comPscEntityBindingSource.DataSource = listSource;
- }
- //半成品
- if (_productFlag == "1")
- {
- List<ComPscEntity> listSource = EntityHelper.GetData<ComPscEntity>(
- "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getPsc", new object[] { }, _ob);
- comPscEntityBindingSource.DataSource = listSource;
- }
- }
- private void ActiveRow()
- {
- if (_materialNo.Length == 0)
- {
- return;
- }
- foreach (UltraGridRow ugr in UltraGridMaterial.Rows)
- {
- if (ugr.Cells[""].Value.ToString().Equals(_materialNo))
- {
- ugr.Activate();
- ugr.Appearance.BackColor = Color.GreenYellow;
- }
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- UltraGridRow ugrM = UltraGridMaterial.ActiveRow;
- if (ugrM == null)
- {
- MessageUtil.ShowWarning("请选择一组物料信息!");
- return;
- }
- UltraGridRow ugrP = UltraGridPsc.ActiveRow;
- if (ugrP == null)
- {
- return;
- }
- SlmBaseMaterialEntity slmBaseMaterialEntity = (SlmBaseMaterialEntity)ugrM.ListObject;
- baseEntity = slmBaseMaterialEntity;
- pscEntity = (ComPscEntity)ugrP.ListObject;
- this.Close();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- baseEntity = null;
- pscEntity = null;
- this.Close();
- }
- private void UltraGridPsc_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = UltraGridPsc.ActiveRow;
- if (ugr == null)
- {
- DoQueryMaterial("", "", "");
- return;
- }
- string producCode = ugr.Cells["Produccode"].Text;
- string steelCode = ugr.Cells["Steelcode"].Text;
- string stdStyle = ugr.Cells["StdStyle"].Text;
- if (_productFlag == "0")
- {
- DoQueryMaterial(producCode, steelCode, stdStyle);
- }
- if (_productFlag == "1")
- {
- DoQueryMaterial1();
- }
- }
- }
- }
|