private bool CheckFrequentForWords()
        {
            var map = new Dictionary <string, int>();

            for (var i = 0; i < User.Password.Length - 1; i++)
            {
                var builder = new StringBuilder();
                for (var j = i; j < User.Password.Length; j++)
                {
                    builder.Append(User.Password[j]);
                    var str = builder.ToString();
                    if (!map.ContainsKey(str))
                    {
                        map.Add(str, 1);
                    }
                    else
                    {
                        map[str]++;
                        if ((str.Length <= 2 || map[str] <= 1) && (str.Length <= 0 || map[str] <= 3))
                        {
                            continue;
                        }
                        Reports.Add($"{str} is repeated {map[str]} times in the passwords");
                        return(false);
                    }
                }
            }

            return(true);
        }
Пример #2
0
        private CancellationTokenSource _cancellation = new CancellationTokenSource(); // cancellation option

        #region Ctor

        public VM()
        {
            Cancel    = new CancellationCommand(_cancellation); // let the
            _progress = new Progress <string>(data => Reports.Add(data));

            Task fireForget = GetMergeAsync(2000);
        }
Пример #3
0
        public void RegisterAnalyzer(ISharperCryptoApiAnalysisAnalyzer analyzer)
        {
            var index = Analyzers.IndexOf(analyzer);

            if (index < 0)
            {
                ThreadHelper.Generic.BeginInvoke(() => Analyzers.Add(analyzer));
            }
            else
            {
                ThreadHelper.Generic.BeginInvoke(() => Analyzers[index] = analyzer);
            }

            if (Settings.MutedAnalyzers.Contains((int)analyzer.AnalyzerId))
            {
                analyzer.IsMuted = true;
            }

            foreach (var report in analyzer.SupportedReports)
            {
                if (report.Equals(AnalysisReport.EmptyReport))
                {
                    continue;
                }
                ThreadHelper.Generic.BeginInvoke(() => Reports.Add(report));
            }
        }
Пример #4
0
        private async void SearchAsync()
        {
            var filter = Criteria.BuildCriteria();

            if (filter != null)
            {
                using (IUnitOfWork unit = new UnitOfWork())
                {
                    var result = unit.Contracts.Query(filter)
                                 .OrderBy
                                 (
                        cont => cont.PropertyNo
                                 )
                                 .ThenBy
                                 (
                        cont => cont.ContractNo
                                 );

                    await TransformContracts(result);
                }
                var sums = new ContractsReport(
                    "الإجمالي", AgreedRentSum, RentDueSum, MaintDueSum, DepositDueSum, RentPaidSum, MaintPaidSum,
                    DepositPaidSum, BalanceSum);
                Reports.Add(sums);
            }
        }
Пример #5
0
        public override void LoadSave(object obj)
        {
            SecretaryServiceSave save = obj as SecretaryServiceSave;

            if (save != null)
            {
                if (save.reports == null)
                {
                    save.reports = new List <ReportInfoSave>();
                }
                if (save.secretaries == null)
                {
                    save.secretaries = new List <SecretaryInfoSave>();
                }

                Reports.Clear();
                save.reports.ForEach(reportSave => Reports.Add(reportSave.managerId, new ReportInfo(reportSave)));
                Secretaries.Clear();
                save.secretaries.ForEach(secSave => Secretaries.Add(secSave.generatorId, new SecretaryInfo(secSave)));
                HandledViewReportsCount = save.handledViewReportsCount;
                IsLoaded = true;
            }
            else
            {
                LoadDefaults();
            }
        }
Пример #6
0
        protected override void runDifficultyCheck()
        {
            //HP
            if (Math.Round(map.DifficultyHpDrainRate) < 4 && Difficulty < BeatmapDifficulty.Hard)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_EasyHpBelow4)));
            }
            else if (Math.Round(map.DifficultyHpDrainRate) < 7 && Difficulty >= BeatmapDifficulty.Hard)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_HardHpBelow7)));
            }

            //OD
            double holdRate = map.countSlider * 1.0 / map.ObjectCount;

            if (holdRate < 0.05 && Math.Round(map.DifficultyOverall) < 8)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_VeryLowSliderOdBelow8)));
            }
            else if (holdRate < 0.25 && Math.Round(map.DifficultyOverall) < 7)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_LowSliderOdBelow7)));
            }
            else if (Math.Round(map.DifficultyOverall) < 5)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_OdBelow5)));
            }
        }
