Exemple #1
0
        /// <summary>
        /// Constructs the table cell with the data
        /// </summary>
        /// <param name="column">The column</param>
        /// <param name="value">The cell value</param>
        /// <param name="action">The action (optional)</param>
        public TableCell
        (
            TableColumn column,
            object value,
            ReportAction action = null
        )
        {
            Validate.IsNotNull(column);

            this.Column = column;
            this.Value  = value;
            this.Action = action;

            if (value == null)
            {
                this.FormattingType = DataValueFormattingType.None;
            }
            else
            {
                this.FormattingType = value.GetType().GetFormattingType
                                      (
                    value
                                      );
            }
        }
Exemple #2
0
        /// <summary>
        /// Constructs the statistic definition with the details
        /// </summary>
        /// <param name="name">The name</param>
        /// <param name="title">The title</param>
        /// <param name="query">The query</param>
        /// <param name="function">The aggregate function</param>
        /// <param name="action">The action (optional)</param>
        public StatisticDefinition
        (
            string name,
            string title,
            IQuery query,
            IAggregateFunction function,
            ReportAction action = null
        )
            : base(name, title)
        {
            Validate.IsNotNull(query);
            Validate.IsNotNull(function);

            this.Query    = query;
            this.Function = function;
            this.DefaultParameterValues = new Collection <ParameterValue>();
            this.Action = action;

            var defaultValues = query.CompileDefaultParameters();

            foreach (var value in defaultValues)
            {
                this.DefaultParameterValues.Add(value);
            }
        }
        /// <summary>
        /// Create a new table cell from a column definition and value
        /// </summary>
        /// <param name="columnDefinition">The column definition</param>
        /// <param name="value">The cell value</param>
        /// <param name="action">The cell action (optional)</param>
        /// <returns>The table cell created</returns>
        private TableCell CreateTableCell
        (
            TableColumnDefinition columnDefinition,
            object value,
            ReportAction action = null
        )
        {
            var column = new TableColumn
                         (
                columnDefinition.Name,
                columnDefinition.Title,
                columnDefinition.Alignment,
                columnDefinition.Importance,
                columnDefinition.NoWrap
                         );

            var cell = new TableCell
                       (
                column,
                value,
                action
                       );

            var formattingOverride = columnDefinition.FormattingTypeOverride;

            if (formattingOverride.HasValue)
            {
                cell.FormattingType = formattingOverride.Value;
            }

            return(cell);
        }
Exemple #4
0
        public void ReportActionConnectsAndSendsTest()
        {
            // Arrange
            var nsEndpoint        = "tcp://127.0.0.1:55021";
            var mockLogger        = new Mock <ILogger>();
            var name              = "DSC1";
            var timeSimulator     = new TimeSimulator();
            var random            = new Random();
            var generator         = new DiseaseRecordGenerator();
            var client            = new DiseaseSimulatorClient(name, nsEndpoint, mockLogger.Object);
            var mockRequestClient = new Mock <IRequestSocket>();

            client.RegClient.Socket = mockRequestClient.Object;
            var endpoint     = "tcp://127.0.0.1:55521"; // Added 1 to the end
            var reportAction = new ReportAction(client.SystemRegistration, timeSimulator, random, generator, client, endpoint);
            var date         = new DateTime(2018, 1, 1);
            var mockClient   = new Mock <IClient <ZFrame> >();

            client.Client = mockClient.Object;

            // Act
            reportAction.Action(date);

            // Assert
            mockClient.Verify(x => x.Connect(It.IsAny <string>()), Times.Once);
            mockClient.Verify(x => x.SendAsync(It.IsAny <string>(), It.IsAny <Action <ZFrame> >()), Times.Once);
        }
Exemple #5
0
        public void Run_ShouldNotThrowException__IfRobotNotPlaced()
        {
            _robot.Position = null;
            var action = new ReportAction(_robot, _mapProvider, _reporterMock.Object);

            action.Run();
        }
Exemple #6
0
        public void Run_ShouldShowReport()
        {
            var action = new ReportAction(_robot, _mapProvider, _reporterMock.Object);

            action.Run();
            _reporterMock.Verify(reporter => reporter.Info("Position: 3 2, facing: SOUTH."), Times.Once);
        }
 public ConsoleCommandController(BaseView view)
     : base(view)
 {
     _moveCmd = new MoveAction();
     _leftCmd = new LeftAction();
     _rightCmd = new RightAction();
     _plcCmd = new PlaceAction();
     _reportCmd = new ReportAction();
 }
