| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- 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 CoreFS.CA06;
- namespace Core.LZMes.Client.UIM
- {
- public partial class UIM010230 : FrmBase
- {
- public UIM010230()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Export":
- this.DoExport();
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询成品库库存数据
- /// </summary>
- private void DoQuery()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- string startTime = this.ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";//入库开始时间
- string endTime = this.ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";//入库结束时间
- string specStlGrd = this.textBox3.Text;//牌号
- string coilWthMin = this.textBox4.Text;//宽度最小值
- string coilWthMax = this.textBox5.Text;//宽度最大值
- string coilThkMin = this.textBox6.Text;//厚度最小值
- string coilThkMax = this.textBox7.Text;//厚度最大值
- string curLoadLoc = this.textBox8.Text;//垛位
- string coilNo = this.textBox9.Text;//钢卷号
- string ordNo = this.textBox11.Text;//订单号
- string ordSeq = "";// this.textBox12.Text;//合同号
- string ordFl = -1 == this.ultraComboEditor5.SelectedIndex ? "" : this.ultraComboEditor5.Value.ToString();//订单区分
- string devlmtDate = this.ultraDateTimeEditor3.Value != null ? ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd") : "";//交货期
- string progCd = -1 == this.ultraComboEditor2.SelectedIndex ? "" : this.ultraComboEditor2.Value.ToString();//进程状态
- string smpSendTime = this.ultraDateTimeEditor4.Value != null ? ultraDateTimeEditor4.DateTime.ToString("yyyyMMdd") : "";//送样时间
- string prodnmCd = -1 == this.ultraComboEditor6.SelectedIndex ? "" : this.ultraComboEditor6.Value.ToString();//产品类型
- string[] queryParams = new string[] { startTime, endTime, specStlGrd, coilWthMin, coilWthMax,
- coilThkMin, coilThkMax, curLoadLoc, coilNo, ordNo, ordSeq, ordFl, devlmtDate, progCd, smpSendTime,
- prodnmCd};
- List<string[]> list = new List<String[]>();
- list.Add(queryParams);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010230";
- ccp.MethodName = "queryYardList";
- ccp.ServerParams = new object[] { list };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //统计钢卷数量,钢卷总重量
- int coilCount = (int)dataSet1.Tables[0].Compute("count(OLD_SAMPL_NO)", "");
- double coilWgtSum = 0;
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in ultraGrid1.Rows)
- {
-
- double actWgt = 0;
- //string a = ugr.VisibleIndex.ToString();
- //MessageBox.Show(a);
- try
- {
- //Color color = Color.SandyBrown;
- Color color = Color.PaleGoldenrod;
- string status = ugr.Cells["TOT_DEC_GRD"].Value.ToString().Trim();
- if ("合格".Equals(status))
- {
- color = Color.White;
- }
- else if ("不合格".Equals(status))
- {
- color = Color.FromArgb(255, 128, 128);
- }
- ugr.Appearance.BackColor = color;
- actWgt = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- }
- catch (Exception e)
- {
- }
- coilWgtSum += actWgt;
- }
-
- double coilWgtSum1 = 0; int count1 = 0;
- double coilWgtSum2 = 0; int count2 = 0;
- double coilWgtSum3 = 0; int count3 = 0;
- double coilWgtSum4 = 0; int count4 = 0;
- double coilWgtSum5 = 0; int count5 = 0;
- double coilWgtSum6 = 0; int count6 = 0;
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in ultraGrid1.Rows)
- {
- double actWgt1 = 0;
-
- try
- {
- // Color color = Color.SandyBrown;
- string status = ugr.Cells["CUR_PROG_CD"].Value.ToString().Trim();
- if ("综合判定待机".Equals(status))
- {
- actWgt1 = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- coilWgtSum1 += actWgt1;
- count1++;
- }
- else if ("重卷指示待机".Equals(status))
- {
- actWgt1 = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- coilWgtSum2 += actWgt1;
- count2++;
- }
- else if ("连退成品充当待机".Equals(status))
- {
- actWgt1 = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- coilWgtSum3 += actWgt1;
- count3++;
- }
- else if ("二级库存".Equals(status))
- {
- actWgt1 = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- coilWgtSum4 += actWgt1;
- count4++;
- }
- else if ("包装作业待机".Equals(status))
- {
- actWgt1 = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- coilWgtSum5 += actWgt1;
- count5++;
- }
- else if ("重卷作业待机".Equals(status))
- {
- actWgt1 = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- coilWgtSum6 += actWgt1;
- count6++;
- }
- }
- catch (Exception e)
- {
- }
- }
- this.textBox1.Text = coilCount.ToString();
- this.textBox2.Text = (coilWgtSum / 1000).ToString();
- this.textBox10.Text = count1.ToString();
- this.textBox12.Text = (coilWgtSum1/1000).ToString();
- this.textBox14.Text = count2.ToString();
- this.textBox13.Text = (coilWgtSum2 / 1000).ToString();
- this.textBox16.Text = count3.ToString();
- this.textBox15.Text = (coilWgtSum3 / 1000).ToString();
- this.textBox18.Text = count4.ToString();
- this.textBox17.Text = (coilWgtSum4 / 1000).ToString();
- this.textBox20.Text = count5.ToString();
- this.textBox19.Text = (coilWgtSum5 / 1000).ToString();
- this.textBox22.Text = count6.ToString();
- this.textBox21.Text = (coilWgtSum6 / 1000).ToString();
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void UIM010230_Load(object sender, EventArgs e)
- {
- this.ultraDateTimeEditor1.Value = "";
- this.ultraDateTimeEditor2.Value = "";
- this.ultraDateTimeEditor3.Value = "";
- this.ultraDateTimeEditor4.Value = "";
- }
- private void DoExport()
- {
- try
- {
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fileName = this.saveFileDialog1.FileName;
- ultraGridExcelExporter1.Export(ultraGrid1, fileName);
- System.Diagnostics.Process.Start(fileName);
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
-
- }
- }
|