Пример #7
0
        public Usage GetCurrentUsage()
        {
            var date = DateTime.UtcNow.Date;

            if (currentUsage == null)
            {
                currentUsage = Reports.FirstOrDefault(usage => usage.Date == date);
            }

            if (currentUsage?.Date == date)
            {
                // update any fields that might be missing, if we've changed the format
                if (currentUsage.Guid != Guid)
                {
                    currentUsage.Guid = Guid;
                }
            }
            else
            {
                currentUsage = new Usage {
                    Date = date, Guid = Guid
                };
                Reports.Add(currentUsage);
            }

            return(currentUsage);
        }
Пример #8
0
 public Reports GetReports(string configuration_id)
 {
     try
     {
         Reports reports = new Reports();
         string  query   = $"select * from dsto_training where configuration_id='{configuration_id}'";
         var     table   = DbInfo.ExecuteSelectQuery(query);
         if (table.Rows.Count > 0)
         {
             foreach (DataRow row in table.Rows)
             {
                 Report report = reports.Add();
                 report.Training = new Trainings().Add();
                 InitTraining(report.Training, row);
                 report.Training.Trainers = new TrainerProvider(DbInfo).GetTrainers(report.Training.Key);
                 report.Training.Trainees = new TraineeProvider(DbInfo).GetRegisteredTrainees(report.Training.Key);
                 report.Training.Topics   = new TopicProvider(DbInfo).GetTopics(report.Training.Key);
             }
         }
         return(reports);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #9
0
        public Usage GetCurrentUsage(string appVersion, string unityVersion, string instanceId)
        {
            Guard.ArgumentNotNullOrWhiteSpace(appVersion, "appVersion");
            Guard.ArgumentNotNullOrWhiteSpace(unityVersion, "unityVersion");

            var now = DateTimeOffset.Now;

            if (currentUsage == null)
            {
                currentUsage = Reports
                               .FirstOrDefault(usage => usage.InstanceId == instanceId);
            }

            if (currentUsage == null)
            {
                currentUsage = new Usage
                {
                    InstanceId = instanceId,
                    Dimensions =
                    {
                        Date         = now,
                        Guid         = Guid,
                        AppVersion   = appVersion,
                        UnityVersion = unityVersion,
                        Lang         = CultureInfo.InstalledUICulture.IetfLanguageTag,
                        CurrentLang  = CultureInfo.CurrentCulture.IetfLanguageTag
                    }
                };
                Reports.Add(currentUsage);
            }

            return(currentUsage);
        }
Пример #10
0
        private void checkFiles()
        {
            DirectoryInfo di = new DirectoryInfo(BeatmapManager.Current.ContainingFolderAbsolute);

            FileInfo[] files     = di.GetFiles(@"*", SearchOption.AllDirectories);
            long       totalSize = 0;
            bool       hasVideo  = false;

            foreach (FileInfo fi in files)
            {
                totalSize += fi.Length;
                if (!hasVideo)
                {
                    hasVideo = GeneralHelper.GetFileType(fi.Name) == FileType.Video;
                }
            }
            totalSize /= 1024; //Kb
            if (!hasVideo && totalSize > 10 * 1024)
            {
                Reports.Add(new AiReport(Severity.Warning, LocalisationManager.GetString(OsuString.AIMapset_LargeFilesize)));
            }
            else if (hasVideo && totalSize > 24 * 1024)
            {
                Reports.Add(new AiReport(Severity.Warning, LocalisationManager.GetString(OsuString.AIMapset_LargeFilesizeVideo)));
            }
        }
Пример #11
0
        public void OnExecutionReport(ExecutionReport report)
        {
            Status = report.OrdStatus;
            if (report.ExecType == ExecType.ExecTrade)
            {
                AvgPx = (AvgPx * CumQty + report.LastPx * report.LastQty) / (CumQty + report.LastQty);
            }

            CumQty    = report.CumQty;
            LeavesQty = report.LeavesQty;

            if (report.ExecType == ExecType.ExecNew)
            {
                ProviderOrderId = report.ProviderOrderId;
            }

            if (report.ExecType == ExecType.ExecReplace)
            {
                Type   = report.OrdType;
                Price  = report.Price;
                StopPx = report.StopPx;
                Qty    = report.OrdQty;
            }

            Reports.Add(report);
            Messages.Add(report);
        }
Пример #12
0
        /// <summary>
        /// Add or replace Report Info
        /// If exists, replace existing item with fresh object.
        /// If new, create one and add to the list.
        /// Replace should not come to play, but if neeeded here it is
        /// </summary>
        /// <param name="reportPath">Report to add to list</param>
        public void AddOrReplaceReport(string reportPath)
        {
            RndReportInfo repInfo = new RndReportInfo(reportPath, false, false);

            lock (objectlock)
            {
                if (Reports.Contains(reportPath))
                {
                    if (ReportsInfo.ContainsKey(reportPath))
                    {
                        ReportsInfo[repInfo.ItemPath] = repInfo;
                    }
                }
                else
                {
                    Reports.Add(reportPath);
                    if (ReportsInfo.ContainsKey(reportPath))
                    {
                        ReportsInfo[repInfo.ItemPath] = repInfo;
                    }
                    else
                    {
                        ReportsInfo.Add(reportPath, repInfo);
                    }
                }
            }
        }
Пример #13
0
        /// <summary>
        /// Check that uninherited timing points match between two given beatmaps.
        /// </summary>
        private void checkTimingPoints(Beatmap origin, Beatmap diff)
        {
            if (origin.AudioFilename != diff.AudioFilename)
            {
                return;
            }

            List <ControlPoint> timingPointsOrigin   = origin.TimingPoints;
            List <ControlPoint> timingPointsCompared = diff.TimingPoints;

            bool timingPointsMatch = timingPointsOrigin.Count == timingPointsCompared.Count;

            if (timingPointsMatch)
            {
                ControlPoint tp, tp2;
                for (int i = 0; i < timingPointsOrigin.Count; i++)
                {
                    tp  = timingPointsOrigin[i];
                    tp2 = timingPointsCompared[i];

                    if ((int)tp.Offset != (int)tp2.Offset || tp.BeatLength != tp2.BeatLength)
                    {
                        timingPointsMatch = false;
                        break;
                    }
                }
            }

            if (!timingPointsMatch)
            {
                Reports.Add(new AiReport(Severity.Warning, "Uninherited timing points conflict with " + diff.Version + " diff."));
            }
        }
Пример #14
0
        /// <summary>
        ///     Method called from the view. Generate a report from a set of selected configurations once
        ///     all conditions are fulfilled.
        /// </summary>
        public void MakeReport()
        {
            Task.Run(() =>
            {
                StartLongOperation();
                // Execute the Query
                string batchFilename = LoadedBatch;

                LoadedBatch = "Running query";
                Query.Execute(LoggedExperiments, OnExperimentalUnitProcessed);

                // Display the reports
                foreach (Report report in Query.Reports)
                {
                    ReportViewModel newReport = new ReportViewModel(Query, report);
                    Reports.Add(newReport);
                }
                if (Reports.Count > 0)
                {
                    SelectedReport = Reports[0];
                    CanSaveReports = true;
                }
                LoadedBatch = batchFilename;
                EndLongOperation();
            });
        }
Пример #15
0
 public void AddReport(ReportViewModel report)
 {
     if (!Reports.Contains(report))
     {
         Reports.Add(report);
     }
 }
Пример #16
0
        public Report AddReport(ReportType type)
        {
            var report = new Report(this, type);

            Reports.Add(report);
            return(report);
        }
Пример #17
0
        public Reports GetReports(string response_id)
        {
            try
            {
                Reports reports = new Reports();
                string  query   = $"select dsto_questionaire.guid as questionaire_guid, dsto_questionaire.oid as questionaire_oid, dsto_purchase.* from dsto_questionaire inner join dsto_purchase on dsto_questionaire.guid = dsto_purchase.farmerid where dsto_questionaire.yref_template='{response_id}'";
                var     table   = DbInfo.ExecuteSelectQuery(query);
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        Report report = reports.Add();
                        report.Questionaire      = new Questionaire(null);
                        report.Questionaire.Key  = row["questionaire_guid"].ToString();
                        report.Questionaire.OID  = int.Parse(row["questionaire_oid"].ToString());
                        report.Questionaire.Name = new SectionProvider(DbInfo).QuestionaireIdentification(response_id, report.Questionaire.Key);

                        report.Purchase = new Purchase();
                        InitPurchases(report.Purchase, row);
                    }
                }
                return(reports);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #18
0
        protected void btnAdd_Click(Object Sender, EventArgs e)
        {
            int intItem = Int32.Parse(Request.Form[hdnParent.UniqueID]);

            if (Request.Form[hdnId.UniqueID] == "0")
            {
                oReport.Add(txtTitle.Text, (chkOld.Checked ? 1 : 0), txtPath.Text, txtPhysical.Text, txtDesc.Text, txtAbout.Text, txtImage.Text, Int32.Parse(Request.Form[hdnParent.UniqueID]), Int32.Parse(txtPercent.Text), Int32.Parse(ddlToggle.SelectedItem.Value), (chkApplication.Checked ? 1 : 0), 0, (chkEnabled.Checked ? 1 : 0));
            }
            else
            {
                oReport.Update(Int32.Parse(Request.Form[hdnId.UniqueID]), txtTitle.Text, (chkOld.Checked ? 1 : 0), txtPath.Text, txtPhysical.Text, txtDesc.Text, txtAbout.Text, txtImage.Text, Int32.Parse(Request.Form[hdnParent.UniqueID]), Int32.Parse(txtPercent.Text), Int32.Parse(ddlToggle.SelectedItem.Value), (chkApplication.Checked ? 1 : 0), (chkEnabled.Checked ? 1 : 0));
            }
            if (Request.Form[hdnOrder.UniqueID] != "")
            {
                string strOrder = Request.Form[hdnOrder.UniqueID];
                int    intCount = 0;
                while (strOrder != "")
                {
                    intCount++;
                    int intId = Int32.Parse(strOrder.Substring(0, strOrder.IndexOf("&")));
                    strOrder = strOrder.Substring(strOrder.IndexOf("&") + 1);
                    oReport.Update(intId, intCount);
                }
            }
            Response.Redirect(Request.Path);
        }
Пример #19
0
 public ReportInfo GetReportInfo(int managerId)
 {
     if (!Reports.ContainsKey(managerId))
     {
         Reports.Add(managerId, new ReportInfo(managerId));
     }
     return(Reports[managerId]);
 }
Пример #20
0
        /// <summary>
        /// Opens a new report.
        /// </summary>
        public int Open(IUser user, OverloadNode overload, ReportBody info, ReportTag tag)
        {
            Reports.Add(new Report(CaseCount, overload, user, info, tag));
            int id = CaseCount;

            CaseCount++;
            return(id);
        }
Пример #21
0
        protected override void DoRequest()
        {
            ec.Current.Set(Service);
            var report = new PaymentsOfServiceReportViewModel(FromDate, ToDate);

            Reports.Clear();
            Reports.Add(report);
            Avg = (double)report.Items.Cast <Payment>().Average(p => p.Amount);
        }
Пример #22
0
        public WorkItem Start(UserProfile assignee, string userFullName)
        {
            //Create audit record
            var msg   = $"{userFullName} started submission";
            var audit = new SubmissionAudit(Id, msg);

            SubmissionAudits.Add(audit);

            //Change state
            StartDate       = DateTime.Now;
            SubmissionState = SubmissionState.AssignedForGeneration;
            CurrentAssignee = assignee;
            LastUpdated     = DateTime.Now;

            //Create report
            Report report;

            if (CurrentReportId != null)
            {
                report = Reports.FirstOrDefault(x => x.Id == CurrentReportId);
                report.CurrentDocumentVersion += 1;
            }
            else
            {
                report = new Report()
                {
                    SubmissionId           = Id,
                    DataYear               = DataYear,
                    ReportState            = ReportState.AssignedForGeneration,
                    CurrentDocumentVersion = 1
                };
                Reports.Add(report);
            }


            //Create work item
            var workItem = new WorkItem()
            {
                WorkItemAction = WorkItemAction.Generate,
                WorkItemState  = WorkItemState.NotStarted,
                AssignedDate   = DateTime.Now,
                AssignedUser   = assignee,
                Report         = report
            };

            report.WorkItems.Add(workItem);

            //Create Audit record
            var currentVersion = report.CurrentDocumentVersion ?? 1;
            var newWorkMessage = $"{assignee.FullName} was assigned {workItem.WorkItemAction.GetDescription()} task for document version #{currentVersion}";
            var newAudit       = new SubmissionAudit(Id, newWorkMessage);

            SubmissionAudits.Add(newAudit);

            return(workItem);
        }
Пример #23
0
        public void LogReport(Report report)
        {
            if (Reports.Any(x => x.Id == report.Id))
            {
                return;
            }

            Reports.Add(report);
            CaseIncrement += 1;
        }
        public ScientistAddsReportViewModel(ScientistModel selectedScientsist)
        {
            SelectedScientist = selectedScientsist;
            List <Report> reports = ReportService.GetReports();

            foreach (Report r in reports)
            {
                Reports.Add(new ReportModel(r));
            }
        }
        void ParseDataMain(MainItemTag tag, uint value, out LocalIndexes indexes)
        {
            ReportSegment segment = new ReportSegment();

            segment.Flags        = (DataMainItemFlags)value;
            segment.Parent       = CurrentCollection;
            segment.ElementCount = (int)GetGlobalItemValue(GlobalItemTag.ReportCount);
            segment.ElementSize  = (int)GetGlobalItemValue(GlobalItemTag.ReportSize);
            segment.Unit         = new Units.Unit(GetGlobalItemValue(GlobalItemTag.Unit));
            segment.UnitExponent = Units.Unit.DecodeExponent(GetGlobalItemValue(GlobalItemTag.UnitExponent));
            indexes = segment.Indexes;

            EncodedItem logicalMinItem = GetGlobalItem(GlobalItemTag.LogicalMinimum);
            EncodedItem logicalMaxItem = GetGlobalItem(GlobalItemTag.LogicalMaximum);

            segment.LogicalIsSigned =
                (logicalMinItem != null && logicalMinItem.DataValueMayBeNegative) ||
                (logicalMaxItem != null && logicalMaxItem.DataValueMayBeNegative);
            int logicalMinimum  = logicalMinItem == null ? 0 : segment.LogicalIsSigned ? logicalMinItem.DataValueSigned : (int)logicalMinItem.DataValue;
            int logicalMaximum  = logicalMaxItem == null ? 0 : segment.LogicalIsSigned ? logicalMaxItem.DataValueSigned : (int)logicalMaxItem.DataValue;
            int physicalMinimum = (int)GetGlobalItemValue(GlobalItemTag.PhysicalMinimum);
            int physicalMaximum = (int)GetGlobalItemValue(GlobalItemTag.PhysicalMaximum);

            if (!IsGlobalItemSet(GlobalItemTag.PhysicalMinimum) ||
                !IsGlobalItemSet(GlobalItemTag.PhysicalMaximum) ||
                (physicalMinimum == 0 && physicalMaximum == 0))
            {
                physicalMinimum = logicalMinimum;
                physicalMaximum = logicalMaximum;
            }

            segment.LogicalMinimum  = logicalMinimum;
            segment.LogicalMaximum  = logicalMaximum;
            segment.PhysicalMinimum = physicalMinimum;
            segment.PhysicalMaximum = physicalMaximum;

            Report     report;
            ReportType reportType
                = tag == MainItemTag.Output ? ReportType.Output
                : tag == MainItemTag.Feature ? ReportType.Feature
                : ReportType.Input;
            uint reportID = GetGlobalItemValue(GlobalItemTag.ReportID);

            if (!TryGetReport(reportType, (byte)reportID, out report))
            {
                report = new Report()
                {
                    ID   = (byte)reportID,
                    Type = reportType
                };
                Reports.Add(report);
            }
            segment.Report = report;
        }
        public ConferenceAddsReportViewModel(Window window, ConferenceModel selectedConference)
        {
            Window = window;
            List <Report> reports = ConferenceService.GetReports(selectedConference.Conference);

            foreach (Report r in reports)
            {
                Reports.Add(new ReportModel(r));
            }
            SelectedConference = selectedConference;
        }
Пример #27
0
 private void UpdateReports(List <ArchiveReport> reports)
 {
     Reports.Clear();
     if (reports != null && reports.Count > 0)
     {
         foreach (ArchiveReport report in reports)
         {
             Reports.Add(report);
         }
     }
 }
        private bool NotContainsEmailOrUserName()
        {
            var r = !User.Password.Contains(User.Email) &&
                    !User.Password.Contains(User.Name);

            if (!r)
            {
                Reports.Add("Password should not contains a user Name or Password!");
            }
            return(r);
        }
        protected override void DoRequest()
        {
            ec.Current.Set(Registration);

            var paymentsReport = new PaymentsInRegistrationReportViewModel(FromDate, ToDate);
            var readingsReport = new ReadingsInRegistrationReportViewModel(FromDate, ToDate);

            Reports.Clear();
            Reports.Add(paymentsReport);
            Reports.Add(readingsReport);
            Sum = (double)paymentsReport.Items.Cast <Payment>().Sum(p => p.Amount);
        }
Пример #30
0
        public void updateReportsAndPushPins(Report item)
        {
            Pushpin  pin          = new Pushpin();
            Location tempLocation = new Location();

            Reports.Add(item);
            tempLocation.Latitude  = item.Latitude;
            tempLocation.Longitude = item.Longitude;
            pin.Location           = tempLocation;
            pin.Background         = new SolidColorBrush(ToMediaColor(System.Drawing.Color.FromName("Blue")));
            pushpins.Add(pin);
        }