public RedirectToRouteResult Save(Artysta artysta) { DbModule module = DbModule.GetInstance(); if (artysta.State == RowState.Added) module.AddRow(artysta); else module.Update(artysta); return RedirectToAction("Index", "Artist"); }
public RedirectToRouteResult AddNew() { Artysta artysta = new Artysta(); artysta.State = RowState.Added; return RedirectToAction("Edit", "Artist", artysta); }
public RedirectToRouteResult NewAlbum(Artysta artysta) { if (!MusicStore.Models.Module.User.IsAuthenticated) return RedirectToAction("Index", "Home"); if (MusicStore.Models.Module.User.GetCurrentRole() != MusicStore.Models.Module.User.Admin) return RedirectToAction("Index", "Home"); Album album = new Album(artysta); var dict = new Dictionary<string, object>(); dict.Add("Id", album.Id); dict.Add("ArtystaId", album.ArtystaId); dict.Add("EditAfterSave", true); dict.Add("State", RowState.Added); return RedirectToAction("Save", "Albums", new RouteValueDictionary(dict)); }
public ActionResult Edit(Artysta artysta) { return View(artysta); }