public IActionResult UpdatePhoto(uint id, [FromBody] PhotoEntity photo)
        {
            if (photo == null)
            {
                return(BadRequest());
            }

            return(_photoService.EditPhoto(id, photo.Username, photo.Description) ? Ok() : NotFound());
        }
Example #2
0
        public ActionResult EditPhoto(HttpPostedFileBase useralbumphoto_photo, PhotoModel model)
        {
            model.useralbumphoto_id = Convert.ToInt32(TempData["useralbumphoto_id"]);
            int i = photorepo.EditPhoto(model);

            if (i >= 1)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ViewBag.msg = "Failed";
                return(View());
            }
        }
Example #3
0
        public IHttpActionResult UpdatePhotoDetail(PhotoModel model)
        {
            PhotoModel photo = new PhotoModel();

            photo.useralbumphoto_id     = model.useralbumphoto_id;
            photo.useralbumphoto_name   = model.useralbumphoto_name;
            photo.useralbumphoto_prise  = model.useralbumphoto_prise;
            photo.useralbumphoto_artist = model.useralbumphoto_artist;
            int i = photorepo.EditPhoto(photo);

            if (i >= 1)
            {
                return(Ok("Succesfully Updated"));
            }
            else
            {
                return(BadRequest("Bad Request"));
            }
        }