Esempio n. 1
0
        private void bExport_Click(object sender, EventArgs e)
        {
            PwDatabase db = m_dDB.ElementAt(lbDB.SelectedIndex).Key;

            RefreshHandler(db);
            //if (!m_handler.SetDB(db, false)) return;
            if (!AppPolicy.Current.ExportNoKey && !m_handler.ReAskKey())
            {
                return;
            }

            db = m_handler.OTPDB;
            PwGroup      pg     = db.RootGroup;
            PwExportInfo pwInfo = new PwExportInfo(pg, db, false);

            MessageService.ExternalIncrementMessageCount();
            ShowWarningsLogger swLogger = KeePass.Program.MainForm.CreateShowWarningsLogger();

            swLogger.StartLogging(KPRes.ExportingStatusMsg, true);

            ExportUtil.Export(pwInfo, swLogger);
            swLogger.SetText(string.Empty, KeePassLib.Interfaces.LogStatusType.Info);
            swLogger.EndLogging();
            MessageService.ExternalDecrementMessageCount();
        }
Esempio n. 2
0
        private void ExportData()
        {
            NZString SlipNo      = new NZString(null, shtDelivery.GetValue(shtDelivery.ActiveRowIndex, (int)eColView.SLIP_NO));
            string   strFileName = GenerateFileName("INV_" + SlipNo.StrongValue);

            string strTemplateFileName = @"Report\TRN090_Invoice_Template.xls";
            string strTemplatePath     = Path.Combine(Application.StartupPath, strTemplateFileName);

            string strExportPath = SaveDialogUtil.GetBrowseFileDialogForExport(strFileName);

            if (!"".Equals(strExportPath))
            {
                DeliveryController ctrl = new DeliveryController();
                DataSet            ds   = new DataSet();
                ds.Tables.Add(ctrl.Load_Invoice(SlipNo));

                ExportUtil.Export(ds, strTemplatePath, strExportPath);


                MessageDialog.ShowInformation(this, null, new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription);

                if (File.Exists(strExportPath))
                {
                    System.Diagnostics.Process.Start(strExportPath);
                }
            }
        }
Esempio n. 3
0
        private void bExport_Click(object sender, EventArgs e)
        {
            PwDatabase db = m_dDB.ElementAt(lbDB.SelectedIndex).Key;

            RefreshHandler(db);
            //if (!m_handler.SetDB(db, false)) return;
            //If configured, KeePass 2.46 will ask for the masterkey during the export
            //No need to ask here
            if (Tools.KeePassVersion < new Version(2, 46))
            {
                if (!AppPolicy.Current.ExportNoKey && !m_handler.ReAskKey())
                {
                    return;
                }
            }

            db = m_handler.OTPDB;
            PwGroup      pg     = db.RootGroup;
            PwExportInfo pwInfo = new PwExportInfo(pg, db, false);

            MessageService.ExternalIncrementMessageCount();
            ShowWarningsLogger swLogger = KeePass.Program.MainForm.CreateShowWarningsLogger();

            swLogger.StartLogging(KPRes.ExportingStatusMsg, true);
            try
            {
                ExportUtil.Export(pwInfo, swLogger);
                swLogger.SetText(string.Empty, KeePassLib.Interfaces.LogStatusType.Info);
            }
            finally
            {
                swLogger.EndLogging();
                MessageService.ExternalDecrementMessageCount();
            }
        }
        private static void ExportDatabaseFile(EcasAction a, EcasContext ctx)
        {
            string strPath = EcasUtil.GetParamString(a.Parameters, 0, true);
            // if(string.IsNullOrEmpty(strPath)) return; // Allow no-file exports
            string strFormat = EcasUtil.GetParamString(a.Parameters, 1, true);

            if (string.IsNullOrEmpty(strFormat))
            {
                return;
            }
            string strGroup = EcasUtil.GetParamString(a.Parameters, 2, true);
            string strTag   = EcasUtil.GetParamString(a.Parameters, 3, true);

            PwDatabase pd = Program.MainForm.ActiveDatabase;

            if ((pd == null) || !pd.IsOpen)
            {
                return;
            }

            PwGroup pg = pd.RootGroup;

            if (!string.IsNullOrEmpty(strGroup))
            {
                char    chSep = strGroup[0];
                PwGroup pgSub = pg.FindCreateSubTree(strGroup.Substring(1),
                                                     new char[] { chSep }, false);
                pg = (pgSub ?? (new PwGroup(true, true, KPRes.Group, PwIcon.Folder)));
            }

            if (!string.IsNullOrEmpty(strTag))
            {
                pg = pg.CloneDeep();

                GroupHandler gh = delegate(PwGroup pgSub)
                {
                    PwObjectList <PwEntry> l = pgSub.Entries;
                    long n = (long)l.UCount;
                    for (long i = n - 1; i >= 0; --i)
                    {
                        if (!l.GetAt((uint)i).HasTag(strTag))
                        {
                            l.RemoveAt((uint)i);
                        }
                    }

                    return(true);
                };

                gh(pg);
                pg.TraverseTree(TraversalMethod.PreOrder, gh, null);
            }

            PwExportInfo     pei = new PwExportInfo(pg, pd, true);
            IOConnectionInfo ioc = (!string.IsNullOrEmpty(strPath) ?
                                    IOConnectionInfo.FromPath(strPath) : null);

            ExportUtil.Export(pei, strFormat, ioc);
        }
