public async Task <IActionResult> PutFollowings(string id, Followings followings)
        {
            if (id != followings.Followers)
            {
                return(BadRequest());
            }

            _context.Entry(followings).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FollowingsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PutTutorialPromoPhoto(Guid id, TutorialPromoPhoto tutorialPromoPhoto)
        {
            if (id != tutorialPromoPhoto.Id)
            {
                return(BadRequest());
            }

            _context.Entry(tutorialPromoPhoto).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TutorialPromoPhotoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 3
0
        public async Task <IActionResult> PutUserCattegory(Guid id, UserCattegory userCattegory)
        {
            if (id != userCattegory.Id)
            {
                return(BadRequest());
            }

            _context.Entry(userCattegory).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserCattegoryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 4
0
        public async Task <IActionResult> PutCliente(int id, Cliente cliente)
        {
            if (id != cliente.Id)
            {
                return(BadRequest());
            }

            _context.Entry(cliente).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClienteExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutEventGroups(Guid id, EventGroups eventGroups)
        {
            if (id != eventGroups.Id)
            {
                return(BadRequest());
            }

            _context.Entry(eventGroups).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EventGroupsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 6
0
        public async Task <IActionResult> PutInstalacao(int id, Instalacao instalacao)
        {
            if (id != instalacao.Id)
            {
                return(BadRequest());
            }

            _context.Entry(instalacao).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InstalacaoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 7
0
        public async Task <IActionResult> PutGoupMediaLink(Guid id, GoupMediaLink goupMediaLink)
        {
            if (id != goupMediaLink.Id)
            {
                return(BadRequest());
            }

            _context.Entry(goupMediaLink).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GoupMediaLinkExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 8
0
        public async Task <IActionResult> PutGroupUser(Guid id, GroupUser groupUser)
        {
            if (id != groupUser.Groupid)
            {
                return(BadRequest());
            }

            _context.Entry(groupUser).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GroupUserExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 9
0
        public async Task <IActionResult> PutMessages(Guid id, Messages messages)
        {
            if (id != messages.MessageId)
            {
                return(BadRequest());
            }

            _context.Entry(messages).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MessagesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutPostVideo(Guid id, PostVideo postVideo)
        {
            if (id != postVideo.Id)
            {
                return(BadRequest());
            }

            _context.Entry(postVideo).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PostVideoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 11
0
        public async Task <IActionResult> PutProfesionallsProfile(string id, ProfesionallsProfile profesionallsProfile)
        {
            if (id != profesionallsProfile.UserId)
            {
                return(BadRequest());
            }

            _context.Entry(profesionallsProfile).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProfesionallsProfileExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 12
0
        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));
        }
Esempio n. 13
0
        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));
        }
Esempio n. 14
0
        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));
        }
Esempio n. 15
0
        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));
        }
Esempio n. 16
0
        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));
        }
Esempio n. 17
0
        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("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));
        }
Esempio n. 20
0
        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));
        }
Esempio n. 21
0
        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,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));
        }
Esempio n. 23
0
        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));
        }
Esempio n. 24
0
        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));
        }
Esempio n. 25
0
        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("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));
        }
Esempio n. 27
0
        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,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,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));
        }
Esempio n. 30
0
        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));
        }