Example #1
0
 //批量通过
 private void barBtnPass_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (this.xtraTabControl1.SelectedTabPage.Text.Equals("待审批"))
     {
         var dtExport = (DataTable)this.gcDataInfo.DataSource;
         if (dtExport == null || dtExport.Rows.Count < 1)
         {
             XtraMessageBox.Show("当前没有数据可以操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         var dt = GridControlHelper.SelectedItems(this.gvDataInfo);
         if (dt.Rows.Count < 1)
         {
             if (XtraMessageBox.Show("确定批量通过所有数据吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
             {
                 int num = OracleHelper.ExecuteNonQuery(OracleHelper.conn, String.Format("update DB_INFOMATION set APP_NAME_3='{0}',APP_TIME_3=to_date('{1}','yyyy-mm-dd hh24:mi:ss'),APP_STATUS=31 where APP_STATUS=21", Settings.Default.LocalUserName, DateTime.Now));
                 XtraMessageBox.Show(string.Format("批量通过{0}条数据成功!", num), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 this.refrashCurrentPage();
                 return;
             }
             else
             {
                 return;
             }
         }
         try
         {
             using (var pf = new PassInfoForm(dt, 21))
             {
                 pf.ShowDialog();
                 if (pf.DialogResult == DialogResult.OK)
                 {
                     this.refrashCurrentPage();
                 }
             }
         }
         catch (Exception ex)
         {
             XtraMessageBox.Show("操作出现错误:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         XtraMessageBox.Show("只能在待审批页面操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #2
0
        //批量通过
        private void barBtnPass_ItemClick(object sender, ItemClickEventArgs e)
        {
            //记录操作日志
            //LogUtils.ReviewLogManager.ReviewLog(Properties.Settings.Default.LocalUserName, this.Text + "-" + this.barBtnPass.Caption);

            if (this.xtraTabControl1.SelectedTabPage.Text.Equals("待审批"))
            {
                var dtExport = (DataTable)this.gcDataInfo.DataSource;
                if (dtExport == null || dtExport.Rows.Count < 1)
                {
                    XtraMessageBox.Show("当前没有数据可以操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                var dt = GridControlHelper.SelectedItems(this.gvDataInfo);
                if (dt.Rows.Count < 1)
                {
                    XtraMessageBox.Show("请选择您要操作的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                try
                {
                    using (var pf = new PassInfoForm(dt, 0))
                    {
                        pf.ShowDialog();
                        if (pf.DialogResult == DialogResult.OK)
                        {
                            this.refrashCurrentPage();
                        }
                    }
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show("操作出现错误:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                XtraMessageBox.Show("只能在待审批页面操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }