Пример #1
0
 public ActionResult view(int id)
 {
     Models.Item it = new Models.Item();
     Models.Comment cm = new Models.Comment();
     ViewData["Message"] = it.getItem(id);
     ViewData["Comments"] = cm.getComment(id);
     return View("Item");
 }
Пример #2
0
 //вывод отдельно взятого товара
 public String getItem(int id)
 {
     try
     {
         if (id == null) return "";
         Models.Item it = new Models.Item();
         Models.Comment cm = new Models.Comment();
         String result = it.getItem(id);
         result = result + "<br>" + cm.getComment(id);
         return result;
     }
     catch
     {
         return "Товар не найден!";
     }
 }