//数据分类 private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e) { try { var vins = GetCheckData(); if (vins != null && vins.Table.Rows.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (this.xtraTabControl1.SelectedTabPage.Text == "补传数据") //需要补传数据 { if (InsertFC_CLJBXX(vins, "1", GetRadio())) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalOTForm") { f.Activate(); ((SearchLocalOTForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalOTForm)f).Ribbon.Pages[0]; return; } } SearchLocalOTForm slo = new SearchLocalOTForm() { MdiParent = this.MdiParent }; slo.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = slo.Ribbon.Pages[0]; slo.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (this.xtraTabControl1.SelectedTabPage.Text == "撤销数据") //需要撤销数据 { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUploadedForm") { f.Activate(); ((SearchLocalUploadedForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUploadedForm)f).Ribbon.Pages[0]; return; } } SearchLocalUploadedForm sluf = new SearchLocalUploadedForm() { MdiParent = this.MdiParent }; sluf.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = sluf.Ribbon.Pages[0]; sluf.Show(); } if (this.xtraTabControl1.SelectedTabPage.Text == "修改数据") //需要修改数据 { var str = GetCheckString(); var dt = (DataTable)gcDataQY.DataSource; DataTable dtNew = dt.Clone(); foreach (string s in str) { var dr = dt.Select(String.Format("VIN车架号='{0}'", s)); if (dr.Length > 0) { foreach (DataRow r in dr) { dtNew.Rows.Add(r.ItemArray); } continue; } } switch (radioGroup1.SelectedIndex) { case 0: dtNew = compareUtils.C2E(compareUtils.dictCTNY, dtNew, ToyotaCompareUtils.CTNY); break; case 1: dtNew = compareUtils.C2E(compareUtils.dictFCDSHHDL, dtNew, ToyotaCompareUtils.FCDSHHDL); break; } if (InsertFC_CLJBXX(dtNew.DefaultView, "2", GetRadio())) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUpdateForm") { f.Activate(); ((SearchLocalUpdateForm)f).LocalData(dtNew.DefaultView); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUpdateForm)f).Ribbon.Pages[0]; return; } } SearchLocalUpdateForm suf = new SearchLocalUpdateForm() { MdiParent = this.MdiParent }; suf.LocalData(dtNew.DefaultView); ((MainForm)this.MdiParent).Ribbon.SelectedPage = suf.Ribbon.Pages[0]; suf.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { throw ex; } }
//数据处理 private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e) { try { SplashScreenManager.ShowForm(typeof(DevWaitForm)); if (this.xtraTabControl1.SelectedTabPage.Text.Equals("比对数据")) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //获取选中的处理数据 var gridControl = (GridControl)this.xtraTabControl1.SelectedTabPage.Controls[0]; var view = gridControl.MainView; view.PostEditor(); DataView dv = C2M.SelectedParamEntityDataView((DataView)view.DataSource, "check"); if (dv == null) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else if (dv != null && dv.Table.Rows.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (this.xtraTabControl1.SelectedTabPage.Text == "补传数据") { //将选中的处理数据更改状态 foreach (DataRow dr in dv.Table.Rows) { OracleHelper.ExecuteNonQuery(OracleHelper.conn, string.Format("UPDATE FC_CLJBXX SET STATUS = '1' where vin='{0}'", dr["VIN"]), null); } //打开补传待上报窗体显示处理后数据 foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalOTForm") { f.Activate(); ((SearchLocalOTForm)f).LocalData(dv); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalOTForm)f).Ribbon.Pages[0]; return; } } SearchLocalOTForm slo = new SearchLocalOTForm() { MdiParent = this.MdiParent }; slo.LocalData(dv); ((MainForm)this.MdiParent).Ribbon.SelectedPage = slo.Ribbon.Pages[0]; slo.Show(); } if (this.xtraTabControl1.SelectedTabPage.Text == "撤销数据") { //将选中的处理数据更改状态 foreach (DataRow dr in dv.Table.Rows) { OracleHelper.ExecuteNonQuery(OracleHelper.conn, String.Format("DELETE FROM FC_CLJBXX WHERE VIN = '{0}'", dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, String.Format("DELETE FROM RLLX_PARAM_ENTITY WHERE VIN ='{0}'", dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, String.Format("INSERT INTO FC_CLJBXX (VIN,HGSPBM,USER_ID,QCSCQY,JKQCZJXS,CLXH,CLZL,RLLX,ZCZBZL,ZGCS,LTGG,ZJ,CLZZRQ,UPLOADDEADLINE,TYMC,YYC,ZWPS,ZDSJZZL,EDZK,LJ,QDXS,CREATETIME,UPDATETIME,STATUS,JYJGMC,JYBGBH,QTXX,V_ID) SELECT VIN,HGSPBM,USER_ID,QCSCQY,JKQCZJXS,CLXH,CLZL,RLLX,ZCZBZL,ZGCS,LTGG,ZJ,CLZZRQ,UPLOADDEADLINE,TYMC,YYC,ZWPS,ZDSJZZL,EDZK,LJ,QDXS,CREATETIME,UPDATETIME,STATUS,JYJGMC,JYBGBH,QTXX,V_ID FROM FC_CLJBXX_ADC WHERE VIN='{0}'", dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, string.Format("UPDATE FC_CLJBXX SET STATUS='3',USER_ID='{0}' WHERE VIN='{1}'", Utils.localUserId, dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, string.Format("INSERT INTO RLLX_PARAM_ENTITY (PARAM_CODE,VIN,PARAM_VALUE,V_ID) SELECT PARAM_CODE,VIN,PARAM_VALUE,V_ID FROM RLLX_PARAM_ENTITY_ADC WHERE VIN='{0}'", dr["VIN"]), null); } //打开已上报窗体显示需要撤销的数据 foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUploadedForm") { f.Activate(); ((SearchLocalUploadedForm)f).LocalData(dv); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUploadedForm)f).Ribbon.Pages[0]; return; } } SearchLocalUploadedForm sluf = new SearchLocalUploadedForm() { MdiParent = this.MdiParent }; sluf.LocalData(dv); ((MainForm)this.MdiParent).Ribbon.SelectedPage = sluf.Ribbon.Pages[0]; sluf.Show(); } if (this.xtraTabControl1.SelectedTabPage.Text == "修改数据") { //将选中的处理数据更改状态 foreach (DataRow dr in dv.Table.Rows) { OracleHelper.ExecuteNonQuery(OracleHelper.conn, string.Format("UPDATE FC_CLJBXX SET STATUS = '2' where vin='{0}'", dr["VIN"]), null); } //打开已修改未上报窗体显示处理后数据 foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUpdateForm") { f.Activate(); ((SearchLocalUpdateForm)f).LocalData(dv); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUpdateForm)f).Ribbon.Pages[0]; return; } } SearchLocalUpdateForm suf = new SearchLocalUpdateForm() { MdiParent = this.MdiParent }; suf.LocalData(dv); ((MainForm)this.MdiParent).Ribbon.SelectedPage = suf.Ribbon.Pages[0]; suf.Show(); } } catch (Exception ex) { MessageBox.Show("处理出现错误:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { SplashScreenManager.CloseForm(); } }
//数据处理 private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e) { try { if (this.xtraTabControl1.SelectedTabPage.Text == "补传数据") //需要补传数据 { var vins = GetDataFormat(); if (vins != null && vins.Table.Rows.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var rllxName = GetRadio(); if (InsertFC_CLJBXX(vins, "1", rllxName)) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalOTForm") { f.Activate(); ((SearchLocalOTForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalOTForm)f).Ribbon.Pages[0]; return; } } SearchLocalOTForm slo = new SearchLocalOTForm() { MdiParent = MdiParent }; slo.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = slo.Ribbon.Pages[0]; slo.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (this.xtraTabControl1.SelectedTabPage.Text == "撤销数据") //需要撤销数据 { var vins = GetDataFormat(); if (vins != null && vins.Table.Rows.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //将选中的处理数据更改状态 foreach (DataRow dr in vins.Table.Rows) { OracleHelper.ExecuteNonQuery(OracleHelper.conn, String.Format("DELETE FROM FC_CLJBXX WHERE VIN = '{0}'", dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, String.Format("DELETE FROM RLLX_PARAM_ENTITY WHERE VIN ='{0}'", dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, string.Format("INSERT INTO FC_CLJBXX (VIN,HGSPBM,USER_ID,QCSCQY,JKQCZJXS,CLXH,CLZL,RLLX,ZCZBZL,ZGCS,LTGG,ZJ,CLZZRQ,UPLOADDEADLINE,TYMC,YYC,ZWPS,ZDSJZZL,EDZK,LJ,QDXS,CREATETIME,UPDATETIME,STATUS,JYJGMC,JYBGBH,QTXX,V_ID) SELECT VIN,HGSPBM,USER_ID,QCSCQY,JKQCZJXS,CLXH,CLZL,RLLX,ZCZBZL,ZGCS,LTGG,ZJ,CLZZRQ,UPLOADDEADLINE,TYMC,YYC,ZWPS,ZDSJZZL,EDZK,LJ,QDXS,CREATETIME,UPDATETIME,STATUS,JYJGMC,JYBGBH,QTXX,V_ID FROM FC_CLJBXX_ADC WHERE VIN='{0}'", dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, string.Format("UPDATE FC_CLJBXX SET STATUS='3',USER_ID='{0}' WHERE VIN='{1}'", Utils.localUserId, dr["VIN"]), null); OracleHelper.ExecuteNonQuery(OracleHelper.conn, string.Format("INSERT INTO RLLX_PARAM_ENTITY (PARAM_CODE,VIN,PARAM_VALUE,V_ID) SELECT PARAM_CODE,VIN,PARAM_VALUE,V_ID FROM RLLX_PARAM_ENTITY_ADC WHERE VIN='{0}'", dr["VIN"]), null); } foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUploadedForm") { f.Activate(); ((SearchLocalUploadedForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUploadedForm)f).Ribbon.Pages[0]; return; } } SearchLocalUploadedForm sluf = new SearchLocalUploadedForm() { MdiParent = this.MdiParent }; sluf.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = sluf.Ribbon.Pages[0]; sluf.Show(); } if (this.xtraTabControl1.SelectedTabPage.Text == "修改数据") //需要修改数据 { var str = GetCheckString(); if (str == null || str.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DataView vins = GetCheckData(); var dt = (DataTable)gridControl2.DataSource; DataTable dtNew = dt.Clone(); foreach (string s in str) { var dr = dt.Select(String.Format("vin='{0}'", s)); if (dr.Length > 0) { foreach (DataRow r in dr) { dtNew.Rows.Add(r.ItemArray); } continue; } } switch (radioGroup1.SelectedIndex) { case 0: dtNew = miutils.D2D(miutils.dictCTNY, dtNew, MitsUtils.CTNY); break; case 1: dtNew = miutils.D2D(miutils.dictFCDSHHDL, dtNew, MitsUtils.FCDSHHDL); break; case 2: dtNew = miutils.D2D(miutils.dictCDSHHDL, dtNew, MitsUtils.CDSHHDL); break; case 3: dtNew = miutils.D2D(miutils.dictCDD, dtNew, MitsUtils.CDD); break; case 4: dtNew = miutils.D2D(miutils.dictRLDC, dtNew, MitsUtils.RLDC); break; } var rllxName = GetRadio(); if (InsertFC_CLJBXX(dtNew.DefaultView, "2", rllxName)) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUpdateForm") { f.Activate(); ((SearchLocalUpdateForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUpdateForm)f).Ribbon.Pages[0]; return; } } SearchLocalUpdateForm suf = new SearchLocalUpdateForm() { MdiParent = this.MdiParent }; suf.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = suf.Ribbon.Pages[0]; suf.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { throw ex; } }
//数据分类 private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e) { try { if (this.xtraTabControl1.SelectedTabPage.Text == "补传数据") //需要补传数据 { var vins = GetCheckData(); if (vins != null && vins.Table.Rows.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var rllxName = GetRadio(); if (InsertFC_CLJBXX(vins, "1", rllxName)) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalOTForm") { f.Activate(); ((SearchLocalOTForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalOTForm)f).Ribbon.Pages[0]; return; } } SearchLocalOTForm slo = new SearchLocalOTForm(); slo.MdiParent = this.MdiParent; slo.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = slo.Ribbon.Pages[0]; slo.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (this.xtraTabControl1.SelectedTabPage.Text == "撤销数据") //需要撤销数据 { var vins = GetCheckData(); if (vins != null && vins.Table.Rows.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUploadedForm") { f.Activate(); ((SearchLocalUploadedForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUploadedForm)f).Ribbon.Pages[0]; return; } } SearchLocalUploadedForm sluf = new SearchLocalUploadedForm(); sluf.MdiParent = this.MdiParent; sluf.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = sluf.Ribbon.Pages[0]; sluf.Show(); } if (this.xtraTabControl1.SelectedTabPage.Text == "修改数据") //需要修改数据 { var str = GetCheckString(); if (str == null || str.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DataView vins = GetCheckData(); var dt = (DataTable)gcDataQY.DataSource; DataTable dtNew = dt.Clone(); foreach (string s in str) { var dr = dt.Select(String.Format("vin='{0}'", s)); if (dr.Length > 0) { foreach (DataRow r in dr) { dtNew.Rows.Add(r.ItemArray); } } } var rllxName = GetRadio(); if (InsertFC_CLJBXX(dtNew.DefaultView, "2", rllxName)) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUpdateForm") { f.Activate(); ((SearchLocalUpdateForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUpdateForm)f).Ribbon.Pages[0]; return; } } SearchLocalUpdateForm suf = new SearchLocalUpdateForm(); suf.MdiParent = this.MdiParent; suf.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = suf.Ribbon.Pages[0]; suf.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { throw ex; } }
//数据处理 private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e) { try { var vins = GetCheckData(); if (vins != null && vins.Table.Rows.Count == 0) { MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (this.xtraTabControl1.SelectedTabPage.Text == "补传数据") //需要补传数据 { if (InsertFC_CLJBXX(vins)) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalOTForm") { f.Activate(); ((SearchLocalOTForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalOTForm)f).Ribbon.Pages[0]; return; } } SearchLocalOTForm slo = new SearchLocalOTForm() { MdiParent = this.MdiParent }; slo.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = slo.Ribbon.Pages[0]; slo.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (this.xtraTabControl1.SelectedTabPage.Text == "撤销数据") //需要撤销数据 { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUploadedForm") { f.Activate(); ((SearchLocalUploadedForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUploadedForm)f).Ribbon.Pages[0]; return; } } SearchLocalUploadedForm sluf = new SearchLocalUploadedForm() { MdiParent = this.MdiParent }; sluf.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = sluf.Ribbon.Pages[0]; sluf.Show(); } if (this.xtraTabControl1.SelectedTabPage.Text == "车辆型号不一致") //需要修改数据 { if (UpdateFC_CLJBXX(vins)) { foreach (Form f in Application.OpenForms) { if (f.Name == "SearchLocalUpdateForm") { f.Activate(); ((SearchLocalUpdateForm)f).LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = ((SearchLocalUpdateForm)f).Ribbon.Pages[0]; return; } } SearchLocalUpdateForm suf = new SearchLocalUpdateForm() { MdiParent = this.MdiParent }; suf.LocalData(vins); ((MainForm)this.MdiParent).Ribbon.SelectedPage = suf.Ribbon.Pages[0]; suf.Show(); } else { MessageBox.Show("操作失败,请检查数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { throw ex; } }