| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- 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 CommonCrackHeadControl : UserControl
- {
-
- private OpeBase ob;
- public OpeBase Ob
- {
- get { return ob; }
- set { ob = value; }
- }
- public string gx { get; set; }
- public void DisableFiltering()
- {
- ultraGrid1.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.False;
- foreach (var ugc in ultraGrid1.DisplayLayout.Bands[0].Columns)
- ugc.SortIndicator = SortIndicator.Disabled;
- }
- public void BandName(List<HttSignatureEntity> names)
- {
- name.DataSource = names;
- name.DisplayMember = "userName";
- name.ValueMember = "userName";
- name.DataBind();
- }
- public void setBatchNo(List<string> datas)
- {
- ucBatchs.DataSource = datas;
- ucBatchs.DataBind();
- }
- public void getWorkUnit(List<string> datas)
- {
- ucWorkUnit.DataSource = datas;
- ucWorkUnit.DataBind();
- }
- public List<PortHttBatchSampleResultEntity> PortHttBatchSampleResultEntitys { get; set; }
- public List<HttCrackDetectionEtEntity> ListAll { get; set; }
-
- public HttCrackDetectionEtEntity Value
- {
- get
- {
- ultraGrid1.UpdateData();
- List<HttCrackDetectionEtEntity> list =
- httCrackDetectionEtEntityBindingSource.DataSource as List<HttCrackDetectionEtEntity>;
- if (list != null && list.Any())
- {
- list[0].ColTime = ultraGrid1.Rows[0].Cells["ColTime"].Text;
- list[0].ColEndTime = ultraGrid1.Rows[0].Cells["ColEndTime"].Text;
- }
- return list==null || !list.Any()?new HttCrackDetectionEtEntity(): list.FirstOrDefault();
- }
- set
- {
- List<HttCrackDetectionEtEntity> list =new List<HttCrackDetectionEtEntity>();
- if (value == null)
- {
- list = new List<HttCrackDetectionEtEntity>()
- {
- new HttCrackDetectionEtEntity(){}
- };
- }
- else
- {
- list = new List<HttCrackDetectionEtEntity>() { value };
- }
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchInfo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchLength"].Hidden = false;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchWidth"].Hidden = false;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchDepth"].Hidden = false;
- if (list[0].PlineCode == "C092" || list[0].PlineCode == "C091")
- {
- if (list[0].ReportNo == "12")
- {
- list[0].NotchLength = "";
- list[0].NotchWidth = "";
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchLength"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchWidth"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchDepth"].Hidden = true;
- }
- else
- {
- list[0].NotchLength = "≤40mm";
- list[0].NotchWidth = "≤1mm";
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchInfo"].Hidden = false;
- }
- }
- httCrackDetectionEtEntityBindingSource.DataSource = list;
- httCrackDetectionEtEntityBindingSource.ResetBindings(false);
- ultraGrid1.Refresh();
- }
- }
- public bool WorkUnitbool
- {
- get
- {
- return workUnitbool;
- }
- set
- {
- if (value == false)//64
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["WorkUnit"].Hidden = true;
- // ultraGrid1.UltraGridColumns Columns["WorkUnit"].
- workUnitbool = value;
- // ultraGrid1.Refresh();
- }
- else {
-
- ultraGrid1.DisplayLayout.Bands[0].Columns["WorkUnit"].Hidden = false;
- // ultraGrid1.Refresh();
- }
- }
- }
- 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 CommonCrackHeadControl()
- {
- InitializeComponent();
- WorkUnitbool = false;
- EntityHelper.ShowGridCaption<HttCrackDetectionEtEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- try
- {
- if (e.Cell.Column.Key.Equals("ColTime") || e.Cell.Column.Key.Equals("ColEndTime"))
- {
- return;
- }
- ultraGrid1.UpdateData();
- }
- catch (Exception)
- {
-
- }
- }
- private void ultraGrid1_CellDataError(object sender, CellDataErrorEventArgs e)
- {
- e.RestoreOriginalValue = true;
- e.RaiseErrorEvent = false;
-
- }
- private bool workUnitbool;
- }
- }
|