| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Windows.Forms;
- using Infragistics.Win.UltraWinGrid;
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Server;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control.Entity;
- using Infragistics.Win;
- namespace Core.StlMes.Client.Mcp.Control
- {
- public partial class UserNameControl : UserControl
- {
-
- private OpeBase ob;
- public OpeBase Ob
- {
- get { return ob; }
- set { ob = value; }
- }
- public void DisableFiltering()
- {
- ultraGrid1.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.False;
- }
- private string _plineCode;
- private List<HttSignatureEntity> Names = new List<HttSignatureEntity>();
-
- public HttLoadingResultEntity Value
- {
- get
- {
- List<HttLoadingResultEntity> list =
- httLoadingResultEntityBindingSource.DataSource as List<HttLoadingResultEntity>;
- return list==null || !list.Any()?new HttLoadingResultEntity(): list.FirstOrDefault();
- }
- set
- {
- if (value == null)
- {
- httLoadingResultEntityBindingSource.DataSource = new List<HttLoadingResultEntity>()
- {
- new HttLoadingResultEntity()
- };
- }
- else
- {
- httLoadingResultEntityBindingSource.DataSource = new List<HttLoadingResultEntity>() {value.Clone()};
- if (ob == null || ob.MainUrl == "") return;
- if (_plineCode != Value.PlineCode)
- {
- Names = EntityHelper.GetData<HttSignatureEntity>(
- "com.steering.mes.mcp.heatTreatment.FrmHttCrackDetectResult.getHttSign",
- new object[] { Value.PlineCode, "2" }, Ob);
- name.DataSource = Names.Where(p => p.ColGroup == value.LoadGroup).ToList();
- name.DisplayMember = "UserName";
- name.ValueMember = "UserName";
- YdmBaseClass.SetComboItemHeight(name);
- _plineCode = Value.PlineCode;
- }
- }
- ultraGrid1.Refresh();
- }
- }
- /// <summary>
- /// 上料炉号
- /// </summary>
- public string FeedStoveNo { get; set; }
- public decimal ActCount { get; set; }
- public string BatchNo { get; set; }
- public string GroupNo { get; set; }
- public void SetFont(Font f1)
- {
- ultraGrid1.Font = f1;
- foreach (UltraGridColumn UltraGridColumn in ultraGrid1.DisplayLayout.Bands[0].Columns)
- {
- UltraGridColumn.Header.Appearance.FontData.Bold = f1.Bold ? DefaultableBoolean.True : DefaultableBoolean.False;
- UltraGridColumn.Header.Appearance.FontData.Name = f1.Name;
- UltraGridColumn.Header.Appearance.FontData.SizeInPoints = f1.SizeInPoints;
- }
- }
- public UserNameControl()
- {
- InitializeComponent();
- EntityHelper.ShowGridCaption<HttLoadingResultEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- }
- public void ChangeName(string PlineCode)
- {
-
- }
-
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- try
- {
- ultraGrid1.UpdateData();
- /* if (e.Cell.Column.Key.Equals("LoadGroup"))
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmMcpLoading.getPerson", new object[] { e.Cell.Row.Cells["LoadGroup"].Text, Value.PlineName }, this.ob);//如果是“”里面添加的是条件
- name.DataSource = dt1;
- name.DisplayMember = "NAME";
- //name.ValueMember = "ID";
- YdmBaseClass.SetComboItemHeight(name);
- }*/
- if (e.Cell.Column.Key.Equals("LoadTime"))
- {
- Value.LoadTime = e.Cell.Text;
- }
- if (e.Cell.Column.Key.Equals("LoadGroup") && Value.LoadGroup != null)
- {
- name.DataSource = Names.Where(p => p.ColGroup == Value.LoadGroup).ToList();
- }
-
- this.ultraGrid1.UpdateData();
- }
- catch (Exception)
- {
-
- }
- }
- }
- }
|