Exemple #1
0
 private void btnSchmidtAnalys_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy)
     {
         var targetform  = this.ActiveDataForm;
         var targettable = targetform.GetDataTable();
         ConfigForm.SchmidtAnalysisConfigForm configform = new ConfigForm.SchmidtAnalysisConfigForm(targettable.Name, targettable.GetColumnsList(false, typeof(string), typeof(DateTime), typeof(bool)));
         if (configform.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 MdiForm.MdiDataViewForm       resultform = new MdiForm.MdiDataViewForm();
                 Protocol.Structure.WaitObject wt         = new Protocol.Structure.WaitObject();
                 targetform.DoMethod("施密特分析", (ThreadPool) =>
                 {
                     var result = Kernel.BusinessLogicOperation.DataProcessOperation.SchmidtAnalysis(targettable, configform.SelectedColumns, configform.AreaSize, configform.AreaSpace);
                     if (result.Item1 != Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.SUCCESS)
                     {
                         string errormsg = "程序发生错误";
                         switch (result.Item1)
                         {
                         case Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.OUTOFRANGE:
                             {
                                 errormsg = "滑动区间超过数据范围";
                                 break;
                             }
                         }
                         MessageBox.Show(errormsg);
                         resultform.AbortMethod();
                     }
                     else
                     {
                         resultform.DataSource = result.Item2;
                     }
                 }, wt, () =>
                 {
                     this.Invoke(new Action(() =>
                     {
                         resultform.MdiParent = this;
                         resultform.MdiIndex  = this.DataFormIndex++;
                         resultform.Caption   = targetform.Caption + "_施密特分析结果";
                         resultform.Show();
                     }));
                 });
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
     }
 }
Exemple #2
0
 private void btnCopyTable_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy)
     {
         var data = this.ActiveDataForm.GetDataTable();
         try
         {
             MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
             targetform.MdiParent = this;
             targetform.MdiIndex  = this.DataFormIndex++;
             targetform.Show();
             MPPO.Kernel.BusinessLogicOperation.DataAccessOperation.CopyViewDataFromData(targetform, data);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
             return;
         }
     }
 }
 private void btnCopyTable_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy)
     {
         var data = this.ActiveDataForm.GetDataTable();
         try
         {
             MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
             targetform.MdiParent = this;
             targetform.MdiIndex = this.DataFormIndex++;
             targetform.Show();
             MPPO.Kernel.BusinessLogicOperation.DataAccessOperation.CopyViewDataFromData(targetform, data);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
             return;
         }
     }
 }
Exemple #4
0
        private void btnQueryDataBase_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var configform = new MPPO.UI.ConfigForm.DebugDataSelectForm();

            if (configform.ShowDialog() == DialogResult.Yes)
            {
                try
                {
                    MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
                    targetform.MdiParent = this;
                    targetform.MdiIndex  = this.DataFormIndex++;
                    targetform.Show();
                    MPPO.Kernel.BusinessLogicOperation.DataAccessOperation.GetSingleTableFromDataBase(targetform, configform.command, configform.conStr, configform.tablename);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
            }
        }
