Пример #1
0
        public ActionResult Index()
        {
            string table = "";

            List <Resident> l = _residentRepository.GetResidentsInfos();

            if (l.Count() < 1)
            {
                return(View());
            }
            else
            {
                foreach (var x in l)
                {
                    table +=
                        "<tr>" +
                        "<td>" +
                        x.Name +
                        "</td>" +
                        "<td>" +
                        x.Type +
                        "</td>" +
                        "<td>" +
                        x.From +
                        "</td>" +
                        "<td>" +
                        x.To +
                        "</td>" +
                        "<td>" +
                        x.OwnerEmail +
                        "</td>" +
                        "<td>" +
                        x.Desc +
                        "</td>" +
                        "<td>" +
                        "<button type=\"submit\" class=\"btn bg-mainGreen text-center text-white m-0\" name=\"animal\" value=\"send" + x.Id + "\">Send</button>" +
                        "</td>" +
                        "<td>" +
                        "<button type=\"submit\" class=\"btn bg-mainGreen text-center text-white m-0\" name=\"animal\" value=\"" + x.Id + "\">Delete</button>" +
                        "</td>" +
                        "</tr>";
                }
            }

            ViewData["table"] = table;

            return(View());
        }