| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- 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;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Infragistics.Win.UltraWinEditors;
- using System.Text.RegularExpressions;
- namespace Core.StlMes.Client.MilCount
- {
- public partial class FrmTPRecall : FrmBase
- {
- public FrmTPRecall()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "doQuery":
- doQuery();
- break;
- case "doModify":
- Update();
- break;
- //case "doDelete":
- // this.doDeleteOrResume(true);
- // break;
- //case "doResume":
- // this.doDeleteOrResume(false);
- // break;
- //case "Close":
- // this.Close();
- //break;
- }
- }
- private void doQuery()
- {
- string titleName = "";
- if (ultraCheckEditor2.Checked)
- {
- titleName = txt_lcode.Text.Trim();
- DataTable dt = ServerHelper.GetData("com.steering.mes.fprecall.coretpreacll.getLineList", new Object[] { titleName }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- }
- else
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.fprecall.coretpreacll.getLineList_all", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- }
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- }
- String Tzhi = "";
- String Tdun = "";
- private void Update()
- {
- ultraGrid1.UpdateData();
- ArrayList list = new ArrayList();
- ArrayList list1 = new ArrayList();
- ArrayList list2 = new ArrayList();
- String ordernum = "";
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHK"].Value))
- {
- ordernum = row.Cells["FPZhi"].Value.ToString();
- }
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHK"].Value))
- {
- ordernum = row.Cells["FPZhi"].Value.ToString();
- }
-
- if (Convert.ToBoolean(row.Cells["CHK"].Value))
- {
- String Tzhi = row.Cells["FPZhi"].Value.ToString();
- list1.Add(Tzhi);
- String Tdun = row.Cells["FPDun"].Value.ToString();
- list2.Add(Tdun);
- String r = row.Cells["ID"].Value.ToString();
- String r1 = row.Cells["GPLode"].Value.ToString();
- String r2 = row.Cells["ZGLode"].Value.ToString();
- list.Add(r+r1+r2);
- }
- }
- ServerHelper.SetData("com.steering.mes.fprecall.coretpreacll.setLineList_all", new Object[] { txt_lh.Text, list, list1, list2 }, this.ob);
- }
- private void ultraTextEditor1_TextChanged(object sender, EventArgs e)
- {
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHK"].Value))
- {
- Tzhi = row.Cells["上料合计单倍尺支"].Value.ToString();
- Tdun = row.Cells["上料合计单倍尺吨"].Value.ToString();
- }
- }
- if (txt_Tz.Text == "")
- {
- txt_Tz.Text = "0";
- }
- decimal dun = Int16.Parse(txt_Tz.Text) * (decimal.Parse(Tdun) / Int16.Parse(Tzhi));
- dun = Math.Round(dun, 3);
- txt_Td.Text = dun.ToString();
- }
- String ordernum = "";
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- ultraGrid1.UpdateData();
- if (e.Cell.Column.Key == "CHK")
- {
- UltraGridRow[] rows = ultraGrid1.Rows.AsQueryable().Where(a=> a.Cells["CHK"].Value.ToString() == "True"
- && a.Cells["ORDERNO"].Value.ToString() != e.Cell.Row.Cells["ORDERNO"].Value.ToString()).ToArray();
- if (rows.Length > 0)
- {
- if (rows[0].Cells["ORDERNO"].Value.ToString() != e.Cell.Row.Cells["ORDERNO"].Value.ToString())
- {
- e.Cell.Value = false;
- }
- }
- }
- }
-
-
-
-
- }
- }
|