示例#1
0
        public string Render()
        {
            string layout  = HtmlProvider.ProvideLayout(this.Model.Email);
            string content = HtmlProvider.ProvideAddGameForm();

            return(string.Format(layout, content));
        }
示例#2
0
        public string Render()
        {
            string        layout = HtmlProvider.ProvideLayout(this.Model.Email);
            StringBuilder view   = new StringBuilder();
            int           count  = 1;

            foreach (SimpleGameViewModel game in this.Model.Games)
            {
                string cssClass = count % 2 == 1 ? "class=\"table-warning\"" : string.Empty;
                view.Append(
                    $"<tr {cssClass}>"
                    + $"<th scope=\"row\">{count}</th>"
                    + $"<td>{game.Title}</td>"
                    + $"<td>{game.Size} GB</td>"
                    + $"<td>{game.Price} &euro;</td>"
                    + "<td>"
                    + $"<a href=\"/games/edit?id={game.Id}\" class=\"btn btn-warning btn-sm\">Edit</a>"
                    + $"<a href=\"/games/delete?id={game.Id}\" class=\"btn btn-danger btn-sm\">Delete</a>"
                    + "</td>");

                count++;
            }

            string content = string.Format(HtmlProvider.ProvideGamesTable(), view);

            return(string.Format(layout, content));
        }