protected HttpResponseMessage GetUserIds(params object[] errors)
        {
            Dictionary <string, string[]> userids = UserIDMapper.GetAllUserIds().GroupBy(kvp => kvp.Value).ToDictionary(g => g.Key, g => g.Select(kvp => kvp.Key).ToArray());

            return(Html(
                       Head("Xerox Username to Printer Code mapping"),
                       Body(
                           new XElement("p", new XElement("a", new XAttribute("href", Url.Route("default", new { controller = "Home" })), "Back to Cloud Print Server")),
                           new XElement("dl",
                                        userids.SelectMany(uid => new object[]
            {
                new XElement("dt", "UserID: ", new XElement("a", new XAttribute("href", Url.Route("default", new { controller = "Auditron", userid = uid.Key })), uid.Key)),
                new XElement("dd", "Username(s): ", String.Join(", ", uid.Value))
            })
                                        ),
                           new XElement("form",
                                        new XAttribute("action", Url.Route("default", new { controller = "Auditron" })),
                                        new XAttribute("method", "post"),
                                        new XElement("fieldset",
                                                     new XElement("legend", "Map UserId"),
                                                     new XElement("input", new XAttribute("type", "hidden"), new XAttribute("name", "Action"), new XAttribute("value", "AddUserId")),
                                                     new XElement("p",
                                                                  new XElement("label", new XAttribute("for", "UserId"), "Printer Code:"),
                                                                  new XElement("input", new XAttribute("type", "text"), new XAttribute("name", "UserId"))
                                                                  ),
                                                     new XElement("p",
                                                                  new XElement("label", new XAttribute("for", "Usernames"), "Username(s):"),
                                                                  new XElement("input", new XAttribute("type", "text"), new XAttribute("name", "Usernames"))
                                                                  ),
                                                     new XElement("input", new XAttribute("type", "submit"), new XAttribute("value", "Add Printer Code"))
                                                     )
                                        )
                           )
                       ));
        }
        protected HttpResponseMessage GetUserId(string userid, params object[] errors)
        {
            string[] usernames = UserIDMapper.GetAllUserIds().Where(kvp => kvp.Value == userid).Select(kvp => kvp.Key).ToArray();

            return(Html(
                       Head("Xerox Usernames mapped to Printer Code " + userid),
                       Body(
                           new XElement("p", new XElement("a", new XAttribute("href", Url.Route("default", new { controller = "Auditron" })), "Back to Printer Code list")),
                           new XElement("p", new XElement("a", new XAttribute("href", Url.Route("default", new { controller = "Home" })), "Back to Cloud Print Server")),
                           errors,
                           new XElement("form",
                                        new XAttribute("action", Url.Route("default", new { controller = "Auditron" })),
                                        new XAttribute("method", "post"),
                                        new XElement("input", new XAttribute("type", "hidden"), new XAttribute("name", "Action"), new XAttribute("value", "Delete")),
                                        new XElement("input", new XAttribute("type", "hidden"), new XAttribute("name", "UserId"), new XAttribute("value", userid)),
                                        new XElement("ul",
                                                     usernames.Select(u => new XElement("li",
                                                                                        new XElement("input", new XAttribute("type", "checkbox"), new XAttribute("name", "user_" + u)),
                                                                                        new XElement("label", new XAttribute("for", "user_" + u), u)
                                                                                        ))
                                                     ),
                                        new XElement("input", new XAttribute("type", "submit"), new XAttribute("value", "Delete"))
                                        ),
                           new XElement("form",
                                        new XAttribute("action", Url.Route("default", new { controller = "Auditron" })),
                                        new XAttribute("method", "post"),
                                        new XElement("fieldset",
                                                     new XElement("legend", "Add Users to Printer Code"),
                                                     new XElement("input", new XAttribute("type", "hidden"), new XAttribute("name", "Action"), new XAttribute("value", "AddUser")),
                                                     new XElement("input", new XAttribute("type", "hidden"), new XAttribute("name", "UserId"), new XAttribute("value", userid)),
                                                     new XElement("label", new XAttribute("for", "Usernames"), "Username(s):"),
                                                     new XElement("input", new XAttribute("type", "text"), new XAttribute("name", "Usernames")),
                                                     new XElement("input", new XAttribute("type", "submit"), new XAttribute("value", "Add Username(s)"))
                                                     )
                                        )
                           )
                       ));
        }