| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620 |
- 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.UIK
- {
- public partial class UIK030010 : FrmBase
- {
- public UIK030010()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Insert":
- this.DoInsert();
- break;
- case "Update":
- this.DoUpdate();
- break;
- }
- }
- private void DoQuery()
- {
- if (this.ultraCalendarENDTIME.Enabled == false && this.ultraCalendarSTRATTIME.Enabled == false)
- {
- this.ultraCalendarENDTIME.Text = "";
- this.ultraCalendarSTRATTIME.Text = "";
- }
- try
- {
- string mc_id = this.ultraTextMC_ID.Text.ToString();
- string starttiem = this.ultraCalendarSTRATTIME.Text.ToString();
- string endtime = this.ultraCalendarENDTIME.Text.ToString();
- bool flag = false;
- CoreClientParam ccp = new CoreClientParam();
- DataTable dt = new DataTable();
- if (mc_id == "" && starttiem == "" && endtime == "" && this.ultraCheckAll.Checked == false)
- {
- MessageBox.Show("请选择查询条件!");
- }
- else
- {
- if (this.ultraCheckAll.Checked)
- {
- this.ultraCheckAll.Checked = false;
- ccp.ServerName = "UIK.UIK03.UIK030010";
- ccp.MethodName = "DoQuery";
- ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
- ccp.SourceDataTable = dt;
- //dt = this.dataSet1.Tables[0];
- //ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.ultraGrid1.DataSource = dt;
- //Console.WriteLine(this.dataSet1.Tables[0].ToString());
- if (dt.Rows.Count <= 0)
- {
- MessageBox.Show("暂无记录!");
- }
- this.ultraCalendarENDTIME.Enabled = false;
- this.ultraCalendarSTRATTIME.Enabled = false;
- return;
- }
- else
- {
- flag = true;
- if (this.ultraTextMC_ID.Text != "" || this.ultraCheckEditor1.Checked == true)
- {
- if (this.ultraTextMC_ID.Text == "")
- {
- this.ultraTextMC_ID.Clear();
- this.ultraCheckEditor1.Checked = false;
- this.ultraCheckAll.Checked = false;
- ccp.ServerName = "UIK.UIK03.UIK030010";
- ccp.MethodName = "DoQuery";
- ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.ultraGrid1.DataSource = dt;
- if (dt.Rows.Count <= 0)
- {
- MessageBox.Show("该时间内没有入库信息!");
- }
- this.ultraCalendarENDTIME.Enabled = false;
- this.ultraCalendarSTRATTIME.Enabled = false;
- return;
- }
- if (this.ultraCheckEditor1.Checked == false)
- {
- this.ultraTextMC_ID.Clear();
- this.ultraCheckAll.Checked = false;
- ccp.ServerName = "UIK.UIK03.UIK030010";
- ccp.MethodName = "DoQuery";
- ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.ultraGrid1.DataSource = dt;
- if (dt.Rows.Count <= 0)
- {
- MessageBox.Show("该设备信息不存在!");
- }
- this.ultraCalendarENDTIME.Enabled = false;
- this.ultraCalendarSTRATTIME.Enabled = false;
- return;
- }
- if (this.ultraTextMC_ID.Text != "" && this.ultraCheckEditor1.Checked == true)
- {
- this.ultraTextMC_ID.Clear();
- this.ultraCheckEditor1.Checked = false;
- this.ultraCheckAll.Checked = false;
- ccp.ServerName = "UIK.UIK03.UIK030010";
- ccp.MethodName = "DoQuery";
- ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.ultraGrid1.DataSource = dt;
- if (dt.Rows.Count <= 0)
- {
- MessageBox.Show("记录不存在,请查证后查询!");
- }
- this.ultraCalendarENDTIME.Enabled = false;
- this.ultraCalendarSTRATTIME.Enabled = false;
- return;
- }
- }
-
-
-
- }
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
- private void ultraCheckAll_CheckedChanged(object sender, EventArgs e)
- {
- try
- {
- if (this.ultraCheckAll.Checked)
- {
- this.ultraTextMC_ID.Enabled = false;
- this.ultraCalendarSTRATTIME.Enabled = false;
- this.ultraCalendarENDTIME.Enabled = false;
- }
- if (!this.ultraCheckAll.Checked)
- {
- this.ultraTextMC_ID.Enabled = true;
- this.ultraCalendarSTRATTIME.Enabled = false;
- this.ultraCalendarENDTIME.Enabled = false;
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
- private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
- {
- if (this.ultraCheckEditor1.Checked)
- {
- this.ultraCalendarENDTIME.Enabled = true;
- this.ultraCalendarSTRATTIME.Enabled = true;
- }
- if (!this.ultraCheckEditor1.Checked)
- {
- this.ultraCalendarENDTIME.Enabled = false;
- this.ultraCalendarSTRATTIME.Enabled = false;
- this.ultraCalendarSTRATTIME.Text = "";
- this.ultraCalendarENDTIME.Text = "";
- }
- }
- private void UIK030010_Load(object sender, EventArgs e)
- {
- this.ultraCalendarENDTIME.Enabled = false;
- this.ultraCalendarSTRATTIME.Enabled = false;
- this.ultraCalendarMC_IN_DTIME.Text = "";
- this.ultraCalendarMC_USE_TIME.Text = "";
- this.ultraCalendarMC_CHANGTIME.Text = "";
- this.ultraCalendarMC_CHECKTIME.Text = "";
- }
- private void DoUpdate()
- {
- if (MessageBox.Show("您确认要修改?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
- {
- try
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr.Cells["SELECT_ITEM"].Text.ToString() == "True")
- {
- string mcid,reg_intime, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE,IAREA;
- mcid = ugr.Cells["MC_ID"].Value.ToString();
- reg_intime = ugr.Cells["REG_IN_DTIME"].Value.ToString();
- this.ultraTextMCID2.Enabled = false;
- IMC_NAME = this.ultraTextMC_NAME.Text;
- IMC_MODEL = this.ultraTextMC_MODEL.Text;
- IMC_SPEC = this.ultraTextMC_SPEC.Text;
- IMC_FACTORY = this.ultraTextMC_FACTORY.Text;
- IMC_IN_DTIME = this.ultraCalendarMC_IN_DTIME.Text;
- IMC_USE_TIME = this.ultraCalendarMC_USE_TIME.Text;
- IMC_PRICE = this.ultraTextMC_PRICE.Text;
- IMC_CARE_SECTOR = this.ultraTextMC_CARE_SECTOR.Text;
- IMC_NOM_CAP = this.ultraTextMC_NOM_CAP.Text;
- IMC_UNIT = this.ultraTextMC_UNIT.Text;
- IMC_ACT = this.ultraTextMC_ACT.Text;
- IMC_TAI = this.ultraTextMC_TAI.Text;
- IMC_MFACTUR_UNITS = this.ultraTextMC_MFACTUR_UNITS.Text;
- IMC_USE_YEAR = this.ultraTextMC_USE_YEAR.Text;
- IMC_INSTAL_LOCAL = this.ultraTextMC_INSTAL_LOCAL.Text;
- IREG_IN_ID = this.ultraTextREG_IN_ID.Text;
- IMC_STAT = this.ultraComboMC_STAT.Text;
- IMAIN_MC_NAME = this.ultraTextMAIN_MC_NAME.Text;
- IMC_INSTAL_COUNT = this.ultraTextMC_INSTAL_COUNT.Text;
- IREQ_SPAR_COUNT = this.ultraTextREQ_SPAR_COUNT.Text;
- IREA_STO_CONUT = this.ultraTextREA_STO_CONUT.Text;
- IMC_CHECKREASON = this.ultraTextMC_CHECKREASON.Text;
- IMC_CHANGTIME = this.ultraCalendarMC_CHANGTIME.Text;
- IMC_CHECKCYCLE = this.ultraTextMC_CHECKCYCLE.Text;
- IMC_CHECKTIME = this.ultraCalendarMC_CHECKTIME.Text;
- IMC_CHANGCYCLE = this.ultraTextMC_CHANGCYCLE.Text;
- IAREA = this.ultraTextAREA.Text;
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "UIK.UIK03.UIK030010";
- ccp2.MethodName = "DoUpdate";
- ccp2.ServerParams = new object[] { IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, reg_intime, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE, IAREA };
- ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
- if (0 != ccp2.ReturnCode)
- {
- MessageBox.Show("修改失败!");
- }
- else
- {
- MessageBox.Show("修改成功!");
-
- this.ultraTextMCID2.Enabled = true;
- this.ultraTextMCID2.Clear();
- this.ultraTextMC_NAME.Clear();
- this.ultraTextMC_MODEL.Clear();
- this.ultraTextMC_SPEC.Clear();
- this.ultraTextMC_FACTORY.Clear();
- this.ultraCalendarMC_IN_DTIME.Text = "";
- this.ultraCalendarMC_USE_TIME.Text = "";
- this.ultraTextMC_PRICE.Clear();
- this.ultraTextMC_CARE_SECTOR.Clear();
- this.ultraTextMC_NOM_CAP.Clear();
- this.ultraTextMC_UNIT.Clear();
- this.ultraTextMC_ACT.Clear();
- this.ultraTextMC_TAI.Clear();
- this.ultraTextMC_MFACTUR_UNITS.Clear();
- this.ultraTextMC_USE_YEAR.Clear();
- this.ultraTextMC_INSTAL_LOCAL.Clear();
- this.ultraTextREG_IN_ID.Clear();
- this.ultraComboMC_STAT.Clear();
- this.ultraTextMAIN_MC_NAME.Clear();
- this.ultraTextMC_INSTAL_COUNT.Clear();
- this.ultraTextREQ_SPAR_COUNT.Clear();
- this.ultraTextREA_STO_CONUT.Clear();
- this.ultraTextMC_CHECKREASON.Clear();
- this.ultraCalendarMC_CHANGTIME.Text = "";
- this.ultraTextMC_CHECKCYCLE.Clear();
- this.ultraCalendarMC_CHECKTIME.Text = "";
- this.ultraTextMC_CHANGCYCLE.Clear();
- this.ultraTextAREA.Clear();
- }
- }
- else
- {
- MessageBox.Show("请选择修改行!");
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
- }
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- if (e.Cell.Column.Key == "SELECT_ITEM")
- {
- if (e.Cell.Text == "True")
- {
- string mcid, IREG_IN_DTIME;
- ultraTextMCID2.Text = e.Cell.Row.Cells["MC_ID"].Text;
- // string mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT;
- this.ultraTextMCID2.Text = e.Cell.Row.Cells["MC_ID"].Text;
- mcid = e.Cell.Row.Cells["MC_ID"].Text;
- IREG_IN_DTIME = e.Cell.Row.Cells["REG_IN_DTIME"].Text;
- this.ultraTextMCID2.Enabled = false;
- DataTable dt = new DataTable();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIK.UIK03.UIK030010";
- ccp.MethodName = "DoSelect";
- ccp.ServerParams = new object[] { IREG_IN_DTIME };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- foreach (DataRow dr in dt.Rows)
- {
- this.ultraTextMC_NAME.Text = dr["MC_NAME"].ToString();
- this.ultraTextMC_MODEL.Text = dr["MC_MODEL"].ToString();
- this.ultraTextMC_SPEC.Text = dr["MC_SPEC"].ToString();
- this.ultraTextMC_FACTORY.Text = dr["MC_FACTORY"].ToString();
- this.ultraCalendarMC_IN_DTIME.Text = dr["MC_IN_DTIME"].ToString();
- this.ultraCalendarMC_USE_TIME.Text = dr["MC_USE_TIME"].ToString();
- this.ultraTextMC_PRICE.Text = dr["MC_PRICE"].ToString();
- this.ultraTextMC_CARE_SECTOR.Text = dr["MC_CARE_SECTOR"].ToString();
- this.ultraTextMC_NOM_CAP.Text = dr["MC_NOM_CAP"].ToString();
- this.ultraTextMC_UNIT.Text = dr["MC_UNIT"].ToString();
- this.ultraTextMC_ACT.Text = dr["MC_ACT"].ToString();
- this.ultraTextMC_TAI.Text = dr["MC_TAI"].ToString();
- this.ultraTextMC_MFACTUR_UNITS.Text = dr["MC_MFACTUR_UNITS"].ToString();
- this.ultraTextMC_USE_YEAR.Text = dr["MC_USE_YEAR"].ToString();
- this.ultraTextMC_INSTAL_LOCAL.Text = dr["MC_INSTAL_LOCAL"].ToString();
- this.ultraTextREG_IN_ID.Text = dr["REG_IN_ID"].ToString();
- this.ultraComboMC_STAT.Text = dr["MC_STAT"].ToString();
- this.ultraTextMAIN_MC_NAME.Text = dr["MAIN_MC_NAME"].ToString();
- this.ultraTextMC_INSTAL_COUNT.Text = dr["MC_INSTAL_COUNT"].ToString();
- this.ultraTextREQ_SPAR_COUNT.Text = dr["REQ_SPAR_COUNT"].ToString();
- this.ultraTextREA_STO_CONUT.Text = dr["REA_STO_CONUT"].ToString();
- this.ultraTextMC_CHECKREASON.Text = dr["MC_CHECKREASON"].ToString();
- this.ultraCalendarMC_CHANGTIME.Text = dr["MC_CHANGTIME"].ToString();
- this.ultraTextMC_CHECKCYCLE.Text = dr["MC_CHECKCYCLE"].ToString();
- this.ultraCalendarMC_CHECKTIME.Text = dr["MC_CHECKTIME"].ToString();
- this.ultraTextMC_CHANGCYCLE.Text = dr["MC_CHANGCYCLE"].ToString();
- this.ultraTextAREA.Text = dr["AREA"].ToString();
- }
- }
- else
- {
- this.ultraTextMCID2.Enabled = true;
- this.ultraTextMCID2.Clear();
- this.ultraTextMC_NAME.Clear();
- this.ultraTextMC_MODEL.Clear();
- this.ultraTextMC_SPEC.Clear();
- this.ultraTextMC_FACTORY.Clear();
- this.ultraCalendarMC_IN_DTIME.Text = "";
- this.ultraCalendarMC_USE_TIME.Text = "";
- this.ultraTextMC_PRICE.Clear();
- this.ultraTextMC_CARE_SECTOR.Clear();
- this.ultraTextMC_NOM_CAP.Clear();
- this.ultraTextMC_UNIT.Clear();
- this.ultraTextMC_ACT.Clear();
- this.ultraTextMC_TAI.Clear();
- this.ultraTextMC_MFACTUR_UNITS.Clear();
- this.ultraTextMC_USE_YEAR.Clear();
- this.ultraTextMC_INSTAL_LOCAL.Clear();
- this.ultraTextREG_IN_ID.Clear();
- this.ultraComboMC_STAT.Clear();
- this.ultraTextMAIN_MC_NAME.Clear();
- this.ultraTextMC_INSTAL_COUNT.Clear();
- this.ultraTextREQ_SPAR_COUNT.Clear();
- this.ultraTextREA_STO_CONUT.Clear();
- this.ultraTextMC_CHECKREASON.Clear();
- this.ultraCalendarMC_CHANGTIME.Text = "";
- this.ultraTextMC_CHECKCYCLE.Clear();
- this.ultraCalendarMC_CHECKTIME.Text = "";
- this.ultraTextMC_CHANGCYCLE.Clear();
- this.ultraTextAREA.Clear();
- }
- }
- }
- private void DoInsert()
- {
- if (MessageBox.Show("您确认要插入新的入库信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
- {
- string mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE, IAREA;
- mcid = this.ultraTextMCID2.Text;
- IMC_NAME = this.ultraTextMC_NAME.Text;
- IMC_MODEL = this.ultraTextMC_MODEL.Text;
- IMC_SPEC = this.ultraTextMC_SPEC.Text;
- IMC_FACTORY = this.ultraTextMC_FACTORY.Text;
- IMC_IN_DTIME = this.ultraCalendarMC_IN_DTIME.Text;
- IMC_USE_TIME = this.ultraCalendarMC_USE_TIME.Text;
- IREG_IN_DTIME = DateTime.Now.ToString();
- IMC_PRICE = this.ultraTextMC_PRICE.Text;
- IMC_CARE_SECTOR = this.ultraTextMC_CARE_SECTOR.Text;
- IMC_NOM_CAP = this.ultraTextMC_NOM_CAP.Text;
- IMC_UNIT = this.ultraTextMC_UNIT.Text;
- IMC_ACT = this.ultraTextMC_ACT.Text;
- IMC_TAI = this.ultraTextMC_TAI.Text;
- IMC_MFACTUR_UNITS = this.ultraTextMC_MFACTUR_UNITS.Text;
- IMC_USE_YEAR = this.ultraTextMC_USE_YEAR.Text;
- IMC_INSTAL_LOCAL = this.ultraTextMC_INSTAL_LOCAL.Text;
- IREG_IN_ID = this.ultraTextREG_IN_ID.Text;
- IMC_STAT = this.ultraComboMC_STAT.Text;
- IAREA = this.ultraTextAREA.Text;
- DataTable dt = new DataTable();
- CoreClientParam ccp = new CoreClientParam();
- IMAIN_MC_NAME = this.ultraTextMAIN_MC_NAME.Text;
- IMC_INSTAL_COUNT = this.ultraTextMC_INSTAL_COUNT.Text;
- IREQ_SPAR_COUNT = this.ultraTextREQ_SPAR_COUNT.Text;
- IREA_STO_CONUT = this.ultraTextREA_STO_CONUT.Text;
- IMC_CHECKREASON = this.ultraTextMC_CHECKREASON.Text;
- IMC_CHANGTIME = this.ultraCalendarMC_CHANGTIME.Text;
- IMC_CHECKCYCLE = this.ultraTextMC_CHECKCYCLE.Text;
- IMC_CHECKTIME = this.ultraCalendarMC_CHECKTIME.Text;
- IMC_CHANGCYCLE = this.ultraTextMC_CHANGCYCLE.Text;
- ccp.ServerName = "UIK.UIK03.UIK030010";
- ccp.MethodName = "DoSelect";
- ccp.ServerParams = new object[] { IREG_IN_DTIME };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (dt.Rows.Count > 0)
- {
- MessageBox.Show("该时间下设备已经录入,请重新输入");
- }
- else
- {
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "UIK.UIK03.UIK030010";
- ccp2.MethodName = "DoInsert";
- ccp2.ServerParams = new object[] { mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE, IAREA };
- ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
- if (0 != ccp2.ReturnCode)
- {
- MessageBox.Show("添加失败!");
- }
- else
- {
- MessageBox.Show("添加成功!");
- this.ultraTextMCID2.Enabled = true;
- this.ultraTextMCID2.Clear();
- this.ultraTextMC_NAME.Clear();
- this.ultraTextMC_MODEL.Clear();
- this.ultraTextMC_SPEC.Clear();
- this.ultraTextMC_FACTORY.Clear();
- this.ultraCalendarMC_IN_DTIME.Text = "";
- this.ultraCalendarMC_USE_TIME.Text = "";
- this.ultraTextMC_PRICE.Clear();
- this.ultraTextMC_CARE_SECTOR.Clear();
- this.ultraTextMC_NOM_CAP.Clear();
- this.ultraTextMC_UNIT.Clear();
- this.ultraTextMC_ACT.Clear();
- this.ultraTextMC_TAI.Clear();
- this.ultraTextMC_MFACTUR_UNITS.Clear();
- this.ultraTextMC_USE_YEAR.Clear();
- this.ultraTextMC_INSTAL_LOCAL.Clear();
- this.ultraTextREG_IN_ID.Clear();
- this.ultraComboMC_STAT.Clear();
- this.ultraTextMAIN_MC_NAME.Clear();
- this.ultraTextMC_INSTAL_COUNT.Clear();
- this.ultraTextREQ_SPAR_COUNT.Clear();
- this.ultraTextREA_STO_CONUT.Clear();
- this.ultraTextMC_CHECKREASON.Clear();
- this.ultraCalendarMC_CHANGTIME.Text = "";
- this.ultraTextMC_CHECKCYCLE.Clear();
- this.ultraCalendarMC_CHECKTIME.Text = "";
- this.ultraTextMC_CHANGCYCLE.Clear();
- this.ultraTextAREA.Clear();
- }
- }
- }
- }
- //private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- //{
- // try
- // {
- // Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- // if (ugr.Cells["SELECT_ITEM"].Value.ToString() == "True")
- // {
- // string mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT;
- // this.ultraTextMCID2.Text = ugr.Cells["MC_ID"].Value.ToString();
- // mcid = ugr.Cells["MC_ID"].Value.ToString();
- // this.ultraTextMCID2.Enabled = false;
- // DataTable dt = new DataTable();
- // CoreClientParam ccp = new CoreClientParam();
- // ccp.ServerName = "UIK.UIK03.UIK030010";
- // ccp.MethodName = "DoSelect";
- // ccp.ServerParams = new object[] { mcid };
- // ccp.SourceDataTable = dt;
- // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- // foreach (DataRow dr in dt.Rows)
- // {
- // this.ultraTextMC_NAME.Text = dr["MC_NAME"].ToString();
- // this.ultraTextMC_MODEL.Text = dr["MC_MODEL"].ToString();
- // this.ultraTextMC_SPEC.Text = dr["MC_SPEC"].ToString();
- // this.ultraTextMC_FACTORY.Text = dr["MC_FACTORY"].ToString();
- // this.ultraCalendarMC_IN_DTIME.Text = dr["MC_IN_DTIME"].ToString();
- // this.ultraCalendarMC_USE_TIME.Text = dr["MC_USE_TIME"].ToString();
- // this.ultraCalendarREG_IN_DTIME.Text = dr["REG_IN_DTIME"].ToString();
- // this.ultraTextMC_PRICE.Text = dr["MC_PRICE"].ToString();
- // this.ultraTextMC_CARE_SECTOR.Text = dr["MC_CARE_SECTOR"].ToString();
- // this.ultraTextMC_NOM_CAP.Text = dr["MC_NOM_CAP"].ToString();
- // this.ultraTextMC_UNIT.Text = dr["MC_UNIT"].ToString();
- // this.ultraTextMC_ACT.Text = dr["MC_ACT"].ToString();
- // this.ultraTextMC_TAI.Text = dr["MC_TAI"].ToString();
- // this.ultraTextMC_MFACTUR_UNITS.Text = dr["MC_MFACTUR_UNITS"].ToString();
- // this.ultraTextMC_USE_YEAR.Text = dr["MC_USE_YEAR"].ToString();
- // this.ultraTextMC_INSTAL_LOCAL.Text = dr["MC_INSTAL_LOCAL"].ToString();
- // this.ultraTextREG_IN_ID.Text = dr["REG_IN_ID"].ToString();
- // this.ultraComboMC_STAT.Text = dr["MC_STAT"].ToString();
- // }
- // if (mcid != "")
- // {
- // MessageBox.Show("在编辑区修改单元格!");
- // }
- // //IMC_NAME = this.ultraTextMC_NAME.Text;
- // //IMC_MODEL = this.ultraTextMC_MODEL.Text;
- // //IMC_SPEC = this.ultraTextMC_SPEC.Text;
- // //IMC_FACTORY = this.ultraTextMC_FACTORY.Text;
- // //IMC_IN_DTIME = this.ultraCalendarMC_IN_DTIME.Text;
- // //IMC_USE_TIME = this.ultraCalendarMC_USE_TIME.Text;
- // //IREG_IN_DTIME = this.ultraCalendarREG_IN_DTIME.Text;
- // //IMC_PRICE = this.ultraTextMC_PRICE.Text;
- // //IMC_CARE_SECTOR = this.ultraTextMC_CARE_SECTOR.Text;
- // //IMC_NOM_CAP = this.ultraTextMC_NOM_CAP.Text;
- // //IMC_UNIT = this.ultraTextMC_UNIT.Text;
- // //IMC_ACT = this.ultraTextMC_ACT.Text;
- // //IMC_TAI = this.ultraTextMC_TAI.Text;
- // //IMC_MFACTUR_UNITS = this.ultraTextMC_MFACTUR_UNITS.Text;
- // //IMC_USE_YEAR = this.ultraTextMC_USE_YEAR.Text;
- // //IMC_INSTAL_LOCAL = this.ultraTextMC_INSTAL_LOCAL.Text;
- // //IREG_IN_ID = this.ultraTextREG_IN_ID.Text;
- // //IMC_STAT = this.ultraComboMC_STAT.Text;
- // //CoreClientParam ccp2 = new CoreClientParam();
- // //ccp2.ServerName = "UIK.UIK03.UIK030010";
- // //ccp2.MethodName = "DoUpdate";
- // //ccp2.ServerParams = new object[] { mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT };
- // //ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
- // //if (0 != ccp2.ReturnCode)
- // //{
- // // MessageBox.Show("修改失败!");
- // //}
- // //else
- // //{
- // // MessageBox.Show("修改成功!");
- // //}
- // }
- // else
- // {
- // MessageBox.Show("请选择修改行!");
- // }
- // }
- // catch (Exception Ex)
- // {
- // MessageBox.Show(Ex.ToString());
- // }
- //}
- }
- }
|