Exemple #5
0
        private void btnExDataAccess_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var configform = new MPPO.UI.ConfigForm.ExDataAccessConfigForm();

            if (configform.ShowDialog() == DialogResult.OK)
            {
                DataTable data;
                try
                {
                    data = configform.ResultTable;
                    MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
                    targetform.MdiParent  = this;
                    targetform.MdiIndex   = this.DataFormIndex++;
                    targetform.DataSource = data;
                    targetform.Caption    = data.TableName;
                    targetform.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemple #6
0
 private void btnOpenTable_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     m_dlgOpenFile.Multiselect      = true;
     m_dlgOpenFile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
     m_dlgOpenFile.Filter           = "Excel 工作簿(*.xlsx)|*.xlsx|Excel 97-2003 工作簿(*.xls)|*.xls";
     m_dlgOpenFile.FilterIndex      = 1;
     m_dlgOpenFile.RestoreDirectory = true;
     if (m_dlgOpenFile.ShowDialog() == DialogResult.OK)
     {
         for (int fi = 0; fi < m_dlgOpenFile.FileNames.Length; fi++)
         {
             DataSet data = MPPO.Kernel.BusinessLogicOperation.DataAccessOperation.GetTablesFromExcel(m_dlgOpenFile.FileNames[fi]);
             foreach (DataTable table in data.Tables)
             {
                 MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
                 targetform.MdiParent  = this;
                 targetform.MdiIndex   = this.DataFormIndex++;
                 targetform.DataSource = table;
                 targetform.Caption    = m_dlgOpenFile.SafeFileName + "_" + table.TableName;
                 targetform.Show();
             }
         }
     }
 }
 private void btnExDataAccess_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     var configform = new MPPO.UI.ConfigForm.ExDataAccessConfigForm();
     if (configform.ShowDialog() == DialogResult.OK)
     {
         DataTable data;
         try
         {
             data = configform.ResultTable;
             MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
             targetform.MdiParent = this;
             targetform.MdiIndex = this.DataFormIndex++;
             targetform.DataSource = data;
             targetform.Caption = data.TableName;
             targetform.Show();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
        private void btnSchmidtAnalys_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy)
            {
                var targetform = this.ActiveDataForm;
                var targettable = targetform.GetDataTable();
                ConfigForm.SchmidtAnalysisConfigForm configform = new ConfigForm.SchmidtAnalysisConfigForm(targettable.Name, targettable.GetColumnsList(false, typeof(string), typeof(DateTime), typeof(bool)));
                if (configform.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        MdiForm.MdiDataViewForm resultform = new MdiForm.MdiDataViewForm();
                        Protocol.Structure.WaitObject wt = new Protocol.Structure.WaitObject();
                        targetform.DoMethod("施密特分析", (ThreadPool) =>
                        {
                            var result = Kernel.BusinessLogicOperation.DataProcessOperation.SchmidtAnalysis(targettable, configform.SelectedColumns, configform.AreaSize, configform.AreaSpace);
                            if(result.Item1 != Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.SUCCESS)
                            {
                                string errormsg = "程序发生错误";
                                switch(result.Item1)
                                {
                                    case Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.OUTOFRANGE:
                                        {
                                            errormsg = "滑动区间超过数据范围";
                                            break;
                                        }
                                }
                                MessageBox.Show(errormsg);
                                resultform.AbortMethod();
                            }
                            else
                            {
                                resultform.DataSource = result.Item2;

                            }
                        }, wt, () =>
                        {
                            this.Invoke(new Action(() =>
                            {
                                resultform.MdiParent = this;
                                resultform.MdiIndex = this.DataFormIndex++;
                                resultform.Caption = targetform.Caption + "_施密特分析结果";
                                resultform.Show();
                            }));
                        });
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
 private void btnQueryDataBase_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     var configform = new MPPO.UI.ConfigForm.DebugDataSelectForm();
     if (configform.ShowDialog() == DialogResult.Yes)
     {
         try
         {
             MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
             targetform.MdiParent = this;
             targetform.MdiIndex = this.DataFormIndex++;
             targetform.Show();
             MPPO.Kernel.BusinessLogicOperation.DataAccessOperation.GetSingleTableFromDataBase(targetform, configform.command, configform.conStr, configform.tablename);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
             return;
         }
     }
 }
        private void btnOpenTable_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            m_dlgOpenFile.Multiselect = true;
            m_dlgOpenFile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            m_dlgOpenFile.Filter = "Excel 工作簿(*.xlsx)|*.xlsx|Excel 97-2003 工作簿(*.xls)|*.xls";
            m_dlgOpenFile.FilterIndex = 1;
            m_dlgOpenFile.RestoreDirectory = true;
            if (m_dlgOpenFile.ShowDialog() == DialogResult.OK)
            {
                for (int fi = 0; fi < m_dlgOpenFile.FileNames.Length; fi++)
                {
                    DataSet data = MPPO.Kernel.BusinessLogicOperation.DataAccessOperation.GetTablesFromExcel(m_dlgOpenFile.FileNames[fi]);
                    foreach (DataTable table in data.Tables)
                    {
                        MdiForm.MdiDataViewForm targetform = new MdiForm.MdiDataViewForm();
                        targetform.MdiParent = this;
                        targetform.MdiIndex = this.DataFormIndex++;
                        targetform.DataSource = table;
                        targetform.Caption = m_dlgOpenFile.SafeFileName + "_" + table.TableName;
                        targetform.Show();
                    }
                }

            }
        }