Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="character"></param>
        /// <returns></returns>
        private string CalculateAuditHtml(Character character)
        {
            string html = string.Empty;
            CharacterAuditResult audit = new CharacterAuditResult();

            if (audit.DoAudit(character))
            {
                // Now add to the Audit section
                if (audit.IssueCount > 0)
                {
                    html = $"<div class=\"container\"><h1>Character Audit</h1><p class=\"bg-danger text-white col-sm-2\">Issues found: {audit.IssueCount}</p></div><div class=\"container row m-3\">";

                    // Check for missing enchants - 1 weapon enchant and 2 ring enchants
                    if (audit.MissingEnchant)
                    {
                        html += $"<div class=\"card border-danger mb-3 col-sm-3\"><div class=\"card-header\"><h4 class=\"text-danger\">Missing Enchants:</h4></div><div class=\"card-body\"><ul>";

                        foreach (string slot in audit.MissingEnchants)
                        {
                            html += $"<li>{slot}</li>";
                        }

                        html += $"</ul></div></div>";
                    }

                    // Check for missing gems - go through every slot to make sure...
                    if (audit.MissingGem)
                    {
                        html += $"<div class=\"card border-danger mb-3 col-sm-3\"><div class=\"card-header\"><h4 class=\"text-danger\">Missing Gems:</h4></div><div class=\"card-body\"><ul>";

                        foreach (string slot in audit.MissingGems)
                        {
                            html += $"<li>{slot}</li>";
                        }

                        html += $"</ul></div></div>";
                    }

                    // close up the tags
                    html += "</div>";
                }
                else
                {
                    html = $"<div class=\"container\"><h1>Character Audit</h1><p class=\"bg-success text-white col-sm-2\">No Issues Found</p></div>";
                }
            }

            return(html);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult RaidRosterAudit()
        {
            List <CharacterAuditResult> auditRoster = new List <CharacterAuditResult>();
            var chars = db.Characters.Where(s => s.Roster == 2);

            if (chars.Any())
            {
                // Store the Character data

                foreach (Character raider in chars)
                {
                    CharacterAuditResult audit = new CharacterAuditResult();

                    if (audit.DoAudit(raider))
                    {
                        auditRoster.Add(audit);
                    }
                }
            }

            return(View(auditRoster));
        }