| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583 |
- 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;
- namespace Core.LZMes.Client.UIM
- {
- public partial class UIM010100 : FrmBase
- {
- private int selectedIndex1 = -1;
- private int selectedIndex2 = -1;
- private int selectedIndex3 = -1;
- private bool rowClick1 = false;
- private bool rowClick2 = false;
- private bool rowClick3 = false;
- private ArrayList moveList = new ArrayList();
- public UIM010100()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.DoSave();
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- private void DoQuery()
- {
- ultraComboEditor1_ValueChanged(null, null);
- ultraComboEditor2_ValueChanged(null, null);
- ultraComboEditor3_ValueChanged(null, null);
- }
- private void DoSave()
- {
- //移垛时间
- string moveDate = "";
- if (this.ultraDateTimeEditor1.Value != null)
- {
- moveDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMddHHmmss");
- }
- string regId = this.UserInfo.GetUserID();
- string moveOrder = this.UserInfo.GetUserOrder();//班次
- string moverGroup = this.UserInfo.GetUserGroup();//班组
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010100";
- ccp.MethodName = "moveColdCoil";
- ccp.ServerParams = new object[] { moveList,regId,moveOrder,moverGroup,moveDate };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.DoQuery();
- }
- private void UIM010100_Load(object sender, EventArgs e)
- {
- loadYardArea();
- }
- private void loadYardArea()
- {
- int areaType = 1;
- //查询区域信息
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010040";
- ccp.MethodName = "queryYardAreas";
- ccp.ServerParams = new object[] { areaType };
- ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- ArrayList list = (ArrayList)ccp.ReturnObject;
- int listSize = list.Count;
- Infragistics.Win.ValueListItem[] valueListItems1 = new Infragistics.Win.ValueListItem[listSize];
- Infragistics.Win.ValueListItem[] valueListItems2 = new Infragistics.Win.ValueListItem[listSize];
- Infragistics.Win.ValueListItem[] valueListItems3 = new Infragistics.Win.ValueListItem[listSize];
- for (int i = 0; i < listSize; i++)
- {
- Infragistics.Win.ValueListItem item1 = new Infragistics.Win.ValueListItem();
- Infragistics.Win.ValueListItem item2 = new Infragistics.Win.ValueListItem();
- Infragistics.Win.ValueListItem item3 = new Infragistics.Win.ValueListItem();
- Hashtable ht = (Hashtable)list[i];
- item1.DataValue = ((Hashtable)(ht["AREA_NO"]))["value"].ToString();
- item1.DisplayText = ht["AREA_NAME"].ToString();
- item2.DataValue = ((Hashtable)(ht["AREA_NO"]))["value"].ToString();
- item2.DisplayText = ht["AREA_NAME"].ToString();
- item3.DataValue = ((Hashtable)(ht["AREA_NO"]))["value"].ToString();
- item3.DisplayText = ht["AREA_NAME"].ToString();
- valueListItems1[i] = item1;
- valueListItems2[i] = item2;
- valueListItems3[i] = item3;
- }
- this.ultraComboEditor1.Items.AddRange(valueListItems1);
- this.ultraComboEditor2.Items.AddRange(valueListItems2);
- this.ultraComboEditor3.Items.AddRange(valueListItems3);
- }
- /// <summary>
- /// 根据钢卷号查询垛位
- /// </summary>
- private void findLoadLoc()
- {
- string coilNo = this.textBox1.Text.Trim();
- if ("".Equals(coilNo))
- {
- MessageBox.Show("请输入钢卷号!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010100";
- ccp.MethodName = "queryLoadLoc";
- ccp.ServerParams = new object[] { coilNo };
- ccp = this.ExecuteQuery(ccp,CoreInvokeType.Internal);
- String curLoadLoc = ccp.ReturnObject.ToString();
- this.textBox2.Text = curLoadLoc;
- }
- private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (13 == e.KeyChar)
- {
- findLoadLoc();
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- findLoadLoc();
- }
- private void ultraComboEditor1_ValueChanged(object sender, EventArgs e)
- {
- moveList = new ArrayList();
- if (ultraComboEditor1.Value != null)
- {
- dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010100";
- ccp.MethodName = "queryYardCoils";
- ccp.ServerParams = new object[] { ultraComboEditor1.Value.ToString() };
- ccp.SourceDataTable = dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- if (sender == null)
- {
- return;
- }
- ultraComboEditor2_ValueChanged(null, null);
- ultraComboEditor3_ValueChanged(null, null);
- }
- private void ultraComboEditor2_ValueChanged(object sender, EventArgs e)
- {
- if (ultraComboEditor2.Value != null)
- {
- dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010100";
- ccp.MethodName = "queryYardCoils";
- ccp.ServerParams = new object[] { ultraComboEditor2.Value.ToString() };
- ccp.SourceDataTable = dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- if (sender == null)
- {
- return;
- }
- ultraComboEditor1_ValueChanged(null, null);
- ultraComboEditor3_ValueChanged(null, null);
- }
- private void ultraComboEditor3_ValueChanged(object sender, EventArgs e)
- {
- if (ultraComboEditor3.Value != null)
- {
- dataSet3.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010100";
- ccp.MethodName = "queryYardCoils";
- ccp.ServerParams = new object[] { ultraComboEditor3.Value.ToString() };
- ccp.SourceDataTable = dataSet3.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- if (sender == null)
- {
- return;
- }
- ultraComboEditor1_ValueChanged(null, null);
- ultraComboEditor2_ValueChanged(null, null);
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- if (e == null)
- {
- rowClick1 = true;
- }
- if (rowClick1 && e != null)
- {
- rowClick1 = false;
- return;
- }
- if (ultraGrid1.ActiveRow != null)
- {
- if (selectedIndex1 > -1 && ultraGrid1.ActiveRow.Index != selectedIndex1)
- {
- ultraGrid1.Rows[selectedIndex1].Cells["CHK"].Value = "FALSE";
- }
- ultraGrid1.Rows[ultraGrid1.ActiveRow.Index].Cells["CHK"].Value = ultraGrid1.Rows[ultraGrid1.ActiveRow.Index].Cells["CHK"].Value.ToString().Equals("TRUE") ? "FALSE" : "TRUE";
- selectedIndex1 = ultraGrid1.ActiveRow.Index;
- }
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- if (e == null)
- {
- rowClick2 = true;
- }
- if (rowClick2 && e != null)
- {
- rowClick2 = false;
- return;
- }
- if (ultraGrid2.ActiveRow != null)
- {
- if (selectedIndex2 > -1 && ultraGrid2.ActiveRow.Index != selectedIndex2)
- {
- ultraGrid2.Rows[selectedIndex2].Cells["CHK"].Value = "FALSE";
- }
- ultraGrid2.Rows[ultraGrid2.ActiveRow.Index].Cells["CHK"].Value = ultraGrid2.Rows[ultraGrid2.ActiveRow.Index].Cells["CHK"].Value.ToString().Equals("TRUE") ? "FALSE" : "TRUE";
- selectedIndex2 = ultraGrid2.ActiveRow.Index;
- }
- }
- private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
- {
- if (e == null)
- {
- rowClick3 = true;
- }
- if (rowClick3 && e != null)
- {
- rowClick3 = false;
- return;
- }
- if (ultraGrid3.ActiveRow != null)
- {
- if (selectedIndex3 > -1 && ultraGrid3.ActiveRow.Index != selectedIndex3)
- {
- ultraGrid3.Rows[selectedIndex3].Cells["CHK"].Value = "FALSE";
- }
- ultraGrid3.Rows[ultraGrid3.ActiveRow.Index].Cells["CHK"].Value = ultraGrid3.Rows[ultraGrid3.ActiveRow.Index].Cells["CHK"].Value.ToString().Equals("TRUE") ? "FALSE" : "TRUE";
- selectedIndex3 = ultraGrid3.ActiveRow.Index;
- }
- }
- private void ultraGrid1_MouseClick(object sender, MouseEventArgs e)
- {
- ultraGrid1_AfterRowActivate(null, null);
- }
- private void ultraGrid2_MouseClick(object sender, MouseEventArgs e)
- {
- ultraGrid2_AfterRowActivate(null, null);
- }
- private void ultraGrid3_MouseClick(object sender, MouseEventArgs e)
- {
- ultraGrid3_AfterRowActivate(null, null);
- }
- private void pictureBox1_MouseEnter(object sender, EventArgs e)
- {
- this.toolTip1.Show("从原堆放位置->临时堆放位置", this.pictureBox1);
- }
- private void pictureBox2_MouseEnter(object sender, EventArgs e)
- {
- this.toolTip1.Show("从到堆放位置->原堆放位置或从临时堆放位置->原堆放位置", this.pictureBox2);
- }
- private void pictureBox3_MouseEnter(object sender, EventArgs e)
- {
- this.toolTip1.Show("从原堆放位置->到堆放位置或从临时堆放位置->到堆放位置", this.pictureBox3);
- }
- private void pictureBox4_MouseEnter(object sender, EventArgs e)
- {
- this.toolTip1.Show("从到堆放位置->临时堆放位置", this.pictureBox4);
- }
- /// <summary>
- /// 从原堆放位置->临时堆放位置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- string[] mCoil = null;
- int fromRowCount = dataSet1.Tables[0].Rows.Count;
- for (int i = 0; i < fromRowCount; i++)
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow fromUGR = ultraGrid1.Rows[i];
- if (fromUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (fromUGR.Cells["COIL_NO"].Value == null || fromUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- MessageBox.Show("原堆放位置上没有钢卷,请重新选择!");
- return;
- }
- int tmpRowCount = dataSet2.Tables[0].Rows.Count;
- for (int j = 0; j < tmpRowCount; j++)
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow tmpUGR = ultraGrid2.Rows[j];
- if (tmpUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (tmpUGR.Cells["COIL_NO"].Value != null && !tmpUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- MessageBox.Show("临时堆放位置上存在钢卷,请重新选择!");
- return;
- }
- mCoil = new string[3];
- mCoil[0] = fromUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- mCoil[2] = fromUGR.Cells["COIL_NO"].Value.ToString();
- mCoil[1] = tmpUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- moveList.Add(mCoil);
- fromUGR.Cells["COIL_NO"].Value = "";
- tmpUGR.Cells["COIL_NO"].Value = mCoil[2];
- break;
- }
- }
- break;
- }
- }
- }
- /// <summary>
- /// 从到堆放位置->临时堆放位置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void pictureBox4_Click(object sender, EventArgs e)
- {
- string[] mCoil = null;
- int toRowCount = dataSet3.Tables[0].Rows.Count;
- for (int i = 0; i < toRowCount; i++)
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow toUGR = ultraGrid3.Rows[i];
- if (toUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (toUGR.Cells["COIL_NO"].Value == null || toUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- MessageBox.Show("到堆放位置上没有钢卷,请重新选择!");
- return;
- }
- int tmpRowCount = dataSet2.Tables[0].Rows.Count;
- for (int j = 0; j < tmpRowCount; j++)
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow tmpUGR = ultraGrid2.Rows[j];
- if (tmpUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (tmpUGR.Cells["COIL_NO"].Value != null && !tmpUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- MessageBox.Show("临时堆放位置上存在钢卷,请重新选择!");
- return;
- }
- mCoil = new string[3];
- mCoil[0] = toUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- mCoil[2] = toUGR.Cells["COIL_NO"].Value.ToString();
- mCoil[1] = tmpUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- moveList.Add(mCoil);
- toUGR.Cells["COIL_NO"].Value = "";
- tmpUGR.Cells["COIL_NO"].Value = mCoil[2] ;
- break;
- }
- }
- break;
- }
- }
- }
- /// <summary>
- /// 从原堆放位置->到堆放位置或从临时堆放位置->到堆放位置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void pictureBox3_Click(object sender, EventArgs e)
- {
- string[] mCoil = new string[3];
- int fromRowCount = dataSet1.Tables[0].Rows.Count;
- Infragistics.Win.UltraWinGrid.UltraGridRow fromUGR = null;
- for (int i = 0; i < fromRowCount; i++)
- {
- fromUGR = ultraGrid1.Rows[i];
- if (fromUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (fromUGR.Cells["CUR_LOAD_LOC"].Value != null && !fromUGR.Cells["CUR_LOAD_LOC"].Value.ToString().Equals(""))
- {
- mCoil[0] = fromUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- mCoil[2] = fromUGR.Cells["COIL_NO"].Value.ToString();
- }
- break;
- }
- }
- int tmpRowCount = dataSet2.Tables[0].Rows.Count;
- Infragistics.Win.UltraWinGrid.UltraGridRow tmpUGR = null;
- for (int i = 0; i < tmpRowCount; i++)
- {
- tmpUGR = ultraGrid2.Rows[i];
- if (tmpUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (tmpUGR.Cells["CUR_LOAD_LOC"].Value != null && !tmpUGR.Cells["CUR_LOAD_LOC"].Value.ToString().Equals(""))
- {
- if (mCoil[0] != null && !mCoil[0].Equals(""))
- {
- MessageBox.Show("原堆放位置和临时堆放位置不能同时选中,请确认后再重新选择!");
- return;
- }
- mCoil[0] = tmpUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- mCoil[2] = tmpUGR.Cells["COIL_NO"].Value.ToString();
- }
- break;
- }
- }
- int toRowCount = dataSet3.Tables[0].Rows.Count;
- Infragistics.Win.UltraWinGrid.UltraGridRow toUGR = null;
- for (int i = 0; i < toRowCount; i++)
- {
- toUGR = ultraGrid3.Rows[i];
- if (toUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (toUGR.Cells["COIL_NO"].Value != null && !toUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- MessageBox.Show("到堆放位置上存在钢卷,请确认后再重新选择!");
- return;
- }
- mCoil[1] = toUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- break;
- }
- }
- if (mCoil[1] == null || mCoil[1].Equals(""))
- {
- MessageBox.Show("原堆放位置或临时堆放位置没有选中的钢卷,请确认后再重新选择!");
- return;
- }
- if (mCoil[2] == null || mCoil[2].Equals(""))
- {
- MessageBox.Show("没有选择到堆放位置,请确认后再重新选择!");
- return;
- }
- moveList.Add(mCoil);
- if (fromUGR != null && fromUGR.Cells["COIL_NO"].Value != null && !fromUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- fromUGR.Cells["COIL_NO"].Value = "";
- }
- else
- {
- tmpUGR.Cells["COIL_NO"].Value = "";
- }
- toUGR.Cells["COIL_NO"].Value = mCoil[2];
- }
- /// <summary>
- /// 从到堆放位置->原堆放位置或从临时堆放位置->原堆放位置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void pictureBox2_Click(object sender, EventArgs e)
- {
- string[] mCoil = new string[3];
- int toRowCount = dataSet3.Tables[0].Rows.Count;
- Infragistics.Win.UltraWinGrid.UltraGridRow toUGR = null;
- for (int i = 0; i < toRowCount; i++)
- {
- toUGR = ultraGrid3.Rows[i];
- if (toUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (toUGR.Cells["CUR_LOAD_LOC"].Value != null && !toUGR.Cells["CUR_LOAD_LOC"].Value.ToString().Equals(""))
- {
- mCoil[0] = toUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- mCoil[2] = toUGR.Cells["COIL_NO"].Value.ToString();
- }
- break;
- }
- }
- int tmpRowCount = dataSet2.Tables[0].Rows.Count;
- Infragistics.Win.UltraWinGrid.UltraGridRow tmpUGR = null;
- for (int i = 0; i < tmpRowCount; i++)
- {
- tmpUGR = ultraGrid2.Rows[i];
- if (tmpUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (tmpUGR.Cells["CUR_LOAD_LOC"].Value != null && !tmpUGR.Cells["CUR_LOAD_LOC"].Value.ToString().Equals(""))
- {
- if (mCoil[0] != null && !mCoil[0].Equals(""))
- {
- MessageBox.Show("到堆放位置和临时堆放位置不能同时选中,请确认后再重新选择!");
- return;
- }
- mCoil[0] = tmpUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- mCoil[2] = tmpUGR.Cells["COIL_NO"].Value.ToString();
- }
- break;
- }
- }
- int fromRowCount = dataSet1.Tables[0].Rows.Count;
- Infragistics.Win.UltraWinGrid.UltraGridRow fromUGR = null;
- for (int i = 0; i < fromRowCount; i++)
- {
- fromUGR = ultraGrid1.Rows[i];
- if (fromUGR.Cells["CHK"].Value.ToString().ToUpper().Equals("TRUE"))
- {
- if (fromUGR.Cells["COIL_NO"].Value != null && !fromUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- MessageBox.Show("原堆放位置上存在钢卷,请确认后再重新选择!");
- return;
- }
- mCoil[1] = fromUGR.Cells["CUR_LOAD_LOC"].Value.ToString();
- break;
- }
- }
- if (mCoil[2] == null || mCoil[2].Equals(""))
- {
- MessageBox.Show("到堆放位置或临时堆放位置没有选中的钢卷,请确认后再重新选择!");
- return;
- }
- if (mCoil[1] == null || mCoil[1].Equals(""))
- {
- MessageBox.Show("没有选择原堆放位置,请确认后再重新选择!");
- return;
- }
- moveList.Add(mCoil);
- if (toUGR != null && toUGR.Cells["COIL_NO"].Value != null && !toUGR.Cells["COIL_NO"].Value.ToString().Equals(""))
- {
- toUGR.Cells["COIL_NO"].Value = "";
- }
- else
- {
- tmpUGR.Cells["COIL_NO"].Value = "";
- }
- fromUGR.Cells["COIL_NO"].Value = mCoil[2];
- }
- }
- }
|