Esempio n. 1
0
 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");
 }
Esempio n. 2
0
        public RedirectToRouteResult AddNew()
        {
            Artysta artysta = new Artysta();
            artysta.State = RowState.Added;

            return RedirectToAction("Edit", "Artist", artysta);
        }
Esempio n. 3
0
 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));
 }
Esempio n. 4
0
 public ActionResult Edit(Artysta artysta)
 {
     return View(artysta);
 }