示例#1
0
 public void Include(EntityData otherData)
 {
     Alerts.AddRange(otherData.Alerts);
     EmailAlertRecipients.AddRange(otherData.EmailAlertRecipients);
     SmsAlertRecipients.AddRange(otherData.SmsAlertRecipients);
     AlertReports.AddRange(otherData.AlertReports);
     AlertRules.AddRange(otherData.AlertRules);
     ApplicationLanguages.AddRange(otherData.ApplicationLanguages);
     ContentLanguages.AddRange(otherData.ContentLanguages);
     Countries.AddRange(otherData.Countries);
     DataCollectors.AddRange(otherData.DataCollectors);
     Districts.AddRange(otherData.Districts);
     GatewaySettings.AddRange(otherData.GatewaySettings);
     HeadManagerConsents.AddRange(otherData.HeadManagerConsents);
     HealthRisks.AddRange(otherData.HealthRisks);
     HealthRiskLanguageContents.AddRange(otherData.HealthRiskLanguageContents);
     Localizations.AddRange(otherData.Localizations);
     LocalizedTemplates.AddRange(otherData.LocalizedTemplates);
     NationalSocieties.AddRange(otherData.NationalSocieties);
     Notifications.AddRange(otherData.Notifications);
     Projects.AddRange(otherData.Projects);
     SupervisorUserProjects.AddRange(otherData.SupervisorUserProjects);
     ProjectHealthRisks.AddRange(otherData.ProjectHealthRisks);
     RawReports.AddRange(otherData.RawReports);
     Regions.AddRange(otherData.Regions);
     Reports.AddRange(otherData.Reports);
     Users.AddRange(otherData.Users);
     UserNationalSocieties.AddRange(otherData.UserNationalSocieties);
     Villages.AddRange(otherData.Villages);
     Zones.AddRange(otherData.Zones);
 }
示例#2
0
        public async Task LoadAsync(AppDbContext context, long userId, string userName, long?flatId = null)
        {
            FlatId   = flatId;
            UserName = userName;

            if (!FlatId.HasValue)
            {
                FlatId = await context.FlatUsers
                         .Where(x => x.UserId == userId)
                         .Select(x => x.FlatId)
                         .FirstOrDefaultAsync();
            }

            var reports = await context.WaterReports
                          .Where(x => x.FlatId == FlatId)
                          .Select(x => new ReportModel(x))
                          .ToListAsync();

            Reports.AddRange(reports);

            var userFlats = await context.FlatUsers
                            .Where(x => x.UserId == userId)
                            .Select(x => new SelectListItem {
                Value    = x.FlatId.ToString(),
                Text     = x.Flat.Number.ToString(),
                Selected = x.FlatId == FlatId
            })
                            .ToListAsync();

            UserFlats.AddRange(userFlats);
        }
示例#3
0
        public bool LoginUserCodeField(ForeignKeyFieldDefinition <TModel, int, LoginUser> def)
        {
            IEnumerable <WorkingReport> reports = def.ValidateAdditional?.Invoke(Models, Params);

            if (reports != null && reports.Any())
            {
                Reports.AddRange(reports);
                return(false);
            }
            return(true);
        }
示例#4
0
        public bool CurrencyTolerance(NumberFieldDefinition <TModel, decimal> def)
        {
            IEnumerable <WorkingReport> reports = def.ValidateAdditional?.Invoke(Models, Params);

            if (reports != null && reports.Any())
            {
                Reports.AddRange(reports);
                return(false);
            }
            return(true);
        }
示例#5
0
        public bool AccountNumber(StringFieldDefinition <TModel> def)
        {
            IEnumerable <WorkingReport> reports = def.ValidateAdditional?.Invoke(Models, Params);

            if (reports != null && reports.Any())
            {
                Reports.AddRange(reports);
                return(false);
            }
            return(true);
        }
示例#6
0
        /// <summary>初回パスワード</summary>
        public bool InitialPassword(StringFieldDefinition <TModel> def)
        {
            var reports = def.ValidateAdditional?.Invoke(Models, Params); // -> PB0301.ImportData

            if (reports != null && reports.Any())
            {
                Reports.AddRange(reports);
                return(false);
            }
            return(true);
        }
示例#7
0
        public bool NameForBankBranchMaster(StringFieldDefinition <TModel> def)
        {
            //return true;
            IEnumerable <WorkingReport> reports = def.ValidateAdditional?.Invoke(Models, Params);

            if (reports != null && reports.Any())
            {
                Reports.AddRange(reports);
                return(false);
            }
            return(true);
        }
        private async Task GetReports(string accessToken)
        {
            using (var client = new PowerBIClient(new Uri(AppSettings.ApiUrl), new TokenCredentials(accessToken, "Bearer")))
            {
                var groups = await client.Groups.GetGroupsAsync();

                foreach (var group in groups.Value)
                {
                    var reportsList = await client.Reports.GetReportsInGroupAsync(group.Id);

                    Reports.AddRange(reportsList.Value);
                }
            }
        }
示例#9
0
 public Task WithReports(IEnumerable <TaskReport> reports)
 {
     Reports.AddRange(reports);
     return(this);
 }