| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- 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;
- using System.Collections;
- namespace Core.LZMes.Client.UIM
- {
- public partial class UIM070020 : FrmBase
- {
- public UIM070020()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Export":
- this.Export();
- break;
- case "Save":
- this.DoSave();
- break;
- }
- }
- /// <summary>
- /// 查询原料库库存数据
- /// </summary>
- private void DoQuery()
- {
- try
- {
-
- this.dataSet1.Tables[0].Clear();
- string startTime = this.ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "19900101";//入库开始时间
- string endTime = this.ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";//入库结束时间
- string specStlGrd = this.textBox3.Text.Trim();//牌号
- string coilWthMin = this.textBox4.Text.Trim();//宽度最小值
- string coilWthMax = this.textBox5.Text.Trim();//宽度最大值
- string coilThkMin = this.textBox6.Text.Trim();//长度
- string coilThkMax = this.textBox7.Text.Trim();//长度
- string curLoadLoc = this.textBox8.Text.Trim();//垛位
- string coilNo = this.textBox9.Text.Trim();//板坯号
- string ordNo = this.textBox11.Text.Trim();//订单号
- string ordSeq = "";// this.textBox12.Text;//合同
- string ordFl =""; //订单区分,默认为8
- if (this.ultraComboEditor5.Text != "")
- {
- ordFl =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 smptime = this.ultraDateTimeEditor4.Value != null ? ultraDateTimeEditor4.DateTime.ToString("yyyyMMdd") : "";//送样时间
- string isspm = -1 == this.ultraComboEditor4.SelectedIndex ? "" : this.ultraComboEditor4.Value.ToString();//是否平整
- string xsqy = this.textBox10.Text.Trim();//销售区域
- string cpcoil = -1 == this.ultraComboEditor6.SelectedIndex ? "" : this.ultraComboEditor6.Value.ToString();//次品区分
- string dlivtp = -1 == this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.Value.ToString();//运输方式
- string prodline = -1 == this.ultraComboEditor3.SelectedIndex ? "" : this.ultraComboEditor3.Value.ToString();//产线
- string ordxz = -1 == this.ultraComboEditor7.SelectedIndex ? "" : this.ultraComboEditor7.Value.ToString();//合同类型性质
- string inyardkind = -1 == this.ultraComboEditor4.SelectedIndex ? "" : this.ultraComboEditor4.Value.ToString();//入库类型
- string slabrt = -1 == this.ultraComboEditor3.SelectedIndex ? "" : this.ultraComboEditor3.Value.ToString();//板坯去向
- string ingrkind = -1 == this.ultraComboEditor9.SelectedIndex ? "" : this.ultraComboEditor9.Value.ToString();//成分等级
- string iswarm = -1 == this.ultraComboEditor6.SelectedIndex ? "" : this.ultraComboEditor6.Value.ToString();//冷坑
- string zhuanlu = -1 == this.ultraComboEditor11.SelectedIndex ? "" : this.ultraComboEditor11.Value.ToString();//转炉
- string ccdenvo = -1 == this.ultraComboEditor10.SelectedIndex ? "" : this.ultraComboEditor10.Value.ToString();//铸机
- string ThkMin = this.textBox6.Text.Trim();//厚度
- string ThkMax = this.textBox7.Text.Trim();//厚度
- string[] queryParams = new string[] { coilNo, specStlGrd, curLoadLoc, coilThkMin, coilThkMax,
- ordNo, ordFl, inyardkind, slabrt, ingrkind, coilWthMin, coilWthMax, devlmtDate ,dlivtp,iswarm,startTime,endTime ,zhuanlu,ccdenvo ,xsqy ,ThkMin,ThkMax };
- this.dataSet1.Clear();
- ArrayList al = new ArrayList();
- al.Add("UIM070020_01.SELECT");
- al.Add(coilNo); al.Add(specStlGrd); al.Add(curLoadLoc); al.Add(coilThkMin); al.Add(coilThkMax); al.Add(ordNo); al.Add(ordFl);
- al.Add(inyardkind); al.Add(slabrt); al.Add(ingrkind); al.Add(coilWthMin);
- al.Add(coilWthMax); al.Add(devlmtDate); al.Add(dlivtp);
- al.Add(iswarm); al.Add(startTime); al.Add(endTime); al.Add(zhuanlu);
- al.Add(ccdenvo); al.Add(xsqy); al.Add(ThkMin); al.Add(ThkMax);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //统计钢卷数量,钢卷总重量
- int coilCount = (int)dataSet1.Tables[0].Compute("count(SLAB_NO)", "");
- double coilWgtSum = 0;
- double slabWgtSum = 0;
- string wgta = "";
- string wgtb = "";
- foreach (DataRow dr in dataSet1.Tables[0].Rows)
- {
- double tmpWgt = 0;
- double slabWgt = 0;
- wgta= dr["WEIGHT_WGT"].ToString() ;
- wgtb= dr["SLAB_WGT"].ToString();
- if (dr["WEIGHT_WGT"].ToString() == "")
- {
- wgta = "0";
- }
- if (dr["SLAB_WGT"].ToString() == "")
- {
- wgtb = "0";
- }
- try
- {
- tmpWgt = double.Parse(wgta);
- slabWgt = double.Parse(wgtb);
- }
- catch (Exception e)
- {
- }
- coilWgtSum += tmpWgt;
- slabWgtSum += slabWgt;
- }
- this.textBox1.Text = coilCount.ToString();
- this.textBox2.Text = coilWgtSum.ToString();
- this.textBox14.Text = (slabWgtSum/1000).ToString();
-
-
-
-
- /*List<string[]> list = new List<String[]>();
- list.Add(queryParams);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM07.UIM070020";
- ccp.MethodName = "queryHYardList";
- ccp.ServerParams = new object[] { list };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);*/
-
-
- }
-
-
-
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
-
- }
- /// <summary>
- /// 导出EXCEL
- /// </summary>
- private void Export()
- {
- 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());
- }
- }
- private void UIM070020_Load(object sender, EventArgs e)
- {
- this.ultraDateTimeEditor1.Value = "" ;
- this.ultraDateTimeEditor2.Value = "";
- this.ultraDateTimeEditor3.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());
- }
- }
- private void DoSave()
- {
- Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
- ArrayList list = new ArrayList();
- string[] param = null;
- CoreClientParam ccp = new CoreClientParam();
- rs = this.ultraGrid1.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- param = new string[2];
- param[0] = rs[i].Cells["LZBZ"].Text.ToString().Trim();
- param[1] = rs[i].Cells["OLD_SAMPL_NO"].Value.ToString().Trim();
- list.Add(param);
- }
- }
- ccp.ServerName = "UIM.UIM070020";
- ccp.MethodName = "addLzbz";
- ccp.ServerParams = new Object[] { list };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
- {
- try
- {
- if (this.ultraGrid1.ActiveRow != null)
- {
- string COIL_NO = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ultraGrid1.ActiveRow.Cells["H_COIL_NO"].Value));
- UIM010081C frm = new UIM010081C();
- frm.ob = this.ob;
- frm.Condition = COIL_NO;
- frm.ShowDialog();
- //Core.LZMes.Client.UIB.UIB010301 frm = new Core.LZMes.Client.UIB.UIB010301();
- //frm.ob = this.ob;
- //frm.OrderNO = Common.FixDBManager.CheckNullStr(this.ugrd_RollPlan.ActiveRow.Cells["ORD_NO"].Value);
- //frm.OrderSEQ = Common.FixDBManager.CheckNullStr(this.ugrd_RollPlan.ActiveRow.Cells["ORD_SEQ"].Value); ;
- //frm.ShowDialog();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void UIM070020_Load_1(object sender, EventArgs e)
- {
- this.ultraDateTimeEditor3.Value = null;
- this.ultraDateTimeEditor1.Value = null;
- }
- }
- }
|