Exemple #1
0
        public FirearmLicenseReporter(string applicant,
                                      bool formB,
                                      DateTime lastCrime,
                                      IEnumerable <object> rejections)
            : base(APPROVED, FLDApproved,
                   BKGNDCHK, FLDBkgndChk,
                   ISONHOLD, FLDIsOnHold,
                   REJECTED, FLDRejected)
        {
            Contract.Requires(rejections != null);
            var worst   = (int)RejectionState.NONE;
            var reasons = new StringBuilder();

            foreach (IRejection rej in rejections)
            {
                worst = Math.Max((int)rej.Type, worst);
                reasons.AppendLine("[*]" + rej.Code + " - " + rej.Reason);
            }
            switch ((RejectionState)worst)
            {
            case RejectionState.NONE:
                parser = DoParser(formB ? BKGNDCHK : APPROVED);
                break;

            case RejectionState.AMENDIT:
                parser = DoParser(ISONHOLD);
                var expiry = DateTime.UtcNow.AddHours(48);
                parser.SetValue("date", expiry.ToString("dd/MM/yyyy HH:mm UTC", enUS));
                break;

            case RejectionState.REAPPLY:
                parser = DoParser(REJECTED);
                expiry = DateTime.Now.AddHours(72).ToUniversalTime();
                parser.SetValue("reapply", retryMsg.Replace("DATE", expiry.ToString("dd/MM/yyyy HH:mm UTC", enUS)));
                break;

            case RejectionState.TMPCRIM:
                parser = DoParser(REJECTED);
                expiry = lastCrime.AddMonths(3);
                parser.SetValue("reapply", tempCrim.Replace("DATE", expiry.ToString("dd/MM/yyyy HH:mm UTC", enUS)));
                break;

            case RejectionState.FOREVER:
                parser = DoParser(REJECTED);
                expiry = DateTime.Now.AddHours(72).ToUniversalTime();
                parser.SetValue("reapply", bannedMsg.Replace("DATE", expiry.ToString("dd/MM/yyyy HH:mm UTC", enUS)));;
                break;
            }
            parser.SetValue("reasons", reasons.ToString());
            parser.SetValue("applicant", applicant);
            parser.SetValue("officerSig", parser.GetPrefill("officerSig"));
            parser.SetValue("officers", parser.GetPrefill("officers"));
        }
Exemple #2
0
 public ImpoundReleaseReporter(string vehOwner,
                               string phoneNum,
                               string license,
                               string vehModel,
                               string vehColor,
                               DateTime impoundDate,
                               string impOfficer,
                               string fee) : base(TEMPLATE, ImpoundRelease)
 {
     Contract.Requires(fee != null);
     using (var file = File.OpenRead(TEMPLATE))
         parser = new ReportTemplateParser(file);
     if (fee.Equals("0", StringComparison.Ordinal))
     {
         fee += " (Secure Impound)";
     }
     parser.SetValue("vehOwner", vehOwner);
     parser.SetValue("phoneNum", phoneNum);
     parser.SetValue("license", license);
     parser.SetValue("vehModel", vehModel);
     parser.SetValue("vehColor", vehColor);
     parser.SetValue("impoundDate", impoundDate.ToString("dd/MM/yyyy", enUS));
     parser.SetValue("impOfficer", impOfficer);
     parser.SetValue("fee", "$" + fee);
 }
Exemple #3
0
 public BackgroundCheckReporter(string applicant)
     : base(TEMPLATE, FLDReqBkgndChk)
 {
     using (var f = File.OpenRead(TEMPLATE))
         parser = new ReportTemplateParser(f);
     parser.SetValue("applicant", applicant);
 }
Exemple #4
0
        public ArrestReporter(string suspect,
                              string phone,
                              bool licensesRevoked,
                              string[] officers,
                              string mugshot,
                              IEnumerable <object> crimes,
                              string narrative) : this()
        {
            Contract.Requires(officers != null);
            Contract.Requires(crimes != null);

            parser.SetValue("suspect", suspect);
            parser.SetValue("phone", phone);
            parser.SetValue("licensesRevoked", licensesRevoked ? "Yes" : "No");
            parser.SetValue("narrative", narrative);
            parser.SetValue("mugshot", mugshot);
            string officersStr = "";

            foreach (var officer in officers)
            {
                officersStr += "[*]" + officer + '\n';
            }
            officersStr = officersStr.TrimEnd(new char[] { '\n', '\r' });
            parser.SetValue("officers", officersStr);
            string chargesStr = "";

            foreach (Crime crime in crimes)
            {
                chargesStr += "[*]" + crime.ToString() + '\n';
            }
            chargesStr = chargesStr.TrimEnd(new char[] { '\r', '\n' });
            parser.SetValue("charges", chargesStr);
        }
Exemple #5
0
        public DutyReporter(DateTime start,
                            DateTime end,
                            decimal arrests,
                            decimal citations,
                            string notes) : this()
        {
            parser.SetValue("date", start.ToString("dd/MM/yyyy", enUS));
            var time = end - start;

            parser.SetValue("dutyHours", time.TotalHours.ToString("N2", enUS));
            parser.SetValue("watchStart", start.ToString("hh:mm", enUS));
            parser.SetValue("arrests", arrests.ToString(enUS));
            parser.SetValue("citations", citations.ToString(enUS));
            parser.SetValue("notes", notes);
        }
Exemple #6
0
 public ImpoundReporter(string vehOwner,
                        string phoneNum,
                        string license,
                        string model,
                        string color,
                        string details,
                        DateTime impoundTime,
                        string location,
                        string reason,
                        string officers,
                        string screenshot) : this()
 {
     parser.SetValue("vehOwner", vehOwner);
     parser.SetValue("phoneNum", phoneNum);
     parser.SetValue("license", license);
     parser.SetValue("model", model);
     parser.SetValue("color", color);
     parser.SetValue("details", details);
     parser.SetValue("impoundTime", impoundTime.ToString("dd/MM/yyyy HH:mm", enUS));
     parser.SetValue("location", location);
     parser.SetValue("reason", reason);
     parser.SetValue("officers", officers);
     parser.SetValue("screenshot", screenshot);
 }