| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- 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;
- using CoreFS.CA06;
- namespace Core.LZMes.Client.UIM
- {
- public partial class UIM010212 : FrmBase
- {
- private string opTime = "";
- private string shift = "";
- private string group = "";
- private string stockNo = "";
- int queryType = 0;
- public UIM010212()
- {
- InitializeComponent();
- }
- private void UIM010212_Load(object sender, EventArgs e)
- {
- this.ExportColumnsInit();//初始化导出字段设定
- }
- /// <summary>
- /// 导出时不需要显示的字段
- /// </summary>
- string[] ExportColumns;
- /// <summary>
- /// 不需要导出的字段的名字组初始化
- /// </summary>
- private void ExportColumnsInit()
- {
- this.ExportColumns = new string[]{
- "YARD_ENTRY_DTIME",
- "TRNF_DTIME",
- "PRODNM_CD",
- "CZSJ",
- "SHIFT",
- "WKGROUP",
- "CZR",
- "ZPH",
- "TOT_DEC_GRD",
- "INGR_DEC_GRD",
- "MATLQLTY_DEC_GRD",
- "SIZE_DEC_RST",
- "EXTSHAPE_DEC_GRD",
- "WGT_DEC_RST",
- "ORD_NO",
- "ORD_SEQ",
- "DLIV_TP",
- "ORDCUST_CD",
- "CHARGE_NO",
- "OP_TYPE",
- "DLIV_DIRNO",
- "ORD_DEVLMT_DATE"
- };
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.label1.Focus();
- this.DoQuery();
- break;
- case "Exit":
- this.Close();
- break;
- case "":
- break;
- }
- }
- /// <summary>
- /// 查询原料库钢卷出入库记录
- /// </summary>
- private void DoQuery()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- string startTime = this.dteStartDate.DateTime.ToString("yyyyMMdd");//开始时间 1
- opTime = this.dteStartDate.DateTime.ToString("yyyy年MM月dd日");
- string endTime = this.dteEndDate.DateTime.ToString("yyyyMMdd");//结束时间 2
- string specStlGrd = this.txtSPEC_STL_GRD.Text;//牌号 3
- string coilNo = this.txtOLD_SAMPL_NO.Text;//钢卷号 9
- queryType = 0;//查询类型 0 入库记录 1 出库记录
- string[] queryParams = new string[] { startTime, endTime, specStlGrd, coilNo };
- for (int i = 0; i < queryParams.Length; i++)
- {
- if (queryParams[i] == null)
- {
- queryParams[i] = "";
- }
- }
- List<string[]> list = new List<String[]>();
- list.Add(queryParams);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- System.Collections.ArrayList paramArray = new System.Collections.ArrayList();
- paramArray.Add("UIM010211_01.SELECT");
- paramArray.Add(startTime);
- paramArray.Add(endTime);
- paramArray.Add(specStlGrd);
- paramArray.Add(coilNo);
- ccp.ServerParams = new object[] { paramArray };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- DataRowCollection drs = this.dataSet1.Tables[0].Rows;
- int coilCount = 0;
- double wgtCount = 0;
- int drsSize = drs.Count;
- coilCount = drsSize;
- for (int i = 0; i < drsSize; i++)
- {
- double actWgt = 0;
- try
- {
- actWgt = double.Parse(drs[i]["ACT_WGT"].ToString());
- }
- catch (Exception e)
- {
- }
- wgtCount += actWgt;
- }
- if (coilCount == 0)
- {
- this.textBox1.Text = "";
- this.textBox2.Text = "";
- }
- else
- {
- this.textBox1.Text = coilCount.ToString();
- this.textBox2.Text = (wgtCount / 1000).ToString();
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void button1_Click_1(object sender, EventArgs e)
- {
- try
- {
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fileName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter1.Export(ultraGrid1, fileName);
- System.Diagnostics.Process.Start(fileName);
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- }
- }
|