Beispiel #1
0
        private void fillPerson(string caption, Person who, bool inclMarr = false)
        {
            StringBuilder sb = DrawTo;

            // Name-full Occupation
            // Born Place
            // Opt: Christened Place
            // inclMarr: Married Place
            // inclMarr: Divorced Place
            // Died Place
            // Opt: Buried Place
            // Parent Parent
            // Other spouses?
            sb.AppendLine("<table class=\"tg\">");
            sb.AppendFormat("<caption class=\"tt\">{0}</caption>", caption);
            if (who == null)
            {
                sb.AppendLine("<tr><td>None</td></tr>");
            }
            else
            {
                sb.AppendLine("<tr>");
                sb.AppendFormat("<td class=\"tg-b7b8\";>{2}</td><td class=\"tg-b7b8\";>{0}</td><th class=\"tg-9hboPH\";>Occupation</th><td class=\"tg-b7b8\";>{1}</td>", HtmlText(who.Name), HtmlText(who.GetWhat("OCCU")), HtmlText(who.Id)).AppendLine();
                sb.AppendLine("</tr>");
                sb.AppendLine("<tr>");
                sb.AppendFormat("<th class=\"tg-9hboPH\";>Born</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Place</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(who.GetDate("BIRT")), HtmlText(who.GetPlace("BIRT"))).AppendLine();
                sb.AppendLine("</tr>");
                if (inclMarr)
                {
                    sb.AppendLine("<tr>");
                    sb.AppendFormat("<th class=\"tg-9hboPH\";>Married</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Place</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(_family.GetDate("MARR")), HtmlText(_family.GetPlace("MARR"))).AppendLine();
                    sb.AppendLine("</tr>");
                }
                sb.AppendLine("<tr>");
                sb.AppendFormat("<th class=\"tg-9hboPH\";>Died</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Place</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(who.GetDate("DEAT")), HtmlText(who.GetPlace("DEAT"))).AppendLine();
                sb.AppendLine("</tr>");
                sb.AppendLine("<tr>");
                sb.AppendFormat("<th class=\"tg-9hboPH\";>Parent</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Parent</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(who.GetParent(true)), HtmlText(who.GetParent(false))).AppendLine();
                sb.AppendLine("</tr>");
            }
            sb.AppendLine("</table>");
        }
Beispiel #2
0
        private void fillPerson(bool showUrl, string caption, Person who, bool inclMarr = false)
        {
            StringBuilder sb = DrawTo;

            // Name-full Occupation
            // Born Place
            // Opt: Christened Place
            // inclMarr: Married Place
            // inclMarr: Divorced Place
            // Died Place
            // Opt: Buried Place
            // Parent Parent
            // Other spouses?
            sb.AppendLine("<table class=\"tg\">");
            sb.AppendFormat("<caption class=\"tt\">{0}</caption>", caption);
            if (who == null)
            {
                sb.AppendLine("<tr><td>None</td></tr>");
            }
            else
            {
                sb.AppendLine("<tr>");

                string occu;
                string flag = inclMarr ? "P" : "S";
                if (showUrl)
                {
                    occu = "<a href='' onclick='window.external.doEdit(\"" + flag + "-OCCU\")'>Occupation</a>";
                }
                else
                {
                    occu = "Occupation";
                }
                string occuId = flag + "-OCCU";

                string occuView;
                if (EditElem == occuId)
                {
                    occuView = "<input type=\"text\" value=\"" + HtmlText(who.GetWhat("OCCU")) + "\" />";
                }
                else
                {
                    occuView = HtmlText(who.GetWhat("OCCU"));
                }

                sb.AppendFormat("<td class=\"tg-b7b8\";>{2}</td><td class=\"tg-b7b8\";>{0}</td><th class=\"tg-9hboPH\";>{3}</th><td id=\"{4}\" class=\"tg-b7b8\";>{1}</td>", HtmlText(who.Name), occuView, HtmlText(who.Id), occu, occuId).AppendLine();
                sb.AppendLine("</tr>");
                sb.AppendLine("<tr>");
                sb.AppendFormat("<th class=\"tg-9hboPH\";>Born</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Place</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(who.GetDate("BIRT")), HtmlText(who.GetPlace("BIRT"))).AppendLine();
                sb.AppendLine("</tr>");
                if (inclMarr)
                {
                    sb.AppendLine("<tr>");
                    sb.AppendFormat("<th class=\"tg-9hboPH\";>Married</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Place</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(_family.GetDate("MARR")), HtmlText(_family.GetPlace("MARR"))).AppendLine();
                    sb.AppendLine("</tr>");
                }
                sb.AppendLine("<tr>");
                sb.AppendFormat("<th class=\"tg-9hboPH\";>Died</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Place</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(who.GetDate("DEAT")), HtmlText(who.GetPlace("DEAT"))).AppendLine();
                sb.AppendLine("</tr>");
                sb.AppendLine("<tr>");
                sb.AppendFormat("<th class=\"tg-9hboPH\";>Parent</th><td class=\"tg-b7b8PD\";>{0}</td><th class=\"tg-9hboPH\";>Parent</th><td class=\"tg-b7b8PD\";>{1}</td>", HtmlText(who.GetParent(true)), HtmlText(who.GetParent(false))).AppendLine();
                sb.AppendLine("</tr>");
            }
            sb.AppendLine("</table>");
        }