Exemplo n.º 1
0
 public ActionResult CreateEditItemPackage(ItemPack model, string Action = "")
 {
     if (ModelState.IsValid)
     {
         if (Action.Equals("Edit"))
         {
             if (itemService.EditPackage(model.EntityItemPackage))
             {
                 ModelState.Clear();
                 model.EntityItemPackage = new ItemPackage();
             }
         }
         else
         {
             model.EntityItemPackage.Id = Guid.NewGuid();
             if (itemService.AddPackage(model.EntityItemPackage))
             {
                 ModelState.Clear();
                 model.EntityItemPackage = new ItemPackage();
             }
         }
     }
     return(RedirectToAction("ListView"));
 }