| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.LgClassModel;
- using Core.StlMes.Client.LgCommon;
- using Core.StlMes.Client.PnCost.Models;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win;
- using System.Data;
- using Core.Mes.Client.Comm.Server;
- using CoreFS.CA06;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.PnCost
- {
- public partial class ucHj : ucNewResBase
- {
- public ucHj()
- {
- InitializeComponent();
- ClsControlPack.SetUltraGridStyle(ugData, 1);
- }
- protected OpeBase Ob;
- public void SetBase(OpeBase ob)
- {
- Ob = ob;
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- EntityHelper.ShowGridCaption<TqnqD01Entity>(ugData.DisplayLayout.Bands[0]);
- ugData.DisplayLayout.Bands[0].Override.HeaderClickAction = HeaderClickAction.Select;
- SetData(new List<object> { new TqnqD01Entity() });
- SetControlDelegate();
- }
- protected virtual void SetControlDelegate()
- {
- //ugData.AfterCellUpdate += new CellEventHandler(ugData_AfterCellUpdate);
- //ugData.KeyDown += new KeyEventHandler(ugData_KeyDown);
- //ugData.KeyPress += ugData_KeyPress;
- ugData.ClickCellButton += new CellEventHandler(ugData_ClickCellButton);
- }
- protected virtual void ugData_ClickCellButton(object sender, CellEventArgs e)
- {
- try
- {
- if (e.Cell.Column.DataType == typeof(Decimal) || e.Cell.Column.DataType == typeof(Decimal?))
- {
- frmInputDecimal frm = new frmInputDecimal(Convert.ToString(e.Cell.Text));
- frm.Location = ClsControlPack.GetChildWindowLocation(frm.Size);
- if (frm.ShowDialog() == DialogResult.OK)
- {
- if (!frm.ValueChanged) return;
- e.Cell.Value = frm.Value;
- ugData.UpdateData();
- }
- }
- }
- catch { }
- }
- public TqnqD01Entity TqnqD01Entity()
- {
- UltraGridRow row = ugData.Rows[0];
- return (TqnqD01Entity)row.ListObject;
- }
- public void setHj(TqnqD01Entity entity)
- {
- if (entity.SmeltCode.Equals("") || entity.SmeltCode == null) return;
- if (entity.SgSign.Equals("") || entity.SgSign == null) return;
- if (entity.SgStd.Equals("") || entity.SgStd == null) return;
- if (entity.Cic.Equals("") || entity.Cic == null) return;
- if (entity.InSteelTypeCode.Equals("") || entity.InSteelTypeCode == null) return;
- List<TqnqD01Entity> data = EntityHelper.GetData<TqnqD01Entity>(
- "com.steering.mes.cost.FrmTqnqd01.QueryDexh", new object[] { entity.Cic, entity.SgSign }, Ob);
- if (data != null && data.Count > 0)
- {
- ugData.DataSource = data;
-
- }
- for (int i = 0; i < ugData.Rows.Count; i++)
- {
- ugData.Rows[i].Cells["OutSmeltCode"].Value = entity.SmeltCode;
- ugData.Rows[i].Cells["OutSgSign"].Value = entity.SgSign;
- ugData.Rows[i].Cells["OutSgStd"].Value = entity.SgStd;
- ugData.Rows[i].Cells["OutSteelTypeCode"].Value = entity.InSteelTypeCode;
- }
- }
- }
- }
|