Ejemplo n.º 1
0
        /// <summary>
        /// Opens a save file dialogue then proccesses the report
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRender_Click(object sender, EventArgs e)
        {
            //opens the dialogue
            if (SaveReport.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }


            //abort if no file name
            if (SaveReport.FileName != "")
            {
                //create a new list
                List <events> eventsList = new List <events>();

                //get the events from the listbox and add them to the events list
                foreach (object o in lbxSelectedEvents.Items)
                {
                    eventsList.Add((events)o);
                }

                //use the report writter to create and save a form
                ReportWriter2.CreateForm(SaveReport.InitialDirectory + SaveReport.FileName, chkGrandTotals.Checked, chkRunningTotals.Checked, eventsList);

                //if the chk for open on render it opens the rendered file
                if (chkOpen.Checked)
                {
                    Process.Start(SaveReport.InitialDirectory + SaveReport.FileName);
                }
            }
        }
        public void CheckSaving(string report, string pathName)
        {
            string     path       = Path.GetTempPath() + pathName;
            SaveReport testObject = new SaveReport(report, path);
            string     actual     = File.ReadAllText(path);

            Assert.Equal(report, actual);
        }
        public void CorrectData(string report)
        {
            string     path       = Path.GetTempPath() + "PterodactylTest.md";
            SaveReport testObject = new SaveReport(report, path);

            Assert.Equal(report, testObject.Report);
            Assert.Equal(path, testObject.Path);
        }
Ejemplo n.º 4
0
 public void ReportGenerationCreateApplication()
 {
     GoTo();
     utility.ClickDropdownAndEnter(ReportEntityDropdown);
     FillFieldsToDisplay();
     FindFieldToDefine();
     SaveReport.ClickOn();
     ReportName.SendKeys(Constant.ReportName + RandomNumber.smallNumber());
     SaveAfterName.ClickOn();
     softAssert.VerifySuccessMsg();
 }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string report = string.Empty;

            DA.GetData(0, ref report);

            string path = string.Empty;

            DA.GetData(1, ref path);

            SaveReport reportDocument = new SaveReport(report, path);
        }
        public PostProcessing(IHttpClientFactory clientFactory, ILogger <PostProcessing> logger, LocalCache localCache, IOptions <ProcessingOptions> options)
        {
            _clientFactory = clientFactory;
            _logger        = logger;
            _saveReport    = options.Value.SaveReport;

            _lazyReportDir = new Lazy <string>(() =>
            {
                var reportDir = Path.Combine(localCache.LocalRootName, "Reports");

                // ensure the directory is exists
                Directory.CreateDirectory(reportDir);

                return(reportDir);
            });
        }
Ejemplo n.º 7
0
 public string AddReport(SaveReport saveReport)
 {
     try
     {
         var isExist = _conText.SaveReport.SingleOrDefault(x =>
                                                           x.MemberId == saveReport.MemberId && x.Date == saveReport.Date);
         if (isExist != null)
         {
             isExist.Budget = saveReport.Budget;
             _conText.SaveChanges();
             return("編輯成功");
         }
         else
         {
             _conText.SaveReport.Add(saveReport);
             _conText.SaveChanges();
             return("新增成功");
         }
     }
     catch (Exception e)
     {
         return("新增失敗" + e.ToString());
     }
 }
Ejemplo n.º 8
0
 public string AddSaveReport(SaveReport saveReport)
 {
     return(_calculateService.AddReport(saveReport));
 }