Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [AuthLog(Roles="Registered Users, Administrators")]
- public ActionResult Index(int? id, Shirt shirt)
- {
- var result = (from s in db.Shirts where s.SiteActive == true select s).ToList();
- id = (from s in result select s.Id).First();
- var sCount = result.Count();
- ViewBag.TabTitle = null;
- ViewBag.ShirtSizeId = new SelectList(db.ShirtSizes, "Id", "Name");
- ViewBag.ShirtQuantityId = new SelectList(db.ShirtQuantities, "Id", "Name");
- if (sCount >= 1)
- {
- shirt = db.Shirts.Include(s => s.Files).SingleOrDefault(s => s.Id == id);
- var TabTitle = (from s in result select s.TabName).First();
- var TabContent = (from s in result select s.Caption).First();
- var TabPrice = (from s in result select s.Price).First();
- ViewBag.TabTitle = TabTitle;
- ViewBag.TabContent = TabContent;
- ViewBag.TabPrice = TabPrice;
- }
- return View(shirt);
- }
- @model TShirtEmpAdmin.Models.Shirt
- public class ShirtOrderViewModel
- {
- public virtual<Shirt> Shirts { get; set; }
- public virtual<Order> Orders { get; set; }
- }
- public class OrderViewModel
- {
- public Order Order { get; set; }
- public List<Item> items{ get; set; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement