| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- 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 System.Collections;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.LZMes.Client.UIK
- {
- public partial class UICO20180 : FrmBase
- {
- // public static UIK020030 s = null;
- public UICO20180()
- {
- InitializeComponent();
- // s = this;
- }
- private void UICO20180_Load(object sender, EventArgs e)
- {
- //CoreClientParam ccp = new CoreClientParam();
- //ccp.ServerName = "UIK.UIK02.UIK020040";
- //ccp.MethodName = "queryRollManaNo";
- //ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //ArrayList list = (ArrayList)(ccp.ReturnObject);
- //if (list != null)
- //{
- // int listSize = list.Count;
- // Infragistics.Win.ValueListItem[] valueListItems = new Infragistics.Win.ValueListItem[listSize];
- // for (int i = 0; i < listSize; i++)
- // {
- // Infragistics.Win.ValueListItem item = new Infragistics.Win.ValueListItem();
- // string[] param = (string[])list[i];
- // item.DataValue = param[1];
- // item.DisplayText = param[1]; ;
- // valueListItems[i] = item;
- // }
- // this.ultraComboEditor1.Items.AddRange(valueListItems);
- // this.ultraComboEditor1.SelectedIndex = 0;
- //}
- //this.ultraComboEditor2.SelectedIndex = 0;
- }
- 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>
- ///
-
- public void DoQuery()
- {
- //string rollManaNo = this.ultraComboEditor1.Text.Trim();
- string beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
- string endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
- string coilNo = textBox9.Text.Trim();
- if ( ("".Equals(beginTime) || "".Equals(endTime)) && "".Equals(coilNo))
- {
- MessageBox.Show("请选择查询条件!" , "提示");
- return;
- }
- CoreClientParam ccp1 = new CoreClientParam();
- Hashtable ht = new Hashtable();
- //ht.Add("i1", this.ultraComboEditor1.Text);
- ht.Add("i1", this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "-" + this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
- ht.Add("o2", "");
- ccp1.ServerName = "UIB.COM.ComDBProcedure";
- ccp1.MethodName = "doXmlProcedure";
- ccp1.ServerParams = new object[] { "UIC010001_03.CALL", ht };
- this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
- this.dataSet1.Clear();
- ArrayList al = new ArrayList();
- if (this.checkBox1.Checked)
- {
- al.Add("UIC020180_01.SELECT");
- }
- else
- {
- al.Add("UIC020180_02.SELECT");
- }
- al.Add(beginTime);
- al.Add(endTime);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.IfShowErrMsg = false;
- 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, actWgt1 = 0, coilWgtSum1 = 0, coilWgtSum2 = 0;
-
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in ultraGrid1.Rows)
- {
- double actWgt = 0, actWgt2 = 0;
- string status = ugr.Cells["EXTSHAPE_QUALITY"].Value.ToString().Trim();
- try
- {
-
- actWgt = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- actWgt2 = double.Parse(ugr.Cells["COIL_RT"].Value.ToString().Trim());
- if ("FA".Equals(status))
- {
- actWgt1 = double.Parse(ugr.Cells["ACT_WGT"].Value.ToString().Trim());
- coilWgtSum1 += actWgt1;
- }
- }
- catch (Exception e)
- {
- }
- coilWgtSum += actWgt;
- coilWgtSum2 += actWgt2;
- }
- this.textBox1.Text = coilCount.ToString();
- this.textBox2.Text = (coilWgtSum / 1000).ToString();
- this.textBox3.Text = (coilWgtSum1 / 1000).ToString();
- this.textBox4.Text = (Math.Round(coilWgtSum2/1000,2)).ToString();
- }
- 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());
- }
- }
- private void ultraGrid1_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
- {
- try
- {
- ultraGrid1.ActiveCell.SelectAll();
- }
- catch
- {
- }
- }
- }
- }
|