| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.StlMes.Client.ZGMil;
- using com.steering.mes.zgmil.entity;
- using Infragistics.Win.UltraWinGrid;
- using Core.StlMes.Client.ZGMil.Entity;
- namespace Core.StlMes.Client.ZGMil.ResultConrtrol
- {
- public partial class MeasureControl : UserControl
- {
- private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
- public MeasureControl()
- {
- InitializeComponent();
- GridHelper.InitCardGrid(FurResultDateSource, ultraGrid3);
- _grid = this.ultraGrid3;
- }
- private MilMeasureResultEntity _furResult = new MilMeasureResultEntity();
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public MilMeasureResultEntity Value
- {
- get { return _furResult; }
- set
- {
- if (value != null)
- {
- _furResult = value;
- UpdateDate();
- }
- }
- }
- private bool isCellSelect=false;
- public bool IsCellSelect
- {
- get { return isCellSelect; }
- set { isCellSelect = value; }
- }
- private void ultraGrid3_CellsChange(object sender, CellEventArgs e)
- {
- IsCellSelect = true;
- }
- public void UpdateDate()
- {
- ultraGrid3.UpdateData();
- //清空DataSource数据
- //for (int i = 0; i < ultraGrid3.DisplayLayout.Bands[0].Columns.Count; i++)
- //{
- // this.ultraGrid3.Rows[0].Cells[i].Value = "";
- //}
- FurResultDateSource.Rows[0]["BatchNo"] = _furResult.BatchNo;
- FurResultDateSource.Rows[0]["ProNum"] = _furResult.ProNum;
- FurResultDateSource.Rows[0]["ProUser"] = _furResult.ProUser;
- FurResultDateSource.Rows[0]["ProShift"] = _furResult.ProShift;
- FurResultDateSource.Rows[0]["ProGroup"] = _furResult.ProGroup;
- FurResultDateSource.Rows[0]["ProTime"] = _furResult.ProTime;
- FurResultDateSource.Rows[0]["ProEndTime"] = _furResult.ProEndTime;
- FurResultDateSource.Rows[0]["Memo"] = _furResult.Memo;
-
- }
-
-
- public void ClearData()
- {
- ultraGrid3.UpdateData();
- //清空DataSource数据
- for (int i = 0; i < ultraGrid3.DisplayLayout.Bands[0].Columns.Count; i++)
- {
- this.ultraGrid3.Rows[0].Cells[i].Value = "";
- }
- }
- private void ultraGrid3_Error(object sender, ErrorEventArgs e)
- {
- e.Cancel = true;
- if (ultraGrid3.ActiveCell.Column.Key == "ProTime" || ultraGrid3.ActiveCell.Column.Key == "ProEndTime" )
- {
- MessageBox.Show("请输入完整的时间");
- }
- }
- private void ultraGrid3_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == (char)13)
- {
- //this.SelectNextControl(this.ActiveControl, true, true, true, true);
- ultraGrid3.PerformAction(UltraGridAction.NextCell);
- ultraGrid3.PerformAction(UltraGridAction.EnterEditMode);
- //ultraGrid2.ActiveCell.IsInEditMode = true;
- }
- }
- }
- }
|