public async Task <IActionResult> Create([Bind("UserId,FirstName,LastName,DateOfBirth,ProfilePhoto,Country,WallPhoto,Bio,PhoneNumber,Website")] Profile profile) { if (ModelState.IsValid) { _context.Add(profile); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(profile)); }
public async Task <IActionResult> Create([Bind("Id,PhotoPath")] PromoPhotos promoPhotos) { if (ModelState.IsValid) { promoPhotos.Id = Guid.NewGuid(); _context.Add(promoPhotos); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(promoPhotos)); }
public async Task <IActionResult> Create([Bind("Id,UserId,Caption,Text,Date")] Post post) { if (ModelState.IsValid) { post.Id = Guid.NewGuid(); _context.Add(post); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(post)); }
public async Task <IActionResult> Create([Bind("Id,Category,SubCategory")] Categories categories) { if (ModelState.IsValid) { categories.Id = Guid.NewGuid(); _context.Add(categories); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(categories)); }
public async Task <IActionResult> Create([Bind("Id,VideoPath,Price,DateAdded,Title,Description,VideoThumbnail")] ClassVideo classVideo) { if (ModelState.IsValid) { classVideo.Id = Guid.NewGuid(); _context.Add(classVideo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(classVideo)); }
public async Task <IActionResult> Create([Bind("Id,Title,Desctription,Price,ProfesionalId,DateCreated")] Tutorial tutorial) { if (ModelState.IsValid) { tutorial.Id = Guid.NewGuid(); _context.Add(tutorial); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tutorial)); }
public async Task <IActionResult> Create([Bind("Id,UserId,Date")] Like like) { if (ModelState.IsValid) { like.Id = Guid.NewGuid(); _context.Add(like); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(like)); }
public async Task <IActionResult> Create([Bind("Id,UserId,Text,Date")] Comments comments) { if (ModelState.IsValid) { comments.Id = Guid.NewGuid(); _context.Add(comments); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(comments)); }
public async Task <IActionResult> Create([Bind("UserId,YearsExperience,Description,Logo,ProfesionalEmail")] ProfesionallsProfile profesionallsProfile) { if (ModelState.IsValid) { _context.Add(profesionallsProfile); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", profesionallsProfile.UserId); return(View(profesionallsProfile)); }
public async Task <IActionResult> Create([Bind("ChatId,DateCreated")] Chat chat) { if (ModelState.IsValid) { chat.ChatId = Guid.NewGuid(); _context.Add(chat); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(chat)); }
public async Task <IActionResult> Create([Bind("Id,PostId,Caption,Text,Date")] Share share) { if (ModelState.IsValid) { share.Id = Guid.NewGuid(); _context.Add(share); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PostId"] = new SelectList(_context.Post, "Id", "Id", share.PostId); return(View(share)); }
public async Task <IActionResult> Create([Bind("Id,OwnerId,Name,Description,DateCreated")] Groups groups) { if (ModelState.IsValid) { groups.Id = Guid.NewGuid(); _context.Add(groups); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["OwnerId"] = new SelectList(_context.Profile, "UserId", "UserId", groups.OwnerId); return(View(groups)); }
public async Task <IActionResult> Create([Bind("Followers,Following")] Followings followings) { if (ModelState.IsValid) { _context.Add(followings); await _context.SaveChangesAsync(); 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)); }
public async Task <IActionResult> Create([Bind("Id,UserId,Link")] UserSocialMediaLinks userSocialMediaLinks) { if (ModelState.IsValid) { userSocialMediaLinks.Id = Guid.NewGuid(); _context.Add(userSocialMediaLinks); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", userSocialMediaLinks.UserId); return(View(userSocialMediaLinks)); }
public async Task <IActionResult> Create([Bind("Id,UserId,Discription,DocumentPath,VissibleToPublic,VissibleToFollowers")] ProfesionalsDocuments profesionalsDocuments) { if (ModelState.IsValid) { profesionalsDocuments.Id = Guid.NewGuid(); _context.Add(profesionalsDocuments); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.ProfesionallsProfile, "UserId", "UserId", profesionalsDocuments.UserId); return(View(profesionalsDocuments)); }
public async Task <IActionResult> Create([Bind("Id,UserId,Grade")] Stickers stickers) { if (ModelState.IsValid) { stickers.Id = Guid.NewGuid(); _context.Add(stickers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.ProfesionallsProfile, "UserId", "UserId", stickers.UserId); return(View(stickers)); }
public async Task <IActionResult> Create([Bind("Id,UserId,EventName,EventDate,EventDescription,EventThumbnail")] Events events) { if (ModelState.IsValid) { events.Id = Guid.NewGuid(); _context.Add(events); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", events.UserId); return(View(events)); }
public async Task <IActionResult> Create([Bind("Id,GroupId,Link")] GoupMediaLink goupMediaLink) { if (ModelState.IsValid) { goupMediaLink.Id = Guid.NewGuid(); _context.Add(goupMediaLink); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Id", goupMediaLink.GroupId); return(View(goupMediaLink)); }
public async Task <IActionResult> Create([Bind("Groupid,Userid")] GroupUser groupUser) { if (ModelState.IsValid) { groupUser.Groupid = Guid.NewGuid(); _context.Add(groupUser); await _context.SaveChangesAsync(); 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)); }
public async Task <IActionResult> Create([Bind("Id,EventId,GroupId")] EventGroups eventGroups) { if (ModelState.IsValid) { eventGroups.Id = Guid.NewGuid(); _context.Add(eventGroups); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EventId"] = new SelectList(_context.Events, "Id", "Id", eventGroups.EventId); ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Id", eventGroups.GroupId); return(View(eventGroups)); }
public async Task <IActionResult> Create([Bind("Id,UserId,TutorialId,Rating")] TutorialRating tutorialRating) { if (ModelState.IsValid) { tutorialRating.Id = Guid.NewGuid(); _context.Add(tutorialRating); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TutorialId"] = new SelectList(_context.Tutorial, "Id", "Id", tutorialRating.TutorialId); ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", tutorialRating.UserId); return(View(tutorialRating)); }
public async Task <IActionResult> Create([Bind("UserId,ChatId,Id")] UserChat userChat) { if (ModelState.IsValid) { userChat.Id = Guid.NewGuid(); _context.Add(userChat); await _context.SaveChangesAsync(); 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> Create([Bind("Id,ProfesionalId,BuyerId,Amount,Credits")] Sale sale) { if (ModelState.IsValid) { sale.Id = Guid.NewGuid(); _context.Add(sale); await _context.SaveChangesAsync(); 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)); }
public async Task <IActionResult> Create([Bind("ShareId,LikeId")] ShareLikes shareLikes) { if (ModelState.IsValid) { shareLikes.ShareId = Guid.NewGuid(); _context.Add(shareLikes); await _context.SaveChangesAsync(); 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> Create([Bind("PhotoId,LikeId")] PhotoLike photoLike) { if (ModelState.IsValid) { photoLike.PhotoId = Guid.NewGuid(); _context.Add(photoLike); await _context.SaveChangesAsync(); 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)); }
public async Task <IActionResult> Create([Bind("Id,UserId,ClassVideoId,Rating")] ClassRatings classRatings) { if (ModelState.IsValid) { classRatings.Id = Guid.NewGuid(); _context.Add(classRatings); await _context.SaveChangesAsync(); 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> Create([Bind("Id,OldComment,NewComment")] CommentComments commentComments) { if (ModelState.IsValid) { commentComments.Id = Guid.NewGuid(); _context.Add(commentComments); await _context.SaveChangesAsync(); 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)); }
public async Task <IActionResult> Create([Bind("Id,PostId,VideoId")] PostVideo postVideo) { if (ModelState.IsValid) { postVideo.Id = Guid.NewGuid(); _context.Add(postVideo); await _context.SaveChangesAsync(); 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)); }
public async Task <IActionResult> Create([Bind("Id,UserId,CattegorryId")] UserCattegory userCattegory) { if (ModelState.IsValid) { userCattegory.Id = Guid.NewGuid(); _context.Add(userCattegory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CattegorryId"] = new SelectList(_context.Categories, "Id", "Id", userCattegory.CattegorryId); ViewData["UserId"] = new SelectList(_context.Profile, "UserId", "UserId", userCattegory.UserId); return(View(userCattegory)); }
public async Task <IActionResult> Create([Bind("Id,TutorialId,PromoPhotoId")] TutorialPromoPhoto tutorialPromoPhoto) { if (ModelState.IsValid) { tutorialPromoPhoto.Id = Guid.NewGuid(); _context.Add(tutorialPromoPhoto); await _context.SaveChangesAsync(); 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)); }