示例#1
0
        public override void LoadData()
        {
            var appBudgetService = AppBudgetServicesRepository.GetAll(this.Permissions.AppBudgetServicesFilter).SingleOrDefault(f => f.Id == this.AppBudgetServiceId);

            this.AgencyId = appBudgetService.AgencyId;
            this.AppId    = appBudgetService.AppBudget.AppId;
            var list = Enum.GetValues(typeof(DayOfWeek)).Cast <DayOfWeek>().Select(x => new SelectListItem {
                Text = x.DisplayName(), Value = ((int)x).ToString()
            }).ToList();

            this.WeekStartDay = new SelectList(list, "Value", "Text");
        }
示例#2
0
        //public Service.ReportingMethods ReportingMethod { get; set; }
        #endregion

        #region Methods

        public override void LoadData()
        {
            this.PrevReports = this.SubReportsRepository.GetAll(this.Permissions.SubReportsFilter)     //allowed subreports
                               .Where(f => f.AppBudgetServiceId == this.AppBudgetServiceId)            //same appbudgetservice (service + agency)
                               .Where(f => f.MainReportId != this.MainReportId)                        //any but the current
                               .Where(f => f.MainReport.StatusId == (int)MainReport.Statuses.Approved) //only approved
                               .Select(f => new { subReportId = f.Id, start = f.MainReport.Start })    //select only nessesary data
                               .ToList()                                                               //download
                               .Select(f => new KeyValuePair <int, string>(f.subReportId, string.Format("{0}", f.start.ToMonthString())))
                               .ToSelectList(this.PrevSubReportId);


            var appBudgetService = AppBudgetServicesRepository.GetAll(this.Permissions.AppBudgetServicesFilter).SingleOrDefault(f => f.Id == this.AppBudgetServiceId);

            this.DetailsHeader.FundName        = appBudgetService.AppBudget.App.Fund.Name;
            this.DetailsHeader.AppName         = appBudgetService.AppBudget.App.Name;
            this.DetailsHeader.AgencyName      = appBudgetService.Agency.Name;
            this.DetailsHeader.SerName         = appBudgetService.Agency.AgencyGroup.DisplayName;
            this.DetailsHeader.ServiceName     = appBudgetService.Service.Name;
            this.DetailsHeader.ServiceTypeName = appBudgetService.Service.ServiceType.Name;
            //this.DetailsHeader.TotalAmountReported = decimal.

            this.ReportingMethodId = appBudgetService.Service.ReportingMethodId;

            var mainReport = MainReportsRepository.GetAll(this.Permissions.MainReportsFilter).Single(f => f.Id == this.MainReportId);

            this.DetailsHeader.Period = new Range <DateTime>()
            {
                Start = mainReport.Start, End = mainReport.End
            };
            this.DetailsHeader.MainReportStatusId = mainReport.StatusId;



            switch (appBudgetService.Service.ReportingMethodEnum)
            {
            default:
                this.UploadViewName = "Upload";
                break;
            }
        }