Exemplo n.º 1
0
        public ActionResult Create(Album album)
        {
            if (ModelState.IsValid)
            {
                _db.Albums.Add(album);
                _db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.AlbumTypeID = new SelectList(_db.AlbumTypes, "AlbumTypeID", "Name", album.AlbumTypeID);
            ViewBag.PrivacyLevelId = new SelectList(_db.PrivacyLevels, "PrivacyLevelID", "Name", album.PrivacyLevelId);
            ViewBag.UserID = new SelectList(_db.Users, "UserId", "UserName", album.UserID);
            ViewBag.CampaignID = new SelectList(_db.Campaigns, "CampaignID", "Name", album.CampaignID);
            return View(album);
        }
Exemplo n.º 2
0
 public ActionResult Edit(Album album)
 {
     if (album.UserID != (Guid)Membership.GetUser().ProviderUserKey) { return HttpNotFound(); }
     if (ModelState.IsValid)
     {
         _db.Entry(album).State = EntityState.Modified;
         _db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.AlbumTypeID = new SelectList(_db.AlbumTypes, "AlbumTypeID", "Name", album.AlbumTypeID);
     ViewBag.PrivacyLevelId = new SelectList(_db.PrivacyLevels, "PrivacyLevelID", "Name", album.PrivacyLevelId);
     ViewBag.UserID = new SelectList(_db.Users, "UserId", "UserName", album.UserID);
     ViewBag.CampaignID = new SelectList(_db.Campaigns, "CampaignID", "Name", album.CampaignID);
     return View(album);
 }
Exemplo n.º 3
0
		private void attach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.PrivacyLevel = this;
		}
Exemplo n.º 4
0
		private void detach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.PrivacyLevel = null;
		}
Exemplo n.º 5
0
 partial void UpdateAlbum(Album instance);
Exemplo n.º 6
0
 partial void DeleteAlbum(Album instance);
Exemplo n.º 7
0
 partial void InsertAlbum(Album instance);
Exemplo n.º 8
0
		private void detach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.AlbumType = null;
		}
Exemplo n.º 9
0
		private void attach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.AlbumType = this;
		}
Exemplo n.º 10
0
		private void detach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.UserProfile = null;
		}
Exemplo n.º 11
0
		private void attach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.UserProfile = this;
		}