Exemple #8
0
        public override void Initialize()
        {
            var _lumLibrary = new LumLibrary();

            if (_lumLibrary.isCNorHK())
            {
                ReportAction.AddMenuAction(ProductionMoveAction);
                ReportAction.MenuAutoOpen = true;
            }
        }
Exemple #9
0
        /// <summary>
        /// Adds the action to the data point
        /// </summary>
        /// <param name="action">The action</param>
        /// <returns>The updated data point</returns>
        public ChartDataPoint WithAction
        (
            ReportAction action
        )
        {
            Validate.IsNotNull(action);

            this.Action = action;

            return(this);
        }
Exemple #10
0
        /// <summary>
        /// Adds the action to the statistic
        /// </summary>
        /// <param name="action">The statistic action</param>
        /// <returns>The updated statistic</returns>
        public Statistic WithAction
        (
            ReportAction action
        )
        {
            Validate.IsNotNull(action);

            this.Action = action;

            return(this);
        }
Exemple #11
0
        /// <summary>
        /// Adds the action to the table row
        /// </summary>
        /// <param name="action">The action</param>
        /// <returns>The updated table row</returns>
        public TableRow WithAction
        (
            ReportAction action
        )
        {
            Validate.IsNotNull(action);

            this.Action = action;

            return(this);
        }
Exemple #12
0
        public override void Initialize()
        {
            var _lumLibrary = new LumLibrary();

            if (_lumLibrary.isCNorHK())
            {
                ReportAction.AddMenuAction(MaterialIssuesAction);
                ReportAction.AddMenuAction(MaterialReturnAction);
                ReportAction.MenuAutoOpen = true;
            }
        }
 public ConsoleKeyboardController(BaseView view)
     : base(view)
 {
     _moveCmd = new MoveAction();
     _leftCmd = new LeftAction();
     _rightCmd = new RightAction();
     _plcCmd = new PlaceAction();
     _reportCmd = new ReportAction();
     this.View.Grid.Robot.CurrentPosition = new Position { Direction = Direction.NORTH, X = 0, Y = 0 };
     this.View.Grid.Robot.IsPlaced = true;
 }
 /* TOP BOOKS WERE BOUGHT */
 public ActionResult BestSellBook()
 {
     if ((string)Session["role"] == "admin")
     {
         ViewBag.Report   = ReportAction.BestSeller();
         ViewBag.Customer = ReportAction.TopCustomer();
         return(View());
     }
     else
     {
         return(Redirect("~/Book/ShowBook"));
     }
 }
        public void ReportOccurrencesIds(IEnumerable <TChar> input, ReportAction report)
        {
            var id   = 0;
            var node = Root;

            foreach (var c in input)
            {
                node = node.GetNext(c);
                if (node.Mark)
                {
                    report(id, node.StringId);
                }
                id++;
            }
        }
Exemple #16
0
        /// <summary>
        /// Constructs the repeater item with the details
        /// </summary>
        /// <param name="value">The item value</param>
        /// <param name="action">The items action (optional)</param>
        /// <param name="components">The nested components</param>
        public RepeaterItem
        (
            object value,
            ReportAction action = null,
            params IReportComponent[] components
        )
        {
            this.Value  = value;
            this.Action = action;

            if (components == null)
            {
                this.NestedComponents = new IReportComponent[] { };
            }
            else
            {
                this.NestedComponents = components;
            }
        }
Exemple #17
0
        public ActionResult ShowBook()
        {
            using (var db = new DBShop())
            {
                int page_number = db.DbBook.Where(item => item.flag == false).Count();
                ViewBag.PageNumber = (page_number / page_size) + (page_number % page_size == 0 ? 0 : 1);
                db.Dispose();
            }

            if (Session["id"] == null)
            {
                if (ReportAction.Find_Month(DateTime.Now.Month) != null)
                {
                    ReportAction.Change_Visit(1, DateTime.Now.Month);
                }
                else
                {
                    ReportAction.Create_Visit(1, DateTime.Now.Month);
                }
            }
            return(View());
        }
        private void ProcessReport(ReportAction action)
        {
            switch (action)
            {
            case ReportAction.Print:
                RaporStokGiris().PrintDialog();
                break;

            case ReportAction.Preview:
                RaporStokGiris().ShowPreview();
                break;

            case ReportAction.Dizayn:
                XRDesignFormEx XrDesigner = new XRDesignFormEx();

                XrDesigner.FileName = Application.StartupPath + "\\ReportDesigners\\Irsaliye\\rptIrsaliye.repx";
                XrDesigner.OpenReport(RaporStokGiris());

                XrDesigner.Show();
                break;
            }
        }
 public TimeChecker(ReportAction reportAction)
 {
     this.time         = this.lastestTime = DateTime.Now;
     this.reportAction = reportAction;
 }
