public async Task <IActionResult> Edit(Guid id, [Bind("Id,TutorialId,PromoPhotoId")] TutorialPromoPhoto tutorialPromoPhoto)
        {
            if (id != tutorialPromoPhoto.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tutorialPromoPhoto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TutorialPromoPhotoExists(tutorialPromoPhoto.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PromoPhotoId"] = new SelectList(_context.PromoPhotos, "Id", "Id", tutorialPromoPhoto.PromoPhotoId);
            ViewData["TutorialId"]   = new SelectList(_context.Tutorial, "Id", "Id", tutorialPromoPhoto.TutorialId);
            return(View(tutorialPromoPhoto));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,PostId,VideoId")] PostVideo postVideo)
        {
            if (id != postVideo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(postVideo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PostVideoExists(postVideo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PostId"]  = new SelectList(_context.Post, "Id", "Id", postVideo.PostId);
            ViewData["VideoId"] = new SelectList(_context.Videos, "Id", "Id", postVideo.VideoId);
            return(View(postVideo));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,TutorialId,SaleId,Price,DateOfSale,Credits")] TutorialSale tutorialSale)
        {
            if (id != tutorialSale.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tutorialSale);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TutorialSaleExists(tutorialSale.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SaleId"]     = new SelectList(_context.Sale, "Id", "BuyerId", tutorialSale.SaleId);
            ViewData["TutorialId"] = new SelectList(_context.Tutorial, "Id", "Id", tutorialSale.TutorialId);
            return(View(tutorialSale));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,ProfesionalId,BuyerId,Amount,Credits")] Sale sale)
        {
            if (id != sale.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sale);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SaleExists(sale.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BuyerId"]       = new SelectList(_context.Profile, "UserId", "UserId", sale.BuyerId);
            ViewData["ProfesionalId"] = new SelectList(_context.ProfesionallsProfile, "UserId", "UserId", sale.ProfesionalId);
            return(View(sale));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,VideoPath,Price,DateAdded,Title,Description,VideoThumbnail")] ClassVideo classVideo)
        {
            if (id != classVideo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(classVideo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClassVideoExists(classVideo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(classVideo));
        }
Esempio n. 6
0
        public async Task <IActionResult> Edit(string id, [Bind("UserId,YearsExperience,Description,Logo,ProfesionalEmail")] ProfesionallsProfile profesionallsProfile)
        {
            if (id != profesionallsProfile.UserId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(profesionallsProfile);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProfesionallsProfileExists(profesionallsProfile.UserId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", profesionallsProfile.UserId);
            return(View(profesionallsProfile));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("PhotoId,LikeId")] PhotoLike photoLike)
        {
            if (id != photoLike.PhotoId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(photoLike);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PhotoLikeExists(photoLike.PhotoId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LikeId"]  = new SelectList(_context.Like, "Id", "Id", photoLike.LikeId);
            ViewData["PhotoId"] = new SelectList(_context.Photos, "Id", "Id", photoLike.PhotoId);
            return(View(photoLike));
        }
Esempio n. 8
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,OwnerId,Name,Description,DateCreated")] Groups groups)
        {
            if (id != groups.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(groups);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GroupsExists(groups.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OwnerId"] = new SelectList(_context.Profile, "UserId", "UserId", groups.OwnerId);
            return(View(groups));
        }
Esempio n. 9
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Title,Desctription,Price,ProfesionalId,DateCreated")] Tutorial tutorial)
        {
            if (id != tutorial.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tutorial);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TutorialExists(tutorial.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tutorial));
        }
Esempio n. 10
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,TutorialId,ClassVideoId")] TutorialClasses tutorialClasses)
        {
            if (id != tutorialClasses.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tutorialClasses);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TutorialClassesExists(tutorialClasses.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClassVideoId"] = new SelectList(_context.ClassVideo, "Id", "Id", tutorialClasses.ClassVideoId);
            ViewData["TutorialId"]   = new SelectList(_context.TutorialCattegory, "Id", "Id", tutorialClasses.TutorialId);
            return(View(tutorialClasses));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Groupid,Userid")] GroupUser groupUser)
        {
            if (id != groupUser.Groupid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(groupUser);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GroupUserExists(groupUser.Groupid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Groupid"] = new SelectList(_context.Groups, "Id", "Id", groupUser.Groupid);
            ViewData["Userid"]  = new SelectList(_context.Profile, "UserId", "UserId", groupUser.Userid);
            return(View(groupUser));
        }
Esempio n. 12
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ClassVideoId,CattegoryId,Id")] ClassVideoCattegory classVideoCattegory)
        {
            if (id != classVideoCattegory.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(classVideoCattegory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClassVideoCattegoryExists(classVideoCattegory.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CattegoryId"]  = new SelectList(_context.Categories, "Id", "Id", classVideoCattegory.CattegoryId);
            ViewData["ClassVideoId"] = new SelectList(_context.ClassVideo, "Id", "Id", classVideoCattegory.ClassVideoId);
            return(View(classVideoCattegory));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,GroupId,Link")] GoupMediaLink goupMediaLink)
        {
            if (id != goupMediaLink.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(goupMediaLink);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GoupMediaLinkExists(goupMediaLink.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Id", goupMediaLink.GroupId);
            return(View(goupMediaLink));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,StickeId,CategoryId")] StickerCattegory stickerCattegory)
        {
            if (id != stickerCattegory.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stickerCattegory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StickerCattegoryExists(stickerCattegory.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Id", stickerCattegory.CategoryId);
            ViewData["StickeId"]   = new SelectList(_context.Stickers, "Id", "UserId", stickerCattegory.StickeId);
            return(View(stickerCattegory));
        }
Esempio n. 15
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,UserId,Discription,DocumentPath,VissibleToPublic,VissibleToFollowers")] ProfesionalsDocuments profesionalsDocuments)
        {
            if (id != profesionalsDocuments.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(profesionalsDocuments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProfesionalsDocumentsExists(profesionalsDocuments.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.ProfesionallsProfile, "UserId", "UserId", profesionalsDocuments.UserId);
            return(View(profesionalsDocuments));
        }
Esempio n. 16
0
        public async Task <IActionResult> Edit(string id, [Bind("UserId,FirstName,LastName,DateOfBirth,ProfilePhoto,Country,WallPhoto,Bio,PhoneNumber,Website")] Profile profile)
        {
            if (id != profile.UserId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(profile);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProfileExists(profile.UserId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(profile));
        }
Esempio n. 17
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ChatId,DateCreated")] Chat chat)
        {
            if (id != chat.ChatId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(chat);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChatExists(chat.ChatId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(chat));
        }
Esempio n. 18
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,UserId,ClassVideoId,Rating")] ClassRatings classRatings)
        {
            if (id != classRatings.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(classRatings);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClassRatingsExists(classRatings.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClassVideoId"] = new SelectList(_context.ClassVideo, "Id", "Id", classRatings.ClassVideoId);
            ViewData["UserId"]       = new SelectList(_context.Profile, "UserId", "UserId", classRatings.UserId);
            return(View(classRatings));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,UserId,Grade")] Stickers stickers)
        {
            if (id != stickers.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stickers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StickersExists(stickers.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.ProfesionallsProfile, "UserId", "UserId", stickers.UserId);
            return(View(stickers));
        }
Esempio n. 20
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,PhotoPath")] PromoPhotos promoPhotos)
        {
            if (id != promoPhotos.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(promoPhotos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PromoPhotosExists(promoPhotos.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(promoPhotos));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("ShareId,LikeId")] ShareLikes shareLikes)
        {
            if (id != shareLikes.ShareId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shareLikes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShareLikesExists(shareLikes.ShareId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LikeId"]  = new SelectList(_context.Like, "Id", "Id", shareLikes.LikeId);
            ViewData["ShareId"] = new SelectList(_context.Share, "Id", "Id", shareLikes.ShareId);
            return(View(shareLikes));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,PostId,Caption,Text,Date")] Share share)
        {
            if (id != share.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(share);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShareExists(share.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PostId"] = new SelectList(_context.Post, "Id", "Id", share.PostId);
            return(View(share));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("UserId,ChatId,Id")] UserChat userChat)
        {
            if (id != userChat.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userChat);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserChatExists(userChat.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ChatId"] = new SelectList(_context.Chat, "ChatId", "ChatId", userChat.ChatId);
            ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", userChat.UserId);
            return(View(userChat));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,EventId,UserId")] EventUsers eventUsers)
        {
            if (id != eventUsers.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eventUsers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventUsersExists(eventUsers.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EventId"] = new SelectList(_context.Events, "Id", "Id", eventUsers.EventId);
            ViewData["UserId"]  = new SelectList(_context.Profile, "UserId", "UserId", eventUsers.UserId);
            return(View(eventUsers));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,UserId,Text,Date")] Comments comments)
        {
            if (id != comments.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(comments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CommentsExists(comments.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(comments));
        }
Esempio n. 26
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,OldComment,NewComment")] CommentComments commentComments)
        {
            if (id != commentComments.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(commentComments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CommentCommentsExists(commentComments.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["NewComment"] = new SelectList(_context.Comments, "Id", "Id", commentComments.NewComment);
            ViewData["OldComment"] = new SelectList(_context.Comments, "Id", "Id", commentComments.OldComment);
            return(View(commentComments));
        }
Esempio n. 27
0
        public async Task <IActionResult> Edit(string id, [Bind("Followers,Following")] Followings followings)
        {
            if (id != followings.Followers)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(followings);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FollowingsExists(followings.Followers))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Followers"] = new SelectList(_context.Profile, "UserId", "UserId", followings.Followers);
            ViewData["Following"] = new SelectList(_context.Profile, "UserId", "UserId", followings.Following);
            return(View(followings));
        }
Esempio n. 28
0
        public async Task <IActionResult> Edit(Guid id, [Bind("MessageId,Msge,Date,UserId,ChatId")] Messages messages)
        {
            if (id != messages.MessageId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(messages);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MessagesExists(messages.MessageId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ChatId"] = new SelectList(_context.Chat, "ChatId", "ChatId", messages.ChatId);
            ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", messages.UserId);
            return(View(messages));
        }