| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Server;
- using CoreFS.CA06;
- using System.Collections;
- using Core.Mes.Client.Comm.Control;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control;
- using com.steering.mes.mcp.entity;
- namespace Core.StlMes.Client.Mcp.Report
- {
- public partial class FrmJGMatLiKuReport : FrmBase
- {
- public FrmJGMatLiKuReport()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmJGMatLikuReport_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<CouplingMatButtressEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- DateTime t = DateTime.Now;
- DateTime t1 = new DateTime(t.Year, t.Month, 1);
- RegStartTime.Value = DateTime.Parse(t1.ToString("yyyy-MM-dd 00:00:00"));
- RegEndTime.Value = DateTime.Parse(t1.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"));
- //框号
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmJGMatNoReport.getKepNo", null, this.ob);
- cmbMaterial.DataSource = dt;
- cmbMaterial.DisplayMember = "KEP_NO";
- PipeManageClass.SetComboItemHeight(cmbMaterial);
- String[] str = this.ValidDataPurviewIds;
- ArrayList arList = new ArrayList();
- //获取用户对应科室ID
- string User = this.UserInfo.GetDeptid();
- string StorageType = "";//根据传递的参数获取仓库类别
- string StorageAttr = "";////根据传递的参数获取仓库类型
- if (CustomInfo != "")
- {
- string[] strflg = CustomInfo.ToString().Split(new char[] { ',' });
- StorageType = strflg[0];
- StorageAttr = strflg[1];
- }
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.common.WarehousePermissions.getStoreNo", new object[] { StorageType, StorageAttr, str }, this.ob);
- cmbWarehous.DataSource = dt1;
- cmbWarehous.DisplayMember = "STORAGE_NAME";
- cmbWarehous.ValueMember = "STORAGE_NO";
- PipeManageClass.SetComboItemHeight(cmbWarehous);
-
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQuery();
- break;
- case "Export":
- GridHelper.ulGridToExcel(ultraGrid1, "库存信息");
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void doQuery()
- {
- if (!CheckQuery()) return;
- string strRegStart = "";
- string strRegEnd = "";
- string strWare = "";//仓库号
- //string strMat = "";//框号
- string strFurnace = "";//炉号
- string strBatch = "";//批号
- string strWoid = "";//工单号
- ArrayList pram = new ArrayList();
- if (chkWarehous.Checked)
- {
- strWare = cmbWarehous.Value.ToString();
- }
- //if (chkMaterial.Checked)
- //{
- // strMat = cmbMaterial.Value.ToString();
- //}
- if (chkRegTime.Checked)
- {
- strRegStart = RegStartTime.Value.ToString();
- strRegEnd = RegEndTime.Value.ToString();
- }
- else
- {
- strRegStart = "1";
- }
- if (chkFurnace.Checked)
- {
- strFurnace = txtFurnace.Text.Trim();
- }
- if (chkBatch.Checked)
- {
- strBatch = txtBatch.Text.Trim();
- }
- pram.Add(strWare);
- pram.Add("");
- pram.Add(strFurnace);
- pram.Add(strRegStart);
- pram.Add(strRegStart);
- pram.Add(strRegStart);
- pram.Add(strRegEnd);
- pram.Add(strRegEnd);
- pram.Add(strBatch);
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Report.FrmJGMatNoReport.doQueryInfoResult", new object[] { pram }, ob);
- //GridHelper.CopyDataToDatatable(dt, this.dateMat, true);
- List<CouplingMatButtressEntity> listSource = EntityHelper.GetData<CouplingMatButtressEntity>
- ("com.steering.mes.mcp.Report.FrmJGMatNoReport.getQueryCouplingMatLiku", new object[] { pram }, this.ob);
- CouplingMatButtEntitybindingSource1.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- }
- private void chkRegTime_CheckedChanged(object sender, EventArgs e)
- {
- if (chkBatch.Checked) { txtBatch.Enabled = true; } else { txtBatch.Enabled = false; }
- if (chkWarehous.Checked) { cmbWarehous.Enabled = true; } else { cmbWarehous.Enabled = false; }
- if (chkMaterial.Checked) { cmbMaterial.Enabled = true; } else { cmbMaterial.Enabled = false; }
- if (chkFurnace.Checked) { txtFurnace.Enabled = true; } else { txtFurnace.Enabled = false; }
- if (chkRegTime.Checked) { RegStartTime.Enabled = true; RegEndTime.Enabled = true; }
- else
- {
- RegStartTime.Enabled = false; RegEndTime.Enabled = false;
- }
- }
- ///查询时验证必填项
- private bool CheckQuery()
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(RegStartTime.Value.ToString()), DateTime.Parse(RegEndTime.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("开始时间不能大于结束时间!");
- return false;
- }
- if (chkFurnace.Checked && string.IsNullOrEmpty(txtFurnace.Text.Trim()))
- {
- MessageBox.Show("请输入炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- if (chkBatch.Checked && string.IsNullOrEmpty(txtBatch.Text.Trim()))
- {
- MessageBox.Show("请输入批号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- if (chkWarehous.Checked && string.IsNullOrEmpty(cmbWarehous.Text.Trim()))
- {
- MessageBox.Show("请选择仓库号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- if (chkMaterial.Checked && string.IsNullOrEmpty(cmbMaterial.Text.Trim()))
- {
- MessageBox.Show("请选择框号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- return true;
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow urg = ultraGrid1.ActiveRow;
- if (urg == null) return;
- string woid = urg.Cells["WoId"].Text;
- string matNo = urg.Cells["MatNo"].Text;
- string judgeNo = urg.Cells["JudgeStoveNo"].Text;
- }
- }
- }
|