| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Core.Mes.Client.Common;
- using System.Collections;
- namespace Core.LgMes.Client.LgDeviceManager
- {
- public partial class FrmCLRepairBP : Core.Mes.Client.Common.frmStyleBase
- {
- bool bOK = false; //是否响应结晶器号选择改变事件
- public string strNo = "", strCCM = "";
- public FrmCLRepairBP(OpeBase oba)
- {
- InitializeComponent();
- ob = oba;
- }
- private void FrmCLRepairBP_Load(object sender, EventArgs e)
- {
- if (strCCM.Length > 0)
- {
- cmbCCM.Text = strCCM;
- this.cbbCCM_SelectedIndexChanged(this, null);
- if (strNo.Length > 0)
- {
- cmbID.Text = strNo;
- bOK = true;
- this.cbbID_SelectedIndexChanged(this, null);
- }
- }
- else
- {
- bOK = true;
- proc_ResetControl();
- btnBegin.Enabled = btnEnd.Enabled = false;
- }
- }
- private void NumberEditor_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b'))
- {
- e.Handled = true;
- }
- }
- /// <summary>
- /// 加载结晶器编号
- /// </summary>
- /// <param name="strCCM"></param>
- private void proc_GetID(string strCCM)
- {
- try
- {
- if (strCCM.Length == 0)
- return;
- string strErr = "";
- ArrayList arry = new ArrayList();
- if (strCCM == "1#连铸机" || strCCM == "2#连铸机")
- {
- arry.Add("OneandTwoCCM.select");
- }
- else
- {
- arry.Add("CRYSTALLIZERID.select");
- arry.Add(strCCM);
- }
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
-
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
- {
- MessageBox.Show("结晶器号加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- if (MessageBox.Show("是否重新加载结晶器号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
- proc_GetID(strCCM);
- return;
- }
- cmbID.DataSource = ds.Tables[0];
- cmbID.DisplayMember = "CRYSTALLIZERID";
- if (ds.Tables[0].Rows.Count == 0)
- {
- proc_ResetControl();
- btnBegin.Enabled = btnEnd.Enabled = false;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- private void proc_ResetControl()
- {
- try
- {
- cmbID.Text = "";
- cmbType.SelectedIndex = -1;
- cmbReason.Text = "";
- udteRepair.Text = "";
- udteRepairTime.Text = "";
- txtCurrID1.Clear();
- txtCurrID2.Clear();
- txtCurrID3.Clear();
- txtCurrID4.Clear();
- txtCurrID5.Clear();
- txtCurrID6.Clear();
- cmbID1.SelectedIndex = -1;
- cmbID2.SelectedIndex = -1;
- cmbID3.SelectedIndex = -1;
- cmbID4.SelectedIndex = -1;
- cmbID5.SelectedIndex = -1;
- cmbID6.SelectedIndex = -1;
- txtCurrCS1.Clear();
- txtCurrCS2.Clear();
- txtCurrCS3.Clear();
- txtCurrCS4.Clear();
- txtCurrCS5.Clear();
- txtCurrCS6.Clear();
- txtCS1.Clear();
- txtCS2.Clear();
- txtCS3.Clear();
- txtCS4.Clear();
- txtCS5.Clear();
- txtCS6.Clear();
- txtMemo.Clear();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- private TextBox proc_GetTextBox(string strComboBoxName)
- {
- switch (strComboBoxName)
- {
- case "cbbID1":
- {
- return txtCS1;
- }
- case "cbbID2":
- {
- return txtCS2;
- }
- case "cbbID3":
- {
- return txtCS3;
- }
- case "cbbID4":
- {
- return txtCS4;
- }
- case "cbbID5":
- {
- return txtCS5;
- }
- case "cbbID6":
- {
- return txtCS6;
- }
- }
- return null;
- }
- /// <summary>
- /// 维修开始
- /// </summary>
- private void proc_Begin()
- {
- try
- {
- if (cmbID.Items.Count == 0)
- return;
- string strCcm = cmbCCM.Text.Trim();
- string strID = cmbID.Text.Trim();
- if (strID.Length == 0)
- {
- MessageBox.Show("请选择需要维修的结晶器编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- cmbID.Focus();
- return;
- }
- string strType = cmbType.Text.Trim();
- if (strType.Length == 0)
- {
- MessageBox.Show("请选择维修类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- cmbType.Focus();
- return;
- }
- if (udteRepair.Text.Trim().Length == 0)
- udteRepair.DateTime = DateTime.Now;
- if (MessageBox.Show("确定要维修[" + strCcm + "]的结晶器[" + strID + "]吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- proc_GetID(strCcm);
- return;
- }
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("FrmCLRepairBP.Select_6");
- arry.Add(strCcm);
- arry.Add(strID);
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
- if (iCnt == 0)
- {
- MessageBox.Show("[" + strCcm + "]不存在结晶器[" + strID + "]信息,无法维修!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- proc_GetID(strCcm);
- cmbID.Focus();
- return;
- }
- iCnt = 0;
- ds = null;
- strErr = "";
- arry.Clear();
- ccs.ob = this.ob;
- arry.Add("FrmCLRepairBP.Select_7");
- arry.Add(strCcm);
- arry.Add(strID);
- ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"].ToString().Trim()) != "下线")
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]当前状态[" + Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"]) + "],只有在[下线]状态才能维修!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- cmbID.Focus();
- return;
- }
- #region//水箱信息修改
- string strReturn = "";
- #endregion
- strErr = "";
- arry.Clear();
- ccs.ob = this.ob;
- arry.Add("FrmCLRepairBP.Update_2");
- arry.Add(strID);
- arry.Add(strCcm);
- arry.Add(strType);
- arry.Add(udteRepair.DateTime.ToString("yyyy-MM-dd HH:mm:ss"));
- arry.Add(cmbReason.Text.Trim());
- arry.Add(txtMemo.Text.Trim());
- arry.Add(CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
- if (!(strErr == null || strErr == ""))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- strErr = "";
- strReturn = "";
- arry.Clear();
- ccs.ob = this.ob;
- arry.Add("FrmCLRepairBP.Update_3");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add(strCcm);
- arry.Add(strID);
- strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
- if (!(strErr == null || strErr == ""))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- FrmCrystallizerManageBP frm = (FrmCrystallizerManageBP)this.Tag;
- frm.proc_GetBaseInfo(strCcm, strID);
- proc_GetID(strCcm);
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- return;
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- /// <summary>
- /// 维修结束
- /// </summary>
- private void proc_End()
- {
- try
- {
- if (cmbID.Items.Count == 0)
- return;
- string strCcm = cmbCCM.Text.Trim();
- string strID = cmbID.Text.Trim();
- if (strID.Length == 0)
- {
- MessageBox.Show("请选择维修中的结晶器编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- cmbID.Focus();
- return;
- }
- string strType = cmbType.Text.Trim();
- if (strType.Length == 0)
- {
- MessageBox.Show("请选择维修类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- cmbType.Focus();
- return;
- }
- if (udteRepairTime.Text.Trim().Length == 0)
- udteRepairTime.DateTime = DateTime.Now;
- if (udteRepair.DateTime > udteRepairTime.DateTime)
- {
- MessageBox.Show("送修时间不能大于修复时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- udteRepairTime.Focus();
- return;
- }
- #region
- #endregion
- if (MessageBox.Show("确定[" + strCcm + "]结晶器[" + strID + "]维修结束吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- {
- proc_GetID(strCcm);
- return;
- }
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("FrmCLRepairBP.Select_8");
- arry.Add(strCcm);
- arry.Add(strID);
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
- if (iCnt == 0)
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]信息不存在,无法保存维修信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- proc_GetID(strCcm);
- cmbID.Focus();
- return;
- }
- iCnt = 0;
- ds = null;
- strErr = "";
- arry.Clear();
- ccs.ob = this.ob;
- arry.Add("FrmCLRepairBP.Select_9");
- arry.Add(strCcm);
- arry.Add(strID);
- ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"].ToString().Trim()) != "维修")
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]当前状态[" + Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"]) + "],只有在[维修]状态才能结束维修!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- cmbID.Focus();
- return;
- }
- #region//水箱信息修改
- string strReturn = "";
- #endregion
- strErr = "";
- strReturn = "";
- arry.Clear();
- ccs.ob = this.ob;
- arry.Add("FrmCLRepairBP.Update_4");
- arry.Add(strType);
- arry.Add(udteRepair.DateTime.ToString("yyyy-MM-dd HH:mm:ss"));
- arry.Add(udteRepairTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss"));
- arry.Add(cmbReason.Text.Trim());
- arry.Add(txtMemo.Text.Trim());
- arry.Add(CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- arry.Add(strID);
- arry.Add(strCcm);
- strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
- if (!(strErr == null || strErr == ""))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- strErr = "";
- strReturn = "";
- arry.Clear();
- ccs.ob = this.ob;
- arry.Add("FrmCLRepairBP.Update_5");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add("");
- arry.Add(strCcm);
- arry.Add(strID);
- strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
- if (!(strErr == null || strErr == ""))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- FrmCrystallizerManageBP frm = (FrmCrystallizerManageBP)this.Tag;
- frm.proc_GetBaseInfo(strCcm, strID);
- proc_GetID(strCcm);
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- return;
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- /// <summary>
- /// 维修开始
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnBegin_Click(object sender, EventArgs e)
- {
- proc_Begin();
- }
- /// <summary>
- /// 维修结束
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnEnd_Click(object sender, EventArgs e)
- {
- proc_End();
- }
- /// <summary>
- /// 加载结晶器信息
- /// </summary>
- /// <param 铸机好="strCCM"></param>
- /// <param 结晶器编号="strID"></param>
- private void proc_GetPluginInfo(string strCCM, string strID)
- {
- try
- {
- if (strCCM.Length == 0)
- return;
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("FrmCLRepairBP.Select_1");
- arry.Add(strCCM);
- arry.Add(strCCM);
- arry.Add(strID);
- arry.Add(strCCM);
- arry.Add(strID);
- arry.Add(strCCM);
- arry.Add(strID);
- arry.Add(strCCM);
- arry.Add(strID);
- arry.Add(strCCM);
- arry.Add(strID);
- arry.Add(strCCM);
- arry.Add(strID);
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
-
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
- {
- MessageBox.Show("结晶器插件信息加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- if (MessageBox.Show("是否重新加载结晶器插件信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
- proc_GetPluginInfo(strCCM, strID);
- return;
- }
- if (ds.Tables[0].Rows.Count>0)
- {
- DataRow dr = ds.Tables[0].NewRow();
- dr["ID"] = "0";
- dr["PLUGINNO"] = "";
- dr["TYPE"] = "2";
- ds.Tables[0].Rows.InsertAt(dr, 0);
- dr = ds.Tables[0].NewRow();
- dr["ID"] = "0";
- dr["PLUGINNO"] = "";
- dr["TYPE"] = "1";
- ds.Tables[0].Rows.InsertAt(dr, 0);
- dr = ds.Tables[0].NewRow();
- dr["ID"] = "0";
- dr["PLUGINNO"] = "";
- dr["TYPE"] = "0";
- ds.Tables[0].Rows.InsertAt(dr, 0);
- DataSet ds1 = ds.Copy();
- DataView dv1 = ds1.Tables[0].DefaultView;
- dv1.RowFilter = "Type = '0'";
- DataSet ds2 = ds.Copy();
- DataView dv2 = ds2.Tables[0].DefaultView;
- dv2.RowFilter = "Type = '0'";
- DataSet ds3 = ds.Copy();
- DataView dv3 = ds3.Tables[0].DefaultView;
- dv3.RowFilter = "Type = '1'";
- DataSet ds4 = ds.Copy();
- DataView dv4 = ds4.Tables[0].DefaultView;
- dv4.RowFilter = "Type = '1'";
- DataSet ds5 = ds.Copy();
- DataView dv5 = ds5.Tables[0].DefaultView;
- dv5.RowFilter = "Type = '2'";
- DataSet ds6 = ds.Copy();
- DataView dv6 = ds6.Tables[0].DefaultView;
- dv6.RowFilter = "Type = '2'";
- cmbID1.DataSource = dv1;
- cmbID1.ValueMember = "ID";
- cmbID1.DisplayMember = "PLUGINNO";
- cmbID2.DataSource = dv2;
- cmbID2.ValueMember = "ID";
- cmbID2.DisplayMember = "PLUGINNO";
- cmbID3.DataSource = dv3;
- cmbID3.ValueMember = "ID";
- cmbID3.DisplayMember = "PLUGINNO";
- cmbID4.DataSource = dv4;
- cmbID4.ValueMember = "ID";
- cmbID4.DisplayMember = "PLUGINNO";
- cmbID5.DataSource = dv5;
- cmbID5.ValueMember = "ID";
- cmbID5.DisplayMember = "PLUGINNO";
- cmbID6.DataSource = dv6;
- cmbID6.ValueMember = "ID";
- cmbID6.DisplayMember = "PLUGINNO";
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- private void cbbCCM_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (cmbCCM.Text.Length > 0)
- {
- proc_GetPluginInfo(cmbCCM.Text, "");
- proc_GetID(cmbCCM.Text);
- }
- }
- private void cbbID_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
-
- proc_GetPluginInfo(cmbCCM.Text.Trim(), cmbID.Text.Trim());
- if (!bOK)
- return;
- string strCcm = cmbCCM.Text.Trim();
- string strID = cmbID.Text.Trim();
- if (strID.Length == 0)
- {
- cmbType.SelectedIndex = -1;
- cmbReason.Text = "";
- udteRepair.Text = "";
- udteRepairTime.Text = "";
- txtCurrID1.Clear();
- txtCurrID2.Clear();
- txtCurrID3.Clear();
- txtCurrID4.Clear();
- txtCurrID5.Clear();
- txtCurrID6.Clear();
- cmbID1.SelectedIndex = -1;
- cmbID2.SelectedIndex = -1;
- cmbID3.SelectedIndex = -1;
- cmbID4.SelectedIndex = -1;
- cmbID5.SelectedIndex = -1;
- cmbID6.SelectedIndex = -1;
- txtCurrCS1.Clear();
- txtCurrCS2.Clear();
- txtCurrCS3.Clear();
- txtCurrCS4.Clear();
- txtCurrCS5.Clear();
- txtCurrCS6.Clear();
- txtCS1.Clear();
- txtCS2.Clear();
- txtCS3.Clear();
- txtCS4.Clear();
- txtCS5.Clear();
- txtCS6.Clear();
- txtMemo.Clear();
- btnBegin.Enabled = btnEnd.Enabled = false;
- return;
- }
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("FrmCLRepairBP.Select_3");
- arry.Add(strID);
- arry.Add(strCcm);
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
-
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (ds.Tables[0].Rows.Count > 0)
- {
- cmbType.Text = Convert.ToString(ds.Tables[0].Rows[0]["REPAIRTYPE"]);
- udteRepair.DateTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["REPAIRTIME"]);
- udteRepairTime.Text = "";
- cmbReason.Text = Convert.ToString(ds.Tables[0].Rows[0]["REASON"]);
- txtMemo.Text = Convert.ToString(ds.Tables[0].Rows[0]["MEMO"]);
- btnBegin.Enabled = false;
- }
- else
- {
- cmbType.SelectedIndex = -1;
- udteRepair.Text = "";
- udteRepairTime.Text = "";
- cmbReason.Text = "";
- txtMemo.Clear();
- btnBegin.Enabled = true;
- }
- btnEnd.Enabled = !btnBegin.Enabled;
- ds = null;
- strErr = "";
- arry.Clear();
- arry.Add("FrmCLRepairBP.Select_4");
- arry.Add(strID);
- arry.Add(strCcm);
- ccs.ob = this.ob;
- ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
-
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
- {
- MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]基本信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (ds.Tables[0].Rows.Count == 0) return;
- txtCurrID1.Text = Convert.ToString(ds.Tables[0].Rows[0]["NO1"]);
- cmbID1.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["ID1"]);
- txtCS1.Text = txtCurrCS1.Text = Convert.ToString(ds.Tables[0].Rows[0]["CS1"]);
- txtCurrID2.Text = Convert.ToString(ds.Tables[0].Rows[0]["NO2"]);
- cmbID2.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["ID2"]);
- txtCS2.Text = txtCurrCS2.Text = Convert.ToString(ds.Tables[0].Rows[0]["CS2"]);
- txtCurrID3.Text = Convert.ToString(ds.Tables[0].Rows[0]["NO3"]);
- cmbID3.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["ID3"]);
- txtCS3.Text = txtCurrCS3.Text = Convert.ToString(ds.Tables[0].Rows[0]["CS3"]);
- txtCurrID4.Text = Convert.ToString(ds.Tables[0].Rows[0]["NO4"]);
- cmbID4.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["ID4"]);
- txtCS4.Text = txtCurrCS4.Text = Convert.ToString(ds.Tables[0].Rows[0]["CS4"]);
- txtCurrID5.Text = Convert.ToString(ds.Tables[0].Rows[0]["NO5"]);
- cmbID5.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["ID5"]);
- txtCS5.Text = txtCurrCS5.Text = Convert.ToString(ds.Tables[0].Rows[0]["CS5"]);
- txtCurrID6.Text = Convert.ToString(ds.Tables[0].Rows[0]["NO6"]);
- cmbID6.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["ID6"]);
- txtCS6.Text = txtCurrCS6.Text = Convert.ToString(ds.Tables[0].Rows[0]["CS6"]);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "提示");
- }
- }
- private void PlugIn_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
- ComboBox cbb = sender as ComboBox;
- if (cbb == null) return;
- if (!(cbb is ComboBox)) return;
- string str = cbb.SelectedValue.ToString();
- if (cbb.SelectedItem != null)
- {
- DataRowView rowView = (DataRowView)cbb.SelectedItem;
- str = rowView.Row["ID"].ToString();
- }
- if (str.Length == 0) return;
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("FrmCLRepairBP.Select_5");
- arry.Add(str);
- CommonClientToServer ccs = new CommonClientToServer();
- ccs.ob = this.ob;
- DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
-
- if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
- {
- return;
- }
- if (ds.Tables[0].Rows.Count == 0)
- {
- proc_GetTextBox(cbb.Name).Clear();
- return;
- }
- proc_GetTextBox(cbb.Name).Text = Convert.ToString(ds.Tables[0].Rows[0]["USETIMES"]);
- }
- catch { }
- }
- private void ulgrpBaseInfoEdit_Click(object sender, EventArgs e)
- {
- }
- }
- }
|