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 UIK010010 : FrmBase { public UIK010010() { 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 UIK010010_Load(object sender, EventArgs e) { this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; this.ultraTextREG_DTIME.Enabled = false; this.ultraTextREG_ID.Enabled = false; } private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e) { if (this.ultraCheckEditor1.Checked) { this.ultraCalendarENDTIME.Enabled = true; this.ultraCalendarSTRATTIME.Enabled = true; this.ultraCheckAll.Checked = false; } if (!this.ultraCheckEditor1.Checked) { this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; } } private void ultraCheckAll_CheckedChanged(object sender, EventArgs e) { try { if (this.ultraCheckAll.Checked) { this.ultraCheckEditor1.Checked = false; this.ultraCalendarSTRATTIME.Enabled = false; this.ultraCalendarENDTIME.Enabled = false; } } catch (Exception Ex) { MessageBox.Show(Ex.ToString()); } } private void DoQuery() { if (this.ultraCalendarENDTIME.Enabled == false && this.ultraCalendarSTRATTIME.Enabled == false) { this.ultraCalendarENDTIME.Text = ""; this.ultraCalendarSTRATTIME.Text = ""; } try { string starttiem = this.ultraCalendarSTRATTIME.Text.ToString(); string endtime = this.ultraCalendarENDTIME.Text.ToString(); bool flag = false; CoreClientParam ccp = new CoreClientParam(); //DataTable dt = new DataTable(); if (this.ultraCheckEditor1.Checked == false && this.ultraCheckAll.Checked == false) { MessageBox.Show("请选择查询条件!"); } else { if (this.ultraCheckAll.Checked) { this.dataSet1.Tables[0].Clear(); this.ultraCheckAll.Checked = false; ccp.ServerName = "UIK.UIK01.UIK010010"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { starttiem, endtime, flag }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = this.dataSet1.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("暂无乳化液记录!"); } this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } if (this.ultraCheckEditor1.Checked) { flag = true; this.dataSet1.Tables[0].Clear(); ccp.ServerName = "UIK.UIK01.UIK010010"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { starttiem, endtime, flag }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = this.dataSet1.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("暂无乳化液记录!"); } this.ultraCheckAll.Checked = false; this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } } } 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 ireg_datetime; ireg_datetime = e.Cell.Row.Cells["REG_DTIME"].Text; this.ultraTextREG_DTIME.Enabled = false; /*for循环控制单选*/ int i = this.ultraGrid1.Rows.Count; for (int j = 0; j < i; j++) { if (this.ultraGrid1.Rows[j].Cells["REG_DTIME"].Text != ireg_datetime) { this.ultraGrid1.Rows[j].Cells["SELECT_ITEM"].Value = false; } } DataTable dt = new DataTable(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIK.UIK01.UIK010010"; ccp.MethodName = "DoSelect"; ccp.ServerParams = new object[] { ireg_datetime }; ccp.SourceDataTable = dt; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); foreach (DataRow dr in dt.Rows) { this.ultraTextREG_DTIME.Text = dr["REG_DTIME"].ToString(); this.ultraTextDENSITY.Text = dr["DENSITY"].ToString(); this.ultraTextVISCOSITY.Text = dr["VISCOSITY"].ToString(); this.ultraTextFLASH_POINT.Text = dr["FLASH_POINT"].ToString(); this.ultraTextFREEZ_POINT.Text = dr["FREEZ_POINT"].ToString(); this.ultraTextSTABILITY.Text = dr["STABILITY"].ToString(); this.ultraTextCONCENT.Text = dr["CONCENT"].ToString(); this.ultraTextESI.Text = dr["ESI"].ToString(); this.ultraTextACID.Text = dr["ACID"].ToString(); this.ultraTextPH.Text = dr["PH"].ToString(); this.ultraTextCONDUCTIVITY.Text = dr["CONDUCTIVITY"].ToString(); this.ultraTextSAPONIFICATION_VALUE.Text = dr["SAPONIFICATION_VALUE"].ToString(); this.ultraTextFE_VALUE.Text = dr["FE_VALUE"].ToString(); this.ultraTextASH_VALUE.Text = dr["ASH_VALUE"].ToString(); this.ultraTextC_VALUE.Text = dr["C_VALUE"].ToString(); this.ultraTextCL_VALUE.Text = dr["CL_VALUE"].ToString(); this.ultraTextBACTERIA_FUNGI.Text = dr["BACTERIA_FUNGI"].ToString(); this.ultraTextTEMPERATURE.Text = dr["TEMPERATURE"].ToString(); this.ultraTextREG_ID.Text = dr["REG_ID"].ToString(); this.ultraTextMAG_OIL.Text = dr["MAG_OIL"].ToString(); this.ultraTextBER_CON.Text = dr["BER_CON"].ToString(); this.ultraCalendarSAM_DATE.Text = dr["SAM_DATE"].ToString(); this.ultraTextSAM_TIME.Text = dr["SAM_TIME"].ToString(); this.ultraComboSAM_ADDRESS.Text = dr["SAM_ADDRESS"].ToString(); this.ultraTextEditor1.Text = dr["CANYOU"].ToString(); this.ultraTextEditor2.Text = dr["CATIE"].ToString(); this.ultraTextEditor3.Text = dr["STL_GRD"].ToString(); this.ultraTextEditor8.Text = dr["TYPH"].ToString(); } } else { this.ultraTextREG_DTIME.Clear(); this.ultraTextDENSITY.Clear(); this.ultraTextVISCOSITY.Clear(); this.ultraTextFLASH_POINT.Clear(); this.ultraTextFREEZ_POINT.Clear(); this.ultraTextSTABILITY.Clear(); this.ultraTextCONCENT.Clear(); this.ultraTextESI.Clear(); this.ultraTextACID.Clear(); this.ultraTextPH.Clear(); this.ultraTextCONDUCTIVITY.Clear(); this.ultraTextSAPONIFICATION_VALUE.Clear(); this.ultraTextFE_VALUE.Clear(); this.ultraTextASH_VALUE.Clear(); this.ultraTextC_VALUE.Clear(); this.ultraTextCL_VALUE.Clear(); this.ultraTextBACTERIA_FUNGI.Clear(); this.ultraTextTEMPERATURE.Clear(); this.ultraTextREG_ID.Clear(); this.ultraTextMAG_OIL.Clear(); this.ultraTextBER_CON.Clear(); this.ultraTextSAM_TIME.Clear(); this.ultraComboSAM_ADDRESS.Clear(); this.ultraTextEditor1.Clear(); this.ultraTextEditor2.Clear(); this.ultraTextEditor3.Clear(); this.ultraTextEditor8.Clear(); } } } 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 IDENSITY, IVISCOSITY, IFLASH_POINT, IFREEZ_POINT, ISTABILITY, ICONCENT, IESI, IACID, IPH, ICONDUCTIVITY, ISAPONIFICATION_VALUE, IFE_VALUE, IASH_VALUE, IC_VALUE, ICL_VALUE, IBACTERIA_FUNGI, ITEMPERATURE, IREG_ID, IALTER_TIME, IREG_DTIME, IMAG_OIL, IBER_CON, ISAM_DATE, ISAM_TIME, ISAM_ADDRESS,CANYOU,CANTIE,GANGZ,TYPH; IREG_DTIME = this.ultraTextREG_DTIME.Text.Trim(); IDENSITY = this.ultraTextDENSITY.Text.Trim(); IVISCOSITY = this.ultraTextVISCOSITY.Text.Trim(); IFLASH_POINT = this.ultraTextFLASH_POINT.Text.Trim(); IFREEZ_POINT = this.ultraTextFREEZ_POINT.Text.Trim(); ISTABILITY = this.ultraTextSTABILITY.Text.Trim(); ICONCENT = this.ultraTextCONCENT.Text.Trim(); IESI = this.ultraTextESI.Text.Trim(); IACID = this.ultraTextACID.Text.Trim(); IPH = this.ultraTextPH.Text.Trim(); ICONDUCTIVITY = this.ultraTextCONDUCTIVITY.Text.Trim(); ISAPONIFICATION_VALUE = this.ultraTextSAPONIFICATION_VALUE.Text.Trim(); IFE_VALUE = this.ultraTextFE_VALUE.Text.Trim(); IASH_VALUE = this.ultraTextASH_VALUE.Text.Trim(); IC_VALUE = this.ultraTextC_VALUE.Text.Trim(); ICL_VALUE = this.ultraTextCL_VALUE.Text.Trim(); IBACTERIA_FUNGI = this.ultraTextBACTERIA_FUNGI.Text.Trim(); ITEMPERATURE = this.ultraTextTEMPERATURE.Text.Trim(); IREG_ID = this.ultraTextREG_ID.Text; IALTER_TIME = DateTime.Now.ToString(); IMAG_OIL = this.ultraTextMAG_OIL.Text.Trim(); IBER_CON = this.ultraTextBER_CON.Text.Trim(); ISAM_DATE = this.ultraCalendarSAM_DATE.Text.ToString().Trim(); ISAM_TIME = this.ultraTextSAM_TIME.Text.Trim(); ISAM_ADDRESS = this.ultraComboSAM_ADDRESS.Text.Trim(); CANYOU = this.ultraTextEditor1.Text.Trim(); CANTIE = this.ultraTextEditor2.Text.Trim(); GANGZ = this.ultraTextEditor3.Text.Trim(); TYPH = this.ultraTextEditor8.Text.Trim(); CoreClientParam ccp2 = new CoreClientParam(); ccp2.ServerName = "UIK.UIK01.UIK010010"; ccp2.MethodName = "DoUpdate"; ccp2.ServerParams = new object[] { IDENSITY, IVISCOSITY, IFLASH_POINT, IFREEZ_POINT, ISTABILITY, ICONCENT, IESI, IACID, IPH, ICONDUCTIVITY, ISAPONIFICATION_VALUE, IFE_VALUE, IASH_VALUE, IC_VALUE, ICL_VALUE, IBACTERIA_FUNGI, ITEMPERATURE, IREG_ID, IALTER_TIME, IREG_DTIME, IMAG_OIL, IBER_CON, ISAM_DATE, ISAM_TIME, ISAM_ADDRESS,CANYOU,CANTIE,GANGZ,TYPH }; ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal); if (0 != ccp2.ReturnCode) { MessageBox.Show("修改失败!"); } else { MessageBox.Show("修改成功!"); this.ultraTextREG_DTIME.Enabled = true; this.ultraTextREG_DTIME.Clear(); this.ultraTextDENSITY.Clear(); this.ultraTextVISCOSITY.Clear(); this.ultraTextFLASH_POINT.Clear(); this.ultraTextFREEZ_POINT.Clear(); this.ultraTextSTABILITY.Clear(); this.ultraTextCONCENT.Clear(); this.ultraTextESI.Clear(); this.ultraTextACID.Clear(); this.ultraTextPH.Clear(); this.ultraTextCONDUCTIVITY.Clear(); this.ultraTextSAPONIFICATION_VALUE.Clear(); this.ultraTextFE_VALUE.Clear(); this.ultraTextASH_VALUE.Clear(); this.ultraTextC_VALUE.Clear(); this.ultraTextCL_VALUE.Clear(); this.ultraTextBACTERIA_FUNGI.Clear(); this.ultraTextTEMPERATURE.Clear(); this.ultraTextREG_ID.Clear(); this.ultraTextMAG_OIL.Clear(); this.ultraTextBER_CON.Clear(); this.ultraTextSAM_TIME.Clear(); this.ultraComboSAM_ADDRESS.Clear(); this.ultraTextEditor1.Clear(); this.ultraTextEditor2.Clear(); this.ultraTextEditor3.Clear(); this.ultraTextEditor8.Clear(); } } else { MessageBox.Show("请选择修改行!"); } } catch (Exception Ex) { MessageBox.Show(Ex.ToString()); } } } private void DoInsert() { if (MessageBox.Show("您确认要添加信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { string IDENSITY, IVISCOSITY, IFLASH_POINT, IFREEZ_POINT, ISTABILITY, ICONCENT, IESI, IACID, IPH, ICONDUCTIVITY, ISAPONIFICATION_VALUE, IFE_VALUE, IASH_VALUE, IC_VALUE, ICL_VALUE, IBACTERIA_FUNGI, ITEMPERATURE, IREG_ID, ireg_datetime, IMAG_OIL, IBER_CON, ISAM_DATE, ISAM_TIME, ISAM_ADDRESS,CANYOU,CANTIE,GANGZ,TYPH; ireg_datetime = DateTime.Now.ToString(); IDENSITY = this.ultraTextDENSITY.Text.Trim(); IVISCOSITY = this.ultraTextVISCOSITY.Text.Trim(); IFLASH_POINT = this.ultraTextFLASH_POINT.Text.Trim(); IFREEZ_POINT = this.ultraTextFREEZ_POINT.Text.Trim(); ISTABILITY = this.ultraTextSTABILITY.Text.Trim(); ICONCENT = this.ultraTextCONCENT.Text.Trim(); IESI = this.ultraTextESI.Text.Trim(); IACID = this.ultraTextACID.Text.Trim(); IPH = this.ultraTextPH.Text.Trim(); ICONDUCTIVITY = this.ultraTextCONDUCTIVITY.Text.Trim(); ISAPONIFICATION_VALUE = this.ultraTextSAPONIFICATION_VALUE.Text.Trim(); IFE_VALUE = this.ultraTextFE_VALUE.Text.Trim(); IASH_VALUE = this.ultraTextASH_VALUE.Text.Trim(); IC_VALUE = this.ultraTextC_VALUE.Text.Trim(); ICL_VALUE = this.ultraTextCL_VALUE.Text.Trim(); IBACTERIA_FUNGI = this.ultraTextBACTERIA_FUNGI.Text.Trim(); ITEMPERATURE = this.ultraTextTEMPERATURE.Text.Trim(); IREG_ID = this.UserInfo.GetUserID(); IMAG_OIL = this.ultraTextMAG_OIL.Text.Trim(); IBER_CON = this.ultraTextBER_CON.Text.Trim(); ISAM_DATE = this.ultraCalendarSAM_DATE.Text.ToString(); ISAM_TIME = this.ultraTextSAM_TIME.Text.Trim(); ISAM_ADDRESS = this.ultraComboSAM_ADDRESS.Text.Trim(); CANYOU = this.ultraTextEditor1.Text.Trim(); CANTIE = this.ultraTextEditor2.Text.Trim(); GANGZ = this.ultraTextEditor3.Text.Trim(); TYPH = this.ultraTextEditor8.Text.Trim(); CoreClientParam ccp2 = new CoreClientParam(); ccp2.ServerName = "UIK.UIK01.UIK010010"; ccp2.MethodName = "DoInsert"; ccp2.ServerParams = new object[] { IDENSITY, IVISCOSITY, IFLASH_POINT, IFREEZ_POINT, ISTABILITY, ICONCENT, IESI, IACID, IPH, ICONDUCTIVITY, ISAPONIFICATION_VALUE, IFE_VALUE, IASH_VALUE, IC_VALUE, ICL_VALUE, IBACTERIA_FUNGI, ITEMPERATURE, IREG_ID, ireg_datetime, IMAG_OIL, IBER_CON, ISAM_DATE, ISAM_TIME, ISAM_ADDRESS,CANYOU,CANTIE,GANGZ,TYPH }; ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal); if (0 != ccp2.ReturnCode) { MessageBox.Show("添加失败!"); } else { MessageBox.Show("添加成功!"); this.ultraTextREG_DTIME.Enabled = true; this.ultraTextREG_DTIME.Clear(); this.ultraTextDENSITY.Clear(); this.ultraTextVISCOSITY.Clear(); this.ultraTextFLASH_POINT.Clear(); this.ultraTextFREEZ_POINT.Clear(); this.ultraTextSTABILITY.Clear(); this.ultraTextCONCENT.Clear(); this.ultraTextESI.Clear(); this.ultraTextACID.Clear(); this.ultraTextPH.Clear(); this.ultraTextCONDUCTIVITY.Clear(); this.ultraTextSAPONIFICATION_VALUE.Clear(); this.ultraTextFE_VALUE.Clear(); this.ultraTextASH_VALUE.Clear(); this.ultraTextC_VALUE.Clear(); this.ultraTextCL_VALUE.Clear(); this.ultraTextBACTERIA_FUNGI.Clear(); this.ultraTextTEMPERATURE.Clear(); this.ultraTextREG_ID.Clear(); this.ultraTextMAG_OIL.Clear(); this.ultraTextBER_CON.Clear(); this.ultraTextSAM_TIME.Clear(); this.ultraComboSAM_ADDRESS.Clear(); this.ultraTextEditor1.Clear(); this.ultraTextEditor2.Clear(); this.ultraTextEditor3.Clear(); this.ultraTextEditor8.Clear(); } } } } }