| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Collections;
- using System.Windows.Forms;
- using Core.LgMes.Client.lgClassModel;
- using CoreFS.CA06;
- using Core.Mes.Client.Common;
- namespace Core.LgMes.Client.LgResMgt
- {
- public partial class frmSetAddit : Core.Mes.Client.Common.frmStyleBase
- {
- public frmSetAddit(OpeBase oba)
- {
- InitializeComponent();
- ob = oba;
-
- }
- #region " Member Variable"
- private DataTable m_dtMain = null;
- private string devicePos = ""; //CVT01
- private string _curMaterType = ""; //FL
- private PictureBox _curPicBx = null;
- private Label _curLbl = null;
- public string strMaterCode = ""; //物料编号
- public string strMaterName = ""; //物料名称
- public bool blClean = false; //清除标致
- #endregion
- //选择料斗
- private void PicClickHandler(object sender, System.EventArgs e)
- {
- _curPicBx = (PictureBox)sender;
- _curPicBx.BorderStyle = BorderStyle.Fixed3D;
- }
- private void frmSetHopper_Load(object sender, EventArgs e)
- {
- GetDataSource();
- BindingGrid();
- }
- #region " InitDataSoutce"
- private void GetDataSource()
- {
- string strErr = "", szWhere = " where MATERIELTYPE ='BH' order by MATERIELTYPE";
- try
- {
- //hengxing
- //CallingMessage par = new CallingMessage();
- //par.ServerName = "lgJobMgt";
- //par.AssemblyName = "Core.LgMes.Server.lgJobMgt";
- //par.ClassName = "Core.LgMes.Server.lgJobMgt.classCommonModule";
- //par.MethodName = "GetMaterialData";
- //par.args = new object[] { szWhere };
- ArrayList arry = new ArrayList();
- arry.Add("GetMaterialData.select");
- CommonClientToServer cctos = new CommonClientToServer();
- cctos.ob = this.ob;
- DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
- "doSimpleQuery", arry, out strErr);
-
- if (strErr == "" && ds != null)
- {
- this.m_dtMain = ds.Tables[0];
- }
- }
- catch (Exception ex)
- {
- string Msg = ex.Message;
- }
- }
- private void BindingGrid()
- {
- this.ulgridMtrInfo.DataSource = this.m_dtMain;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[0].Width = 60;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[0].Header.Caption = "物料编码";
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[0].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[1].Width = 110;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[1].Header.Caption = "物料全称";
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[2].Width = 100;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[2].Header.Caption = "物料简称";
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[3].Width = 65;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[3].Header.Caption = "物料类型";
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[4].Width = 0;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[4].Header.Caption = "";
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns[4].Hidden = true;
- }
- #endregion
- private void btClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
-
- //显示料斗配置信息
- private void radioButton_Click(object sender, System.EventArgs e)
- {
- if (_curMaterType != ((RadioButton)sender).Tag.ToString())
- _curMaterType = ((RadioButton)sender).Tag.ToString();
- else
- return;
- this.m_dtMain.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
- this.ulgridMtrInfo.UpdateData();
- }
- private void btOK_Click(object sender, EventArgs e)
- {
- if (ulgridMtrInfo.ActiveRow != null)
- {
- strMaterCode = ulgridMtrInfo.ActiveRow.Cells["MATERIELCODE"].Value.ToString();
- strMaterName = ulgridMtrInfo.ActiveRow.Cells["MATERIELNAME"].Value.ToString();
- blClean = false;
- this.Close();
- }
- else
- MessageBox.Show("请选择物料!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- private void button1_Click(object sender, EventArgs e)
- {
- blClean = true;
- this.Close();
- }
- }
- }
|