| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control.Entity;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- namespace Core.StlMes.Client.Mcp.Control.Common
- {
- public delegate void AfterRowActivateHandler(object sender, PlnZyRclCEntity e);
- public partial class HeatPlanControl : UserControl
- {
- public event AfterRowActivateHandler AfterRowActivateHandler;
- public HeatPlanControl()
- {
- InitializeComponent();
- EntityHelper.ShowGridCaption<PlnZyRclCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- commHelper.RefreshAndAutoSize(ultraGrid1);
- commHelper.setOtherColumnReadOnly(ultraGrid1,new string[]{});
- }
- public OpeBase Ob { get; set; }
- public string Gx { get; set; }
- public bool Status1
- {
- get { return contorlPlanStatus1.Status1; }
- set { contorlPlanStatus1.Status1 = value; }
- }
- public bool Status2
- {
- get { return contorlPlanStatus1.Status2; }
- set { contorlPlanStatus1.Status2 = value; }
- }
- public bool Status3
- {
- get { return contorlPlanStatus1.Status3; }
- set { contorlPlanStatus1.Status3 = value; }
- }
- public bool Status4
- {
- get { return contorlPlanStatus1.Status4; }
- set { contorlPlanStatus1.Status4= value; }
- }
- public bool Status5
- {
- get { return contorlPlanStatus1.Status5; }
- set { contorlPlanStatus1.Status5 = value; }
- }
- /// <summary>
- /// 只显示主表数据
- /// </summary>
- public bool ShowMain { get; set; }
- public void Query(string[] PlineCodes)
- {
- var starts = "";
- var plnNo = "";
- var judgeStoveNo = "";
- var start = contorlPlanStatus1.statusArr;
- if (chkPlnNo.Checked)
- if (string.IsNullOrEmpty(txtRollBatchId.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入炉次计划号!");
- return;
- }
- else
- {
- plnNo = txtRollBatchId.Text.Trim();
- start = new string[5] {"00", "10", "20", "30", "40"};
- }
- if (chkJuNo.Checked)
- if (string.IsNullOrEmpty(txtZyBatchId.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入炉号!");
- return;
- }
- else
- {
- judgeStoveNo = txtZyBatchId.Text.Trim();
- start = new string[5] { "00", "10", "20", "30", "40" };
- }
-
- plnZyRclCEntityBindingSource.DataSource = EntityHelper.GetData<PlnZyRclCEntity>(
- "com.steering.mes.mcp.common.PlanService.getSingleRclPlan", new object[] { ShowMain, plnNo, judgeStoveNo, PlineCodes, start, Gx, ultraOptionSet2.Value.ToString2() }, Ob);
- commHelper.RefreshAndAutoSize(ultraGrid1);
-
- }
- public PlnZyRclCEntity ActiveRow
- {
- get
- {
- if (ultraGrid1.ActiveRow == null) return null;
- return ultraGrid1.ActiveRow.ListObject as PlnZyRclCEntity;
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- PlnZyRclCEntity PlnZyRclCEntity = ultraGrid1.ActiveRow.ListObject as PlnZyRclCEntity;
- if(PlnZyRclCEntity==null) return;
- var handler = AfterRowActivateHandler;
- if (handler != null) handler(this, PlnZyRclCEntity);
- }
- private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
- {
- PlnZyRclCEntity PlnZyRclCEntity = e.Row.ListObject as PlnZyRclCEntity;
- if(PlnZyRclCEntity==null) return;
- if (PlnZyRclCEntity.Planstatus == "20")
- {
- e.Row.Cells["PLANSTATUS"].Appearance.BackColor = Color.LightGreen;
- }
- else if(PlnZyRclCEntity.Planstatus == "30" ||PlnZyRclCEntity.Planstatus == "40")
- {
- e.Row.Cells["PLANSTATUS"].Appearance.BackColor = Color.Red;
- }
- }
- private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- var row = ultraGrid1.ActiveRow;
- var craftPath = YdmBaseClass.getQueryCraftNoRCL(row.Cells["CRAFT_FILE_NO"].Text, row.Cells["CRAFT_SEQ"].Text,
- Ob);
- if (e.Button.Key.ToLower().Equals("select"))
- {
- var down = new FormFileDown(Ob, craftPath);
- down.CtrlFileDown1.Button3.Visible = false;
- down.ShowDialog();
- }
- }
- private void chkStarts_CheckedChanged(object sender, EventArgs e)
- {
- if (chkPlnNo.Checked) txtRollBatchId.Enabled = true;
- else txtRollBatchId.Enabled = false;
- if (chkJuNo.Checked) txtZyBatchId.Enabled = true;
- else txtZyBatchId.Enabled = false;
- }
- }
- }
|