コード例 #1
0
 public ActionResult Delete(string id)
 {
     PhotoServiceClient psc = new PhotoServiceClient();
     PhotoViewModel pvm = new PhotoViewModel();
     pvm.Photo = psc.find(id);
     if (!(User.Identity.Name).Equals(pvm.Photo.UserName))
         return View("NotFound");
     psc.delete(psc.find(id));
     return RedirectToAction("Album");
 }
コード例 #2
0
 public ActionResult Edit(string id)
 {
     PhotoServiceClient psc = new PhotoServiceClient();
     PhotoViewModel pvm = new PhotoViewModel();
     pvm.Photo = psc.find(id);
     if (!pvm.Photo.UserName.Equals(User.Identity.Name))
         return View("NotFound");
     ViewBag.Photo = pvm.Photo;
     return View("Edit", pvm);
 }