| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control;
- using CoreFS.CA06;
- 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;
- namespace Core.StlMes.Client.Mcp.Treatment.Report
- {
- public partial class FrmHttPerformance : FrmBase
- {
- private string plineCode = "";
- private string manageNmae = ""; //科室名称
- private string stationCode = "";//工序代码
- private string[] plineCodes = new string[] { };
- public FrmHttPerformance()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
-
- private void FrmPerformance_Load(object sender, EventArgs e)
- {
- //DateTime now = DateTime.Now;
- //DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- //DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- //StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- //EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- StartTime.Value = DateTime.Parse(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd 21:00"));
- EndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 20:59"));
- manageNmae = UserInfo.GetDepartment();
- //plineCode = YdmBaseClass.GetPCode(manageNmae, this.ob);//获取 用户 对应的产线
- plineCodes = comm.InitDropPlineCodePower("F", txt_PlinCode, this.ValidDataPurviewIds, this.ob);
- txt_PlinCode.SelectedIndex = 0;
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- //base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query":
- DoQuery();
- break;
- case "Export":
- GridHelper.ulGridToExcel(ultraGrid1, "热处理实绩数据统计");
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private void chkTim_CheckedChanged(object sender, EventArgs e)
- {
- if (chkTim.Checked) { StartTime.Enabled = true; EndTime.Enabled = true; } else { StartTime.Enabled = false; EndTime.Enabled = false; }
- if (chkJugeHeatNo.Checked) { txtJugeNo.Enabled = true; } else { txtJugeNo.Enabled = false; }
- if (chkLotNo.Checked) { txtLotNo.Enabled = true; } else { txtLotNo.Enabled = false; }
- if (chkOrder.Checked) { txtOrder.Enabled = true; }
- else
- {
- txtOrder.Enabled = false;
- }
- }
- private void DoQuery()
- {
- string judgeNo = "";
- string batchNo = "";
- string orderNo = "";
- if (!CheckQuery()) return;
- string staTime = "";
- string endTime = "";
- if (chkTim.Checked)
- {
- staTime = StartTime.Value.ToString();
- endTime = EndTime.Value.ToString();
- }
- if (chkLotNo.Checked)
- {
- batchNo = this.txtLotNo.Text.Trim();
- }
- if (chkJugeHeatNo.Checked)
- {
- judgeNo = this.txtJugeNo.Text.Trim();
- }
- if (chkOrder.Checked)
- {
- orderNo = this.txtOrder.Text.Trim();
- }
- ArrayList list = new ArrayList();
- list.Add(staTime);
- list.Add(endTime);
- list.Add(judgeNo);
- list.Add(batchNo);
- list.Add(orderNo);
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmRCLPerformance.doQuery", new object[] { list, plineCode == "" ? plineCodes : new string[] { plineCode }, stationCode }, ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dataTable1, true);
- }
- /// <summary>
- /// 数据验证
- /// </summary>
- /// <returns></returns>
- private bool CheckQuery()
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(StartTime.Value.ToString()), DateTime.Parse(EndTime.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
- return false;
- }
- if (this.chkJugeHeatNo.Checked && string.IsNullOrEmpty(this.txtJugeNo.Text.Trim()))
- {
- MessageUtil.ShowWarning("请输入炉号!");
- return false;
- }
- if (this.chkLotNo.Checked && string.IsNullOrEmpty(this.txtLotNo.Text.Trim()))
- {
- MessageUtil.ShowWarning("请输入批号!");
- return false;
- }
- if (this.chkOrder.Checked && string.IsNullOrEmpty(this.txtOrder.Text.Trim()))
- {
- MessageUtil.ShowWarning("请输入合同号!");
- return false;
- }
- return true;
- }
- private void txt_PlinCode_TextChanged(object sender, EventArgs e)
- {
- plineCode = txt_PlinCode.SelectedItem.DataValue.ToString();
- }
- private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
- {
- /* if (int.Parse(e.Row.Cells["FLAG"].Value.ToString3()) >0)
- {
- e.Row.Appearance.BackColor = Color.Yellow;
- }*/
- }
- }
- }
|