示例#1
0
 public ActionResult Add(AddGeneralViewModel view)
 {
     if (view == null)
     {
         return(RedirectToAction("Index", "General"));
     }
     if (view.Type == PublicationType.Book)
     {
         _service.AddBook(view);
     }
     if (view.Type == PublicationType.Brochure)
     {
         _service.AddBrochure(view);
     }
     if (view.Type == PublicationType.Magazine)
     {
         _service.AddMagazine(view);
     }
     return(RedirectToAction("Index", "General"));
 }