private MyAbstractViewModel GetMyAbstract() { MyAbstractViewModel model = new MyAbstractViewModel(); model.AbstractDictionary = new Dictionary <AbstractModel, List <AbstractModel> >(); AbstractManager manager = new AbstractManager(); List <AbstractModel> list = manager.GetMyList(User.Identity.Name); int i = int.MaxValue; AbstractModel temp = null; foreach (AbstractModel item in list) { if (i > item.GroupId) { model.AbstractDictionary.Add(item, new List <AbstractModel>()); temp = item; i = item.GroupId; } else { model.AbstractDictionary[temp].Add(item); } } return(model); }
public ActionResult MyAbstract() { ViewBag.AlertType = TempData["AlertType"]; ViewBag.AlertContent = TempData["AlertContent"]; MyAbstractViewModel model = GetMyAbstract(); return(View(model)); }
public void MakeChildObject(MyAbstractViewModel vm, MyAbstractObject child) { child.Id = vm.Id; child.Name = vm.Name; }