Exemple #20
0
        private void RenderReport(ReportAction reportAction)
        {
            if (tvReports.SelectedNode != null && tvReports.SelectedNode.Parent != null)
            {
                string file = applicationPath + "Reports\\" + tvReports.SelectedNode.Tag as string;

                if (File.Exists(file))
                {
                    #region Show Animation in taskbar
                    Stimulsoft.Controls.DesktopIntegration.Windows7Taskbar.ShowTaskbarProgress(this.Handle,
                                                                                               Stimulsoft.Controls.DesktopIntegration.Windows7Taskbar.ThumbnailProgressState.Indeterminate);
                    #endregion

                    StiReport report = new StiReport();
                    report.Load(file);
                    reportInfo info = reportsHelper[tvReports.SelectedNode.Tag] as reportInfo;
                    if (info != null)
                    {
                        report.ReportDescription = info.description;
                    }

                    string folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                    folder = Path.Combine(folder, "Stimulsoft\\CompiledReports");
                    folder = Path.Combine(folder, System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion().ToString());
                    string compiledReportFile = Path.Combine(folder, report.GetReportAssemblyCacheName());


                    if (File.Exists(compiledReportFile))
                    {
                        lbStatus.Text = "Loading report from assembly";
                        Application.DoEvents();
                        report = StiReport.GetReportFromAssembly(compiledReportFile, true);

                        RegData(report, (string)tvReports.SelectedNode.Tag);

                        lbStatus.Text = "Rendering report";
                        Application.DoEvents();
                        report.Rendering += new EventHandler(OnRendering);
                        int tick = Environment.TickCount;

                        report.Render(false);
                    }
                    else
                    {
                        lbStatus.Text = "Loading report";
                        Application.DoEvents();

                        RegData(report, (string)tvReports.SelectedNode.Tag);

                        lbStatus.Text = "Compiling report";
                        Application.DoEvents();

                        if (!Directory.Exists(folder))
                        {
                            Directory.CreateDirectory(folder);
                        }

                        report.Compile(compiledReportFile);

                        lbStatus.Text = "Rendering report";
                        Application.DoEvents();
                        if (report.CalculationMode == StiCalculationMode.Compilation)
                        {
                            report.CompiledReport.Rendering += new EventHandler(OnRendering);
                        }
                        else
                        {
                            report.Rendering += new EventHandler(OnRendering);
                        }
                        int tick = Environment.TickCount;
                        report.Render(false);
                    }

                    if (!report.IsStopped)
                    {
                        if (reportAction == ReportAction.PreviewInWindow)
                        {
                            report.Show(true);
                        }
                        else if (reportAction == ReportAction.Preview)
                        {
                            viewerControl.Report = report;
                        }
                        else if (reportAction == ReportAction.Print)
                        {
                            report.Print();
                        }
                    }

                    lbStatus.Text = "";

                    #region Hide Animation in taskbar
                    Stimulsoft.Controls.DesktopIntegration.Windows7Taskbar.HideTaskbarProgress();
                    #endregion
                }
                else
                {
                    MessageBox.Show("'" + tvReports.SelectedNode.Tag as string + "' not found");
                }
            }
        }
 /* JSON - GET DATA COUNT VISITORS EACH MONTH */
 public JsonResult GetChartData()
 {
     return(Json(ReportAction.Get_Visit(), JsonRequestBehavior.AllowGet));
 }
 /* JSON - GET DATA PROFIT EVERY DAY */
 public JsonResult GetDataProfit()
 {
     return(Json(ReportAction.Profits(), JsonRequestBehavior.AllowGet));
 }
