protected void Page_Load(object sender, EventArgs e)
        {
            presenter = new CustomerWatchPresenter(this, ReportsService.Create(), ReportManagerFactory.Create(this.CurrentScope(), Context.User as CffPrincipal));

            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }

            if (!IsPostBack)
            {
                presenter.ConfigureView(this.CurrentScope());
                presenter.ShowReport(this.CurrentScope(), true);
            }
        }
Ejemplo n.º 2
0
        public void LoadTab(RetentionSchedule retentionSchedule)
        {
            bool bIsClientSelected = (SessionWrapper.Instance.Get != null)?SessionWrapper.Instance.Get.IsClientSelected:
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue))?SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).IsClientSelected:false;

            if (bIsClientSelected)
            {
                _retentionSchedule = retentionSchedule;
                ViewState.Add("RetentionSchedule", retentionSchedule);

                // In Retention Schedules, the tab is always opened in Client scope
                IReportManager reportManager = ReportManagerFactory.Create(Scope.ClientScope, Context.User as CffPrincipal);
                presenter = new OverdueChargesPresenter(this, ReportsService.Create(), reportManager);
                presenter.ShowReport(Scope.ClientScope, false);
            }
        }
Ejemplo n.º 3
0
        public void ShouldBeCreateReport()
        {
            //Arange
            var reportService = new ReportsService(db);

            //Act
            reportService.Create("test", "1");
            var result = this.db.Report.First();

            //Assert
            var expectReportText = "test";
            var expectOrderId    = "1";

            Assert.Equal(expectReportText, result.ReportText);
            Assert.Equal(expectOrderId, result.OrderId);
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // start related ref:CFF-18
            if (SessionWrapper.Instance.Get != null)
            {
                presenter = new StatusPresenter(this, ReportsService.Create(), ReportManagerFactory.Create(SessionWrapper.Instance.Get.Scope, Context.User as CffPrincipal));
                if (SessionWrapper.Instance.Get.ClientFromQueryString != null)
                {
                    targetName = ": " + SessionWrapper.Instance.Get.ClientFromQueryString.Name;

                    int facilityType = (SessionWrapper.Instance.Get.ClientFromQueryString.ClientFacilityType);

                    if (facilityType == 4 || facilityType == 5)
                    {
                        StatusPicker.Visible = false;
                    }
                    else
                    {
                        StatusPicker.Visible = true;
                    }
                }

                if (SessionWrapper.Instance.Get.CustomerFromQueryString != null)
                {
                    if (targetName != null || !targetName.Equals(""))
                    {
                        targetName += " / ";
                        targetName  = string.Concat(targetName, SessionWrapper.Instance.Get.CustomerFromQueryString.Name);
                    }
                    else
                    {
                        targetName = ": " + SessionWrapper.Instance.Get.CustomerFromQueryString.Name;
                    }
                }
                // end
                if (!IsPostBack)
                {
                    presenter.ConfigureView(SessionWrapper.Instance.Get.Scope);
                    presenter.ShowReport(SessionWrapper.Instance.Get.Scope, true);
                }
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            allClientsFilter.Update += ControlReportAllClientsFilterUpdate;
            if (SessionWrapper.Instance.Get.Scope != Scope.AllClientsScope)
            {
                DatePicker.Update += DatePickerUpdate;
            }

            foreach (AsyncPostBackTrigger trigger in GridUpdatePanel.Triggers)
            {
                if (DatePicker.UniqueID.EndsWith(trigger.ControlID, StringComparison.OrdinalIgnoreCase))
                {
                    trigger.ControlID = DatePicker.UniqueID;
                    break;
                }
            }
            presenter = new ControlReportPresenter(this, ReportsService.Create(),
                                                   ReportManagerFactory.Create(this.CurrentScope(), Context.User as CffPrincipal));
            presenter.ConfigureView(SessionWrapper.Instance.Get.Scope);
        }