Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. [AuthLog(Roles="Registered Users, Administrators")]
  2. public ActionResult Index(int? id, Shirt shirt)
  3. {
  4. var result = (from s in db.Shirts where s.SiteActive == true select s).ToList();
  5. id = (from s in result select s.Id).First();
  6. var sCount = result.Count();
  7. ViewBag.TabTitle = null;
  8. ViewBag.ShirtSizeId = new SelectList(db.ShirtSizes, "Id", "Name");
  9. ViewBag.ShirtQuantityId = new SelectList(db.ShirtQuantities, "Id", "Name");
  10. if (sCount >= 1)
  11. {
  12. shirt = db.Shirts.Include(s => s.Files).SingleOrDefault(s => s.Id == id);
  13. var TabTitle = (from s in result select s.TabName).First();
  14. var TabContent = (from s in result select s.Caption).First();
  15. var TabPrice = (from s in result select s.Price).First();
  16. ViewBag.TabTitle = TabTitle;
  17. ViewBag.TabContent = TabContent;
  18. ViewBag.TabPrice = TabPrice;
  19. }
  20.  
  21. return View(shirt);
  22. }
  23.  
  24. @model TShirtEmpAdmin.Models.Shirt
  25.  
  26. public class ShirtOrderViewModel
  27. {
  28. public virtual<Shirt> Shirts { get; set; }
  29. public virtual<Order> Orders { get; set; }
  30. }
  31.  
  32. public class OrderViewModel
  33. {
  34. public Order Order { get; set; }
  35. public List<Item> items{ get; set; }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement