//批量VIN查询 private void barBtnVINSelect_ItemClick(object sender, ItemClickEventArgs e) { try { //记录操作日志 LogUtils.ReviewLogManager.ReviewLog(Properties.Settings.Default.LocalUserName, String.Format("{0}-{1}", this.Text, this.barBtnVINSelect.Caption)); string msg = string.Empty; if (openFileDialog1.ShowDialog() == DialogResult.OK) { var utils = new ApproveThirdUtils(); DataTable dt = utils.VINSelect(openFileDialog1.FileName, this.xtraTabControl1.SelectedTabPage.Text); if (dt == null || dt.Rows.Count < 1) { if (this.xtraTabControl1.SelectedTabPage.Text.Equals("待审批")) { this.gcDataInfo.DataSource = dt; //this.gvDataInfo.BestFitColumns(); } else if (this.xtraTabControl1.SelectedTabPage.Text.Equals("驳回")) { this.gcBackInfo.DataSource = dt; //this.gvBackInfo.BestFitColumns(); } else { this.gcPassInfo.DataSource = dt; //this.gvPassInfo.BestFitColumns(); } MessageBox.Show("批量查询失败:未查到数据", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } dt.Columns.Add("check", System.Type.GetType("System.Boolean")); dt.Columns["check"].ReadOnly = false; if (this.xtraTabControl1.SelectedTabPage.Text.Equals("待审批")) { this.gcDataInfo.DataSource = dt; //this.gvDataInfo.BestFitColumns(); } else if (this.xtraTabControl1.SelectedTabPage.Text.Equals("驳回")) { this.gcBackInfo.DataSource = dt; //this.gvBackInfo.BestFitColumns(); } else { this.gcPassInfo.DataSource = dt; //this.gvPassInfo.BestFitColumns(); } int dataCount = dt.Rows.Count; //默认全选 this.ceQueryAll.CheckState = CheckState.Checked; this.lblSum.Text = String.Format("共{0}条", dataCount); this.labPage.Text = String.Format("当前显示{0}至{1}条", 1, dataCount); this.txtPage.Text = String.Format("{0}/{1}", 1, 1); } } catch (System.Exception ex) { MessageBox.Show("批量查询失败:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//数据恢复 private void barBtnRecover_ItemClick(object sender, ItemClickEventArgs e) { //记录操作日志 LogUtils.ReviewLogManager.ReviewLog(Properties.Settings.Default.LocalUserName, String.Format("{0}-{1}", this.Text, this.barBtnRecover.Caption)); DataTable selDataTable = new DataTable(); if (this.xtraTabControl1.SelectedTabPage.Text.Equals("待审批")) { selDataTable = GridControlHelper.SelectedItems(this.gvDataInfo); } else if (this.xtraTabControl1.SelectedTabPage.Text.Equals("驳回")) { selDataTable = GridControlHelper.SelectedItems(this.gvBackInfo); } else { selDataTable = GridControlHelper.SelectedItems(this.gvPassInfo); } string msg = string.Empty; if (selDataTable == null || selDataTable.Rows.Count < 1) { XtraMessageBox.Show("请选择您要操作的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (XtraMessageBox.Show("确定要恢复吗?", "恢复确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.OK) { return; } try { SplashScreenManager.ShowForm(typeof(DevWaitForm)); //二审通过 恢复到 一审通过状态 if (this.xtraTabControl1.SelectedTabPage.Text.Equals("待审批")) { var utilsFirst = new ApproveFirstUtils(); msg += utilsFirst.recoverDataInfo(selDataTable); var utilsSecond = new ApproveSecondUtils(); msg += utilsSecond.recoverDataInfo(selDataTable); } //三审驳回/通过 恢复到 二审通过状态 else { var utilsThird = new ApproveThirdUtils(); msg += utilsThird.recoverDataInfo(selDataTable); } } catch (Exception ex) { XtraMessageBox.Show("操作出现错误:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { SplashScreenManager.CloseForm(); } using (var mf = new MessageForm(msg) { Text = "恢复操作结果" }) { mf.ShowDialog(); if (mf.DialogResult == DialogResult.Cancel) { this.refrashCurrentPage(); } } }