| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Treatment.Entity;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- namespace Core.StlMes.Client.Mcp.Treatment.Report
- {
- public partial class FrmHttInitialRpt : FrmBase
- {
- public FrmHttInitialRpt()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private string balMonth = "";
- private string[] plineCodes = null;
- private string ProcessCode = "";
- private List<YdmHttInitialEntity2> CurrentlistEntity;
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- ProcessCode = this.CustomInfo.ToString2();
- if (ProcessCode == "") ProcessCode = "F";
- plineCodes = comm.InitDropPlinePower(ProcessCode, cboPline, this.ValidDataPurviewIds, ob);
- comm.InitDroProStation(ProcessCode, new List<UltraComboEditor>() { uceFactory }, this.ValidDataPurviewIds, ob);
- if (plineCodes == null || plineCodes.Length <= 0)
- {
- MessageBox.Show("无数据权限!");
- this.Close();
- }
- comm.RefreshAndAutoSizeWithHeader(ultraGrid1);
- dtBathYear.Value = DateTime.Now;
- EntityHelper.ShowGridCaption<YdmHttInitialEntity2>(ultraGrid1.DisplayLayout.Bands[0]);
- GridHelper.SetAllColumnsActive(ultraGrid1);
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- Query();
- break;
- case "Export":
- GridHelper.ulGridToExcel(ultraGrid1, "在产品期初报表");
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private void Query()
- {
- WaitingForm2 wf = new WaitingForm2("正在查询,请稍候....");
- try
- {
- this.Cursor = Cursors.WaitCursor;
- ultraGrid1.DataSource =
- EntityHelper.GetData<YdmHttInitialEntity2>("com.steering.mes.mcp.common.FrmHttInitialRpt.doQuery",
- new object[]
- {
- dtBathYear.Value.ToString("yyyyMM"),
- ucePlineCode.Checked && cboPline.CheckedItems.Count > 0
- ? cboPline.CheckedItems.Select(p => p.DataValue.ToString()).ToArray()
- : plineCodes,
- chkFactory.Checked && uceFactory.SelectedIndex >= 0
- ? uceFactory.SelectedItem.DataValue.ToString()
- : "",
- chkType.Checked && uceType.SelectedIndex >= 0
- ? uceType.SelectedItem.DataValue.ToString()
- : "",
- uceJudgeStove.Checked?txtJudgeStove.Text:""
- }, ob);
- }
- catch (Exception)
- {
-
- }
- finally
- {
- wf.Close();
- this.Cursor = Cursors.Default;
- }
-
- }
- private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
- {
- /* YdmHttInitialEntityPlus entity = e.Row.ListObject as YdmHttInitialEntityPlus;
- if (entity.SourceNumTotal + entity.ActCount != entity.FailNum + entity.GroupNum + entity.EndNum + entity.JudgeNum)
- {
- e.Row.Appearance.BackColor = Color.Red;
- }*/
- }
- }
- }
|