Exemple #23
0
        public static void Main(string[] args)
        {
            BangazonConnection db   = new BangazonConnection();
            Revenue            data = null;
            bool   isActive         = true;
            string userInput        = "";

            try
            {
                db.execute("SELECT Id FROM Revenue WHERE Id = 1000", (SqliteDataReader reader) =>
                {
                    while (reader.Read())
                    {
                        data = new Revenue
                        {
                            Id = reader.GetInt32(0)
                        };
                    }
                });
            }
            catch
            {
                DatabaseGenerator gen = new DatabaseGenerator();
                gen.CreateDatabase();
            }

            while (isActive)
            {
                Console.WriteLine(@"
==========================
BANGAZON FINANCIAL REPORTS
==========================
1. Weekly Report
2. Monthly Report
3. Quarterly Report
4. Customer Revenue Report
5. Product Revenue Report
x. Exit Program");

                Console.Write("> ");

                userInput = Console.ReadLine();

                if (userInput.ToUpper() == "X")
                {
                    isActive = false;
                    break;
                }

                switch (userInput)
                {
                case "1":
                    ReportAction.printWeeklyReport();
                    break;

                case "2":
                    ReportAction.printMonthlyReport();
                    break;

                case "3":
                    ReportAction.printQuarterlyReport();
                    break;

                case "4":
                    ReportAction.printCustomerReport();
                    break;

                case "5":
                    //ReportAction.getProductReport();
                    break;

                default:
                    Console.WriteLine("You did not enter a valid menu option.  Please try again.");
                    Console.WriteLine("");
                    break;
                }
            }
        }
Exemple #24
0
 public void Report(ProgressMessage value)
 {
     ReportAction?.Invoke(value);
 }
Exemple #25
0
        public Action(TabularModel parentTabularModel, Amo.Action Action)
        {
            _parentTabularModel = parentTabularModel;
            _amoAction          = Action;
            _objectDefinition   = "";

            if (_amoAction.Caption != null)
            {
                _objectDefinition += "Caption: " + _amoAction.Caption + "\n";
            }
            _objectDefinition += "Caption is MDX: " + _amoAction.CaptionIsMdx.ToString() + "\n";
            if (_amoAction.Description != null)
            {
                _objectDefinition += "Description: " + _amoAction.Description + "\n";
            }
            _objectDefinition += "Action Type: " + _amoAction.Type.ToString() + "\n";
            if (_amoAction.Target != null)
            {
                _objectDefinition += "Target: " + _amoAction.Target + "\n";
            }
            if (_amoAction.Condition != null)
            {
                _objectDefinition += "Condition: " + _amoAction.Condition + "\n";
            }
            _objectDefinition += "Invocation: " + _amoAction.Invocation.ToString() + "\n\n";

            switch (_amoAction.Type)
            {
            case ActionType.DrillThrough:
                if (_amoAction is DrillThroughAction)
                {
                    DrillThroughAction drillThroughAction = (DrillThroughAction)_amoAction;
                    _objectDefinition += "Drillthrough Columns:\n";
                    foreach (CubeAttributeBinding column in drillThroughAction.Columns)
                    {
                        if (drillThroughAction.Parent.Dimensions.Contains(column.CubeDimensionID) && drillThroughAction.Parent.Dimensions[column.CubeDimensionID].Attributes.Contains(column.AttributeID))
                        {
                            _objectDefinition += "Table: " + drillThroughAction.Parent.Dimensions[column.CubeDimensionID].Name + ", Column: " + drillThroughAction.Parent.Dimensions[column.CubeDimensionID].Attributes[column.AttributeID].Attribute.Name + "\n";
                        }
                    }
                    if (drillThroughAction.Columns.Count > 0)
                    {
                        _objectDefinition += "\n";
                    }
                    _objectDefinition += "Default: " + drillThroughAction.Default.ToString() + "\n";
                    _objectDefinition += "Maximum Rows: " + drillThroughAction.MaximumRows.ToString() + "\n";
                }
                break;

            case ActionType.Report:
                if (_amoAction is ReportAction)
                {
                    ReportAction reportAction = (ReportAction)_amoAction;
                    _objectDefinition += "Report Parameters:\n";
                    foreach (ReportParameter reportParameter in reportAction.ReportParameters)
                    {
                        if (reportParameter.Name != null && reportParameter.Value != null)
                        {
                            _objectDefinition += "Name: " + reportParameter.Name + ", Value: " + reportParameter.Value + "\n";
                        }
                    }
                    if (reportAction.ReportParameters.Count > 0 || reportAction.ReportFormatParameters.Count > 0)
                    {
                        _objectDefinition += "\n";
                    }
                    if (reportAction.ReportServer != null)
                    {
                        _objectDefinition += "Report Server: " + reportAction.ReportServer + "\n";
                    }
                    if (reportAction.Path != null)
                    {
                        _objectDefinition += "Maximum Path: " + reportAction.Path + "\n";
                    }
                }
                break;

            default:
                if (_amoAction is StandardAction)
                {
                    StandardAction standardAction = (StandardAction)_amoAction;
                    if (standardAction.Expression != null)
                    {
                        _objectDefinition += "Expression:\n" + standardAction.Expression + "\n";
                    }
                }
                break;
            }

            //if (_parentTabularModel.ComparisonInfo.OptionsInfo.OptionTranslations)
            //{
            //    _objectDefinition += "\nFormat & Visibility:\n";

            //    _objectDefinition += "Action Translations: ";
            //    if (_amoAction.Translations.Count > 0)
            //    {
            //        _objectDefinition += "[";
            //        foreach (Translation actionTranslation in _amoAction.Translations)
            //        {
            //            _objectDefinition += CultureInfo.GetCultureInfo(actionTranslation.Language).DisplayName + ": " + actionTranslation.Caption + ", ";
            //        }
            //        _objectDefinition = _objectDefinition.Substring(0, _objectDefinition.Length - 2) + "]";
            //    }

            //    if (_parentTabularModel.ComparisonInfo.OptionsInfo.OptionDisplayFolders)
            //    {
            //        _objectDefinition += ", Display Folder Translations: ";
            //        if (_amoAction.Translations.Count > 0)
            //        {
            //            _objectDefinition += "[";
            //            foreach (Translation actionDisplayFolderTranslation in _amoAction.Translations)
            //            {
            //                _objectDefinition += CultureInfo.GetCultureInfo(actionDisplayFolderTranslation.Language).DisplayName + ": " + actionDisplayFolderTranslation.DisplayFolder + ", ";
            //            }
            //            _objectDefinition = _objectDefinition.Substring(0, _objectDefinition.Length - 2) + "]";
            //        }
            //    }
            //    _objectDefinition += "\n";
            //}
        }
Exemple #26
0
    protected void DoReport(ReportAction reportAction)
    {
        byte[] reportContent;

        try
        {
            switch (reportAction)
            {
                case ReportAction.Print:
                    int printedCount = FinancialReportAdapter.PrintReports(gvAccounts.GetSelectedIds(), beginDate, endDate,
                        portfolioDevelopment, portfolioOverview, portfolioSummary, transactionOverview, moneyMutations, chartcover,
                        txtConcerning.Text, txtDescription.Text, ctlAccountFinder.AssetManagerId, ctlAccountFinder.Year, reportLetterType);

                    if (printedCount > 0)
                        elbErrorMessage.Text = string.Format("{0} report{1} successfully printed.",
                                                             printedCount, (printedCount == 1 ? " was" : "s were"));
                    else
                        elbErrorMessage.Text = "No reports were printed.";
                    break;

                case ReportAction.Preview:
                    if (fiscalYearOverview)
                    {
                      // Print a Fiscal report in preview-mode.
                      reportContent = FinancialReportAdapter.ViewFiscalYearReports(gvAccounts.GetSelectedIds()[0], beginDate, endDate,
                      txtConcerning.Text, txtDescription.Text, ctlAccountFinder.AssetManagerId, ctlAccountFinder.Year, reportLetterType);
                    }
                    else
                    {
                      // Print a Quarter report in preview-mode.
                      reportContent = FinancialReportAdapter.ViewQuarterReport(gvAccounts.GetSelectedIds()[0], beginDate, endDate,
                      portfolioDevelopment, portfolioOverview, portfolioSummary, transactionOverview, moneyMutations,
                      chartcover, txtConcerning.Text, txtDescription.Text, ctlAccountFinder.AssetManagerId, reportLetterType);
                    }

                    Session["report"] = reportContent;
                    Response.Redirect("~/Reports/ReportViewer.aspx");
                    break;

                case ReportAction.ViewResult:
                    // Print a total result of the printed reports in preview-mode.
                    reportContent = ReportResultsAdapter.ViewPrintedReports(ctlAccountFinder.AssetManagerId, ctlAccountFinder.Year, reportLetterType);
                    Session["report"] = reportContent;
                    Response.Redirect("~/Reports/ReportViewer.aspx");
                    break;

                default:
                    elbErrorMessage.Text = "No action was selected.";
                    break;
            }
        }
        catch (Exception ex)
        {
            elbErrorMessage.Text = Util.GetMessageFromException(ex);
        }
    }