Esempio n. 5
0
        private void ExportData()
        {
            string strFileName = GenerateFileName("StockTaking");

            string strTemplateFileName = @"Report\STR030_StockTaking.xls";
            string strTemplatePath     = Path.Combine(Application.StartupPath, strTemplateFileName);

            string strExportPath = SaveDialogUtil.GetBrowseFileDialogForExport(strFileName);

            if (!"".Equals(strExportPath))
            {
                StockTakingDTO dto = new StockTakingDTO();
                dto.STOCK_TAKING_DATE = Convert.ToDateTime(dtStockTakingDate.DateValue);
                dto.LOCATION_CODE     = cboProcess.SelectedValue == null ? string.Empty : cboProcess.SelectedValue.ToString();//txtLocation.Text;
                dto.PART_NO           = txtMasterNo.Text;
                dto.PART_TYPE         = Convert.ToString(cboItemType.SelectedValue);
                dto.PART_SUB_TYPE     = Convert.ToString(cboItemClassMinor04.SelectedValue);

                if (chkIncomplete.Checked)
                {
                    dto.SEARCH_INCOMPLETE = 1;
                }
                else
                {
                    dto.SEARCH_INCOMPLETE = 0;
                }

                if (chkDiff.Checked)
                {
                    dto.SEARCH_DIFF = 1;
                }
                else
                {
                    dto.SEARCH_DIFF = 0;
                }

                if (chkNoMaster.Checked)
                {
                    dto.NO_MASTER = 1;
                }
                else
                {
                    dto.NO_MASTER = 0;
                }

                DataSet ds = GetExportTable(dto);

                ExportUtil.Export(ds, strTemplatePath, strExportPath);


                MessageDialog.ShowInformation(this, null, new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription);

                if (File.Exists(strExportPath))
                {
                    System.Diagnostics.Process.Start(strExportPath);
                }
            }
        }
Esempio n. 6
0
        public override void OnExport()
        {
            if (shtQueryList.ActiveRowIndex == -1)
            {
                return;
            }

            if (m_dtAllData == null)
            {
                MessageBox.Show("ให้ทำการค้นหาข้อมูลก่อน export");
                return;
            }

            string strReportID = "";

            strReportID = shtQueryList.Cells[shtQueryList.ActiveRowIndex, (int)eColQueryList.ID].Text;



            string strFileName = GenerateFileName(strReportID);

            string strTemplateFileName = @"Report\" + this.txtTemplate.Text;
            string strTemplatePath     = Path.Combine(Application.StartupPath, strTemplateFileName);

            string strExportPath = SaveDialogUtil.GetBrowseFileDialogForExport(strFileName);

            if (!"".Equals(strExportPath))
            {
                DataSet ds = new DataSet();
                ds.Tables.Add(this.m_dtAllData.Copy());

                //ExportUtil.Export(ds, @"c:\testExport0.xls");


                if (File.Exists(strTemplatePath))
                {
                    ExportUtil.Export(ds, strTemplatePath, strExportPath, ExportUtil.Format, Convert.ToInt32(txtStartColumn.Text), Convert.ToInt32(txtStartRow.Text));
                }
                else
                {
                    ExportUtil.Export(ds, strExportPath, ExportUtil.Format, Convert.ToInt32(txtStartColumn.Text), Convert.ToInt32(txtStartRow.Text));
                }

                MessageDialogResult mdr = MessageDialog.ShowConfirmation(this, "บันทึกเสร็จแล้ว ต้องการเปิดไฟล์หรือไม่", EVOFramework.Windows.Forms.MessageDialogButtons.YesNo);

                if (mdr == MessageDialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(strExportPath);
                }
            }
        }
Esempio n. 7
0
        private void ExportOnHandForAccounting()
        {
            string strFileName = GenerateFileName("IVR010");

            string strTemplateFileName = @"Report\IVR010_InventorySheet.xls";
            string strTemplatePath     = Path.Combine(Application.StartupPath, strTemplateFileName);

            string strExportPath = SaveDialogUtil.GetBrowseFileDialogForExport(strFileName);

            if (!"".Equals(strExportPath))
            {
                ReportBIZ bizReport = new ReportBIZ();
                ReportCriteriaDTO.IVR010 objCriteria = new ReportCriteriaDTO.IVR010();

                if (this.dtPeriodBegin.Value.HasValue)
                {
                    objCriteria.YearMonth = this.dtPeriodBegin.Value.Value.ToString("yyyyMM");
                }
                else
                {
                    objCriteria.YearMonth = DateTime.Today.ToString("yyyyMM");
                }


                DataSet dsIVR010 = bizReport.LoadIVR010_InventorySheet(objCriteria);

                ExportUtil.Export(dsIVR010, strTemplatePath, strExportPath);


                MessageDialog.ShowInformation(this, null, new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription);


                if (File.Exists(strExportPath))
                {
                    System.Diagnostics.Process.Start(strExportPath);
                }
            }
        }
        private static void ExportDatabaseFile(EcasAction a, EcasContext ctx)
        {
            string strPath = EcasUtil.GetParamString(a.Parameters, 0, true);
            // if(string.IsNullOrEmpty(strPath)) return; // Allow no-file exports
            string strFormat = EcasUtil.GetParamString(a.Parameters, 1, true);

            if (string.IsNullOrEmpty(strFormat))
            {
                return;
            }

            PwDatabase pd = Program.MainForm.ActiveDatabase;

            if ((pd == null) || !pd.IsOpen)
            {
                return;
            }

            PwExportInfo     pei = new PwExportInfo(pd.RootGroup, pd, true);
            IOConnectionInfo ioc = (!string.IsNullOrEmpty(strPath) ?
                                    IOConnectionInfo.FromPath(strPath) : null);

            ExportUtil.Export(pei, strFormat, ioc);
        }