Exemplo n.º 1
0
 public ActionResult CreateSphere(MvcSphere sphere)
 {
     if (ModelState.IsValid)
     {
         spheres.Create(SphereMapper.GetBLLEntity(sphere));
         return(RedirectToRoute("Spheres"));
     }
     return(View());
 }
Exemplo n.º 2
0
 public static BLLSphere GetBLLEntity(MvcSphere sphere)
 {
     return(new BLLSphere()
     {
         Id = sphere.Id,
         Name = sphere.Name,
         Level = sphere.Level,
         CategoryName = sphere.CategoryName
     });
 }
Exemplo n.º 3
0
        public ActionResult EditSphere(int id)
        {
            MvcSphere sphere = SphereMapper.GetMVCEntity(spheres.Get(id));

            IEnumerable <BLLCategory> allCategories = categories.GetAll();
            List <string>             mvcCategories = allCategories.Select(c => c.Name).ToList();

            ViewBag.Categories = mvcCategories;

            return(View(sphere));
        }