public ActionResult Create(Group g) { var result = new Biz.GroupBiz().Create(g); if (result.Succeed) { return(RedirectToAction("Manage")); } return(View(g)); }
public ActionResult Index() { List <Product> Products = new Biz.ProductBiz().GetAll(); var GameApps = new Biz.GroupBiz().GetAll().Where(x => x.Type == AppStore.Models.TypeGroup.Game).SelectMany(p => p.Products).ToList(); var NewApps = Products.OrderByDescending(x => x.DateTime).Take(20).ToList(); HomeProducts result = new HomeProducts() { Games = GameApps, NewApps = NewApps, }; var Downloads = new Biz.DownloadBiz().GetAll(); var mostDownload = (from t in Downloads group t by t.Product.Id into g select new { ProductId = g.Key, Count = g.Count() }).OrderByDescending(x => x.Count) .Select(x => x.ProductId) .Take(20) .ToList(); result.MostDownloaded = Products.Where(x => mostDownload.Contains(x.Id)).ToList(); return(View(result)); }
// Post: api/GroupData/5 public OperationResult Post([FromBody] Group model) { var result = new Biz.GroupBiz().Create(model); return(result); }
public ActionResult Get(int id) { var sampleGroup = new Biz.GroupBiz().Get(id); return(View("Details", sampleGroup)); }