private void gcApplyDelQuery_MouseDoubleClick(object sender, MouseEventArgs e) { ColumnView cv = (ColumnView)gcApplyDelQuery.FocusedView; FuelDataModel.VehicleBasicInfo vbi = (FuelDataModel.VehicleBasicInfo)cv.GetFocusedRow(); if (vbi == null) { return; } // 弹出详细信息窗口 JbxxViewForm jvf = new JbxxViewForm(); setControlValue(jvf, "tbvin", vbi.App_Vin, false); setControlValue(jvf, "tbQcscqy", vbi.Qcscqy, false); setControlValue(jvf, "tbJkqczjxs", vbi.Jkqczjxs, false); setControlValue(jvf, "tbClxh", vbi.Clxh, false); setControlValue(jvf, "tbClzl", vbi.Clzl, false); setControlValue(jvf, "tbRllx", vbi.Rllx, false); setControlValue(jvf, "tbZczbzl", vbi.Zczbzl.ToString(), false); setControlValue(jvf, "tbZgcs", vbi.Zgcs.ToString(), false); setControlValue(jvf, "tbLtgg", vbi.Ltgg, false); setControlValue(jvf, "tbZj", vbi.Zj.ToString(), false); setControlValue(jvf, "tbClzzrq", vbi.Clzzrq.ToString(), false); setControlValue(jvf, "tbTymc", vbi.Tymc, false); setControlValue(jvf, "tbYyc", vbi.Yyc, false); setControlValue(jvf, "tbZwps", vbi.Zwps.ToString(), false); setControlValue(jvf, "tbZdsjzzl", vbi.Zdsjzzl.ToString(), false); setControlValue(jvf, "tbEdzk", vbi.Edzk.ToString(), false); setControlValue(jvf, "tbLj", vbi.Lj.ToString(), false); setControlValue(jvf, "tbQdxs", vbi.Qdxs, false); setControlValue(jvf, "tbJyjgmc", vbi.Jyjgmc, false); setControlValue(jvf, "tbJybgbh", vbi.Jybgbh, false); // 获取燃料信息 FuelDataModel.RllxParamEntity[] rpelist = this.rpeht[vbi.App_Vin]; for (int i = 0; rpelist != null && i < rpelist.Length; i++) { FuelDataModel.RllxParamEntity rpe = rpelist[i]; setControlValue(jvf, rpe.Param_Code, rpe.Param_Value, false); } (jvf.Controls.Find("tc", true)[0] as XtraTabControl).SelectedTabPageIndex = 0; jvf.MaximizeBox = false; jvf.MinimizeBox = false; Utils.SetFormMid(jvf); jvf.setVisible("btnbaocun", false); jvf.setVisible("btnbaocunshangbao", false); jvf.setVisible("btnPrint", false); jvf.ShowDialog(); }
// 查看详细 private void ViewDetail(bool flag) { ColumnView cv = (ColumnView)dgvCljbxx.FocusedView; DataRowView dr = (DataRowView)cv.GetFocusedRow(); if (dr == null) { return; } string vin = (string)dr.Row.ItemArray[0]; // 获取此VIN的详细信息,带入窗口 string sql = @"select * from FC_CLJBXX where vin = @vin"; OleDbParameter[] param = { new OleDbParameter("@vin", vin) }; DataSet ds = AccessHelper.ExecuteDataSet(AccessHelper.conn, sql, param); DataTable dtBasic = ds.Tables[0]; // 获取燃料信息 string rlsql = @"select e.* from RLLX_PARAM_ENTITY e, RLLX_PARAM RPE where e.vin = @vin and e.PARAM_CODE=RPE.PARAM_CODE and RPE.STATUS='1'"; ds = AccessHelper.ExecuteDataSet(AccessHelper.conn, rlsql, param); DataTable dtParam = ds.Tables[0]; // 弹出详细信息窗口,可修改 JbxxViewForm jvf = new JbxxViewForm(dtBasic, dtParam, true, flag); if (flag) { jvf.status = "1"; } else { jvf.status = "2"; } if (dtBasic.Rows.Count > 0) { for (int i = 0; i < dtBasic.Columns.Count; i++) { DataColumn dc = dtBasic.Columns[i]; Control[] c = jvf.Controls.Find("tb" + dc.ColumnName, true); if (c.Length > 0) { if (c[0] is TextEdit) { c[0].Text = dtBasic.Rows[0].ItemArray[i].ToString(); continue; } if (c[0] is DevExpress.XtraEditors.ComboBoxEdit) { DevExpress.XtraEditors.ComboBoxEdit cb = c[0] as DevExpress.XtraEditors.ComboBoxEdit; cb.Text = dtBasic.Rows[0].ItemArray[i].ToString(); if (cb.Text == "汽油" || cb.Text == "柴油" || cb.Text == "两用燃料" || cb.Text == "双燃料" || cb.Text == "气体燃料" || cb.Text == "纯电动" || cb.Text == "非插电式混合动力" || cb.Text == "插电式混合动力" || cb.Text == "燃料电池") { string rlval = cb.Text; if (cb.Text == "汽油" || cb.Text == "柴油" || cb.Text == "两用燃料" || cb.Text == "双燃料" || cb.Text == "气体燃料") { rlval = "传统能源"; } // 构建燃料参数控件 jvf.getParamList(rlval, true); } } } } } for (int i = 0; i < dtParam.Rows.Count; i++) { DataRow drrlxx = dtParam.Rows[i]; string cName = drrlxx.ItemArray[1].ToString(); Control[] c = jvf.Controls.Find(cName, true); if (c.Length > 0) { if (c[0] is TextEdit) { c[0].Text = drrlxx.ItemArray[3].ToString(); continue; } if (c[0] is DevExpress.XtraEditors.ComboBoxEdit) { DevExpress.XtraEditors.ComboBoxEdit cb = c[0] as DevExpress.XtraEditors.ComboBoxEdit; cb.Text = drrlxx.ItemArray[3].ToString(); } } } (jvf.Controls.Find("tc", true)[0] as XtraTabControl).SelectedTabPageIndex = 0; jvf.MaximizeBox = false; jvf.MinimizeBox = false; Utils.SetFormMid(jvf); jvf.setVisible("btnbaocun", true); jvf.setVisible("btnbaocunshangbao", false); jvf.setVisible("btnCancel", true); jvf.setVisible("btnPrint", true); jvf.formClosingEventHandel += new FormClosingEventHandler(refrashBySubForm); jvf.ShowDialog(); }