Beispiel #1
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            ProjectReporter.Forms.UIDoWorkProcessForm upf = new Forms.UIDoWorkProcessForm();
            upf.EnabledDisplayProgress = false;
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgress();

            try
            {
                if (MainForm.Instance != null)
                {
                    long result = SaveProject();

                    if (result >= 0)
                    {
                        MainForm.Instance.SwitchToContentEditor();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!Ex:" + ex.ToString());
            }
            finally
            {
                upf.Close();
            }
        }
        private void btnExcelLoad_Click(object sender, EventArgs e)
        {
            if (ofdExcelDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    DataSet ds = ProjectReporter.Utility.ExcelHelper.ExcelToDataSet(ofdExcelDialog.FileName);
                    if (ds != null && ds.Tables.Count >= 1)
                    {
                        //显示提示窗体
                        ProjectReporter.Forms.UIDoWorkProcessForm upf = new Forms.UIDoWorkProcessForm();
                        upf.EnabledDisplayProgress = false;
                        upf.LabalText = "正在导入,请稍等...";
                        upf.ShowProgress();

                        foreach (DataTable dt in ds.Tables)
                        {
                            foreach (DataRow dr in dt.Rows)
                            {
                                if (dr[0] != null && dr[0].ToString().Equals("单位开户帐号"))
                                {
                                    continue;
                                }

                                if (dr.ItemArray != null)
                                {
                                    //插入骨干人员
                                    insertPersonFromDataRow(dr);
                                }
                            }
                        }

                        upf.Close();

                        RefreshView();
                        MessageBox.Show("操作完成!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("导入失败!Ex:" + ex.ToString());
                }
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            ProjectReporter.Forms.UIDoWorkProcessForm upf = new Forms.UIDoWorkProcessForm();
            upf.EnabledDisplayProgress = false;
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgress();

            if (lbcomattpath.Tag != null)
            {
                try
                {
                    if (lastFilePath != string.Empty)
                    {
                        File.Delete(lastFilePath);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("删除失败!Ex:" + ex.ToString());
                }

                try
                {
                    File.Copy(lbcomattpath.Tag.ToString(), Path.Combine(MainForm.ProjectDir, "建议书" + Path.GetExtension(lbcomattpath.Tag.ToString())), true);
                    UpdateLabel();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("上传失败!Ex:" + ex.ToString());
                }
            }
            try
            {
                System.Threading.Thread.Sleep(1000);
            }
            catch (Exception ex) { }

            upf.Close();

            MessageBox.Show("操作完成");
            Close();
        }
        private void RtfTextEditor_NextEvent(object sender, EventArgs args)
        {
            KeTiDetailEditor textEditor = (KeTiDetailEditor)sender;

            #region 保存过程
            ProjectReporter.Forms.UIDoWorkProcessForm upf = new Forms.UIDoWorkProcessForm();
            upf.EnabledDisplayProgress = false;
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgress();

            try
            {
                //保存
                textEditor.OnSaveEvent();
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!Ex:" + ex.ToString());
            }
            finally
            {
                upf.Close();
            }
            #endregion

            if (textEditor.DetailTabs.Pages.Count - 1 == textEditor.DetailTabs.SelectedIndex)
            {
                if (ParentNavigator.Pages.Count - 1 == ParentNavigator.SelectedIndex)
                {
                    //切换到下一页
                    MainForm.Instance.SwitchToNextPage(MainForm.Instance.EditorMaps["feUI7"]);
                }
                else
                {
                    ParentNavigator.SelectedIndex += 1;
                }
            }
            else
            {
                textEditor.DetailTabs.SelectedIndex += 1;
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            ProjectReporter.Forms.UIDoWorkProcessForm upf = new Forms.UIDoWorkProcessForm();
            upf.EnabledDisplayProgress = false;
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgress();

            try
            {
                OnSaveEvent();
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!Ex:" + ex.ToString());
            }
            finally
            {
                upf.Close();
            }
        }