コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Forms.FrmWorkProcess upf = new Forms.FrmWorkProcess();
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgressWithOnlyUI();
            upf.PlayProgressWithOnlyUI(80);

            try
            {
                if (!this.isComplete())
                {
                    return;
                }

                OnSaveEvent();
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!Ex:" + ex.ToString());
            }
            finally
            {
                upf.CloseProgressWithOnlyUI();
            }
        }
コード例 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Forms.FrmWorkProcess upf = new Forms.FrmWorkProcess();
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgressWithOnlyUI();
            upf.PlayProgressWithOnlyUI(80);

            try
            {
                ConnectionManager.Context.table("ZiDianBiao").where ("MingCheng='" + TRCode1Key + "'").delete();
                ConnectionManager.Context.table("ZiDianBiao").where ("MingCheng='" + TRCode2Key + "'").delete();
                ConnectionManager.Context.table("ZiDianBiao").where ("MingCheng='" + TRCode3Key + "'").delete();
                ConnectionManager.Context.table("ZiDianBiao").where ("MingCheng='" + TRCode4Key + "'").delete();

                ZiDianBiao zd = new ZiDianBiao();
                zd.BianHao   = Guid.NewGuid().ToString();
                zd.MingCheng = TRCode1Key;
                zd.ShuJu     = ibEdit1.Value.ToString();
                zd.copyTo(ConnectionManager.Context.table("ZiDianBiao")).insert();

                zd           = new ZiDianBiao();
                zd.BianHao   = Guid.NewGuid().ToString();
                zd.MingCheng = TRCode2Key;
                zd.ShuJu     = ibEdit2.Value.ToString();
                zd.copyTo(ConnectionManager.Context.table("ZiDianBiao")).insert();

                zd           = new ZiDianBiao();
                zd.BianHao   = Guid.NewGuid().ToString();
                zd.MingCheng = TRCode3Key;
                zd.ShuJu     = ibEdit3.Value.ToString();
                zd.copyTo(ConnectionManager.Context.table("ZiDianBiao")).insert();

                zd           = new ZiDianBiao();
                zd.BianHao   = Guid.NewGuid().ToString();
                zd.MingCheng = TRCode4Key;
                zd.ShuJu     = ibEdit4.Value.ToString();
                zd.copyTo(ConnectionManager.Context.table("ZiDianBiao")).insert();

                updateTextControl();
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!Ex:" + ex.ToString());
            }
            finally
            {
                upf.CloseProgressWithOnlyUI();
            }
        }
コード例 #3
0
        private void btnExcelLoad_Click(object sender, EventArgs e)
        {
            if (ofdExcelDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    DataSet ds = ProjectReporterPlugin.Utility.ExcelHelper.ExcelToDataSet(ofdExcelDialog.FileName);
                    if (ds != null && ds.Tables.Count >= 1)
                    {
                        //显示提示窗体
                        Forms.FrmWorkProcess upf = new Forms.FrmWorkProcess();
                        upf.LabalText = "正在导入,请稍等...";
                        upf.ShowProgressWithOnlyUI();
                        upf.PlayProgressWithOnlyUI(80);

                        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.CloseProgressWithOnlyUI();

                        PublicReporterLib.PluginLoader.getLocalPluginRoot <PluginRoot>().refreshEditors();

                        MessageBox.Show("操作完成!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("导入失败!Ex:" + ex.ToString());
                }
            }
        }
コード例 #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Forms.FrmWorkProcess upf = new Forms.FrmWorkProcess();
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgressWithOnlyUI();
            upf.PlayProgressWithOnlyUI(80);

            try
            {
                File.WriteAllText(getTxtFilePath(), txtContent.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!Ex:" + ex.ToString());
            }
            finally
            {
                upf.CloseProgressWithOnlyUI();
            }
        }
コード例 #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Forms.FrmWorkProcess upf = new Forms.FrmWorkProcess();
            upf.LabalText = "正在保存,请等待...";
            upf.ShowProgressWithOnlyUI();
            upf.PlayProgressWithOnlyUI(80);

            try
            {
                SaveProject();
                PublicReporterLib.PluginLoader.getLocalPluginRoot <ProjectReporterPlugin.PluginRoot>().refreshEditors();
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!Ex:" + ex.ToString());
            }
            finally
            {
                upf.CloseProgressWithOnlyUI();
            }
        }
コード例 #6
0
        private void btnExcelLoad_Click(object sender, EventArgs e)
        {
            if (ofdExcelDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    DataSet ds = ProjectReporterPlugin.Utility.ExcelHelper.ExcelToDataSet(ofdExcelDialog.FileName);
                    if (ds != null && ds.Tables.Count >= 1)
                    {
                        //显示提示窗体
                        Forms.FrmWorkProcess upf = new Forms.FrmWorkProcess();
                        upf.LabalText = "正在导入,请稍等...";
                        upf.ShowProgressWithOnlyUI();
                        upf.PlayProgressWithOnlyUI(80);

                        foreach (DataTable dt in ds.Tables)
                        {
                            foreach (DataRow dr in dt.Rows)
                            {
                                if (dr.ItemArray != null)
                                {
                                    //插入数据
                                    insertDataFromDataRow(dr);
                                }
                            }
                        }

                        upf.CloseProgressWithOnlyUI();

                        btnSave.PerformClick();

                        MessageBox.Show("操作完成!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("导入失败!Ex:" + ex.ToString());
                }
            }
        }