| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- 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;
- namespace Core.LZMes.Client.UIK
- {
- public partial class UIK040030 : FrmBase
- {
- public UIK040030()
- {
- InitializeComponent();
- }
- #region "ToolBar Event"
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.Save();
- this.DoQuery();
- break;
- case "Delete":
- this.doDelete();
- this.DoQuery();
- break;
- case "Export":
- this.DoExport();
- break;
- }
- }
- string strDtime = null;
- private void DoQuery()
- {
- try
- {
- //if (this.checkBox1.Checked)
- //{
- strDtime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
- //}
- //else
- //{
- // //strDtime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMM");//默认为当月
- // strDtime = "";
- //}
- this.dataSet1.Tables[0].Clear();
- ArrayList al = new ArrayList();
- al.Add("UIK040030_01.SELECT");
- al.Add(strDtime);
- al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
-
- //al.Add(this.textArea.Text.ToString().Trim());
- //al.Add(this.textMainMc.Text.ToString().Trim());
- //al.Add(this.ComboGZYY.Text.ToString());
- //al.Add(strDtime);
- //al.Add(this.textBox1.Text.ToString());
- //al.Add(this.textBox1.Text.ToString());
- //al.Add(this.textBox1.Text.ToString());
- //al.Add(this.textBox1.Text.ToString());
- //al.Add(this.textBox1.Text.ToString());
- //al.Add(this.textBox1.Text.ToString());
- //if (this.ComboZRBM.Text.ToString()== "机械")
- //{
- // al.Add("True");
- //}
- //else
- //{
- // al.Add("");
- //}
- // if(this.ComboZRBM.Text.ToString() == "液压")
- //{
- // al.Add("True");
- //}
- // else
- // {
- // al.Add("");
- //}
- // if(this.ComboZRBM.Text.ToString() == "电气")
- // {
- // al.Add("True");
- // }
- // else
- // {
- // al.Add("");
- //}
- // if(this.ComboZRBM.Text.ToString() == "自动化")
- // {
- // al.Add("True");
- // }
- // else
- // {
- // al.Add("");
- //}
- // if(this.ComboZRBM.Text.ToString() == "操作")
- // {
- // al.Add("True");
- // }
- // else
- // {
- // al.Add("");
- //}
- // if (this.ComboZRBM.Text.ToString() == "外因")
- // {
- // al.Add("True");
- // }
- // else
- // {
- // al.Add("");
- //}
-
- // al.Add(this.comboBox1.SelectedValue.ToString());
- 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);
-
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- public void Save()
- {
- try
- {
- ArrayList list = null;
- int i = 0;
- string GZ_TIME_FR_Time = null;
- string GZ_TIME_TO_Time = null;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToString() == "True")
- {
- if (ugr.Cells["SEQ_NO"].Text == "")//insert
- {
- i++;
- list = new ArrayList();
- //list.Add("UIK040030_01.INSERT");
- //list.Add(ugr.Cells["AREA"].Text.ToString());
- //list.Add(ugr.Cells["MC_ID"].Text.ToString());
- //list.Add(ugr.Cells["MC_NAME"].Text.ToString());
-
- //GZ_TIME_FR_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_FR"].Text.ToString()).ToString("yyyyMMdd");// string.Format("{0:yyyyMMdd}" , );
- //list.Add(GZ_TIME_FR_Time);
- //list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
- //GZ_TIME_TO_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_TO"].Text.ToString()).ToString("yyyyMMdd");//this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd");//string.Format("{0:yyyyMMdd}", );
- //list.Add(GZ_TIME_TO_Time);
- // list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
- // list.Add(ugr.Cells["GZ_LRR"].Text.ToString());
- //list.Add(this.UserInfo.GetUserName().ToString());//录入人
- //list.Add(ugr.Cells["GZ_LR_SJ"].Text.ToString());
- //list.Add(ugr.Cells["GZ_YY"].Text.ToString());
- //list.Add(ugr.Cells["GZ_BM_JX"].Text.ToString());
- //list.Add(ugr.Cells["GZ_BM_YY"].Text.ToString());
- //list.Add(ugr.Cells["GZ_BM_DQ"].Text.ToString());
- //list.Add(ugr.Cells["GZ_BM_ZDH"].Text.ToString());
- //list.Add(ugr.Cells["GZ_BM_CZ"].Text.ToString());
- //list.Add(ugr.Cells["GZ_BM_WY"].Text.ToString());
- //list.Add(ugr.Cells["JX_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["YY_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["DQ_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["ZDH_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["CZ_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["WY_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["BZ"].Text.ToString());
- //list.Add(Convert.ToString(i));
- //list.Add(ugr.Cells["GZ_BM_ESY"].Text.ToString());
- //list.Add(ugr.Cells["GZ_BM_BY"].Text.ToString());
- //list.Add(ugr.Cells["ESY_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["BY_ZRR"].Text.ToString());
- //list.Add(ugr.Cells["seq_no"].Text.ToString());
- list.Add("UIK040030_01.INSERT");
- list.Add(Convert.ToString(i));
- list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
- list.Add(ugr.Cells["BC"].Text.ToString());
- list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
- list.Add(ugr.Cells["YCSJ"].Text.ToString());
- list.Add(ugr.Cells["BZ"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ1"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ2"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ3"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ4"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ5"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ6"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ7"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ8"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ9"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_YY1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_YY2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX3"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX4"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX5"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX6"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_CD1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_CD2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_CD3"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH3"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH4"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH5"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ESY1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ESY2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_EJ1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_CJ1"].Text.ToString());
- list.Add(this.UserInfo.GetUserName().ToString());//录入人
- //list.Add(ugr.Cells["GZ_LR_SJ"].Text.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBSave";
- ccp.ServerParams = new object[] { list };
- ccp.MethodName = "doXmlSave";
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- else//update
- {
- list = new ArrayList();
- list.Add("UIK040030_01.UPDATE");
- //list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
- //GZ_TIME_FR_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_FR"].Text.ToString()).ToString("yyyyMMdd");
- list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
- list.Add(ugr.Cells["BC"].Text.ToString());
- list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
-
- list.Add(ugr.Cells["YCSJ"].Text.ToString());
- //GZ_TIME_TO_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_TO"].Text.ToString()).ToString("yyyyMMdd");//this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd");//string.Format("{0:yyyyMMdd}", );
- //list.Add(GZ_TIME_TO_Time);
- list.Add(ugr.Cells["BZ"].Text.ToString());
- //list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
- //list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
- //list.Add(ugr.Cells["GZ_LRR"].Text.ToString());
- //list.Add(ugr.Cells["GZ_LR_SJ"].Text.ToString());
-
- list.Add(ugr.Cells["GZYY_CJ1"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ2"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ3"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ4"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ5"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ6"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ7"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ8"].Text.ToString());
- list.Add(ugr.Cells["GZYY_CJ9"].Text.ToString());
-
- list.Add(ugr.Cells["GZ_BM_YY1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_YY2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX3"].Text.ToString());
-
- list.Add(ugr.Cells["GZ_BM_JX4"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX5"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_JX6"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_CD1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_CD2"].Text.ToString());
-
- list.Add(ugr.Cells["GZ_BM_CD3"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH3"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ZDH4"].Text.ToString());
-
- list.Add(ugr.Cells["GZ_BM_ZDH5"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ESY1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_ESY2"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_EJ1"].Text.ToString());
- list.Add(ugr.Cells["GZ_BM_CJ1"].Text.ToString());
- list.Add(this.UserInfo.GetUserName().ToString());//录入人
- list.Add(ugr.Cells["SEQ_NO"].Text.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBSave";
- ccp.ServerParams = new object[] { list };
- ccp.MethodName = "doXmlSave";
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- }
- }
- }
- catch (Exception ex)
- {
- }
- }
- public void doDelete()
- {
- try
- {
- if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
- ArrayList list = null;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToString() == "True")
- {
- list = new ArrayList();
- list.Add("UIK040030_01.DELETE");
- list.Add(ugr.Cells["SEQ_NO"].Text.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBSave";
- ccp.ServerParams = new object[] { list };
- ccp.MethodName = "doXmlSave";
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- }
- }
- catch (Exception ex)
- {
- }
- }
- 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());
- }
- }
- #endregion
- #region "Init"
- public void init()
- {
- string commCodeCd = "K04003,K04004";
- DataTable dt = new DataTable();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ArrayList paramArray = new ArrayList();
- paramArray.Add("UIECOMM00_SELECT.COMM_CODE");
- paramArray.Add(commCodeCd);
- ccp.ServerParams = new object[] { paramArray };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboGZYY, ref dt, "K04003");
- //Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboZRBM, ref dt, "K04004");
- }
- private void UIK040030_Load(object sender, EventArgs e)
- {
- init();
- //this.checkBox1.Checked = false;
- //this.ultraDateTimeEditor1.Enabled = false;
- }
- #endregion
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- try
- {
- //if (this.checkBox1.Checked)
- //{
- // this.ultraDateTimeEditor1.Enabled = true;
- //}
- //else
- //{
- // this.ultraDateTimeEditor1.Enabled = false;
- //}
- }
- catch (Exception ex)
- {
- }
- }
-
- }
- }
|