Ejemplo n.º 1
0
 public ActionResult DataAdd([Bind(Include = "MovieName,Genre,Actors")] DataModel model)
 {
     Business.Data data = new Business.Data();
     if (ModelState.IsValid)
     {
         string result;
         if ((result = data.DataAdd(model.MovieName, model.Genre, data.ActorsFromString(model.Actors), User.Identity.Name)) == null)
         {
             return(RedirectToAction("DataList"));
         }
         else
         {
             ViewBag.DuplicateError = result;
             return(View());
         }
     }
     else
     {
         return(View());
     }
 }
Ejemplo n.º 2
0
 public ActionResult DataEdit(DataModel model)
 {
     Business.Data data = new Business.Data();
     if (ModelState.IsValid)
     {
         string result;
         if ((result = data.EditData(model.DataList.MovieID, model.DataList.MovieName, model.DataList.Genre, data.ActorsFromString(model.ActorString), User.Identity.Name)) == null)
         {
             return(RedirectToAction("DataList"));
         }
         else
         {
             ViewBag.DuplicateError = result;
             return(View(model));
         }
     }
     else
     {
         return(View());
     }
 }