Esempio n. 1
0
 public static List <bp_Photo> Photos(this HtmlHelper help, Guid placeId)
 {
     using (BestPlaceEntities db = new BestPlaceEntities())
     {
         return(db.bp_Photo_GetByPlace(placeId).ToList());
     }
 }
Esempio n. 2
0
        public ActionResult New(bp_Place place)
        {
            if (ModelState.IsValid && db.bp_Photo_GetByPlace(place.PlaceId).Count() > 0)
            {
                db.bp_Place_Create(
                    place.PlaceId,
                    (Guid)Membership.GetUser().ProviderUserKey,
                    place.CategoryId,
                    place.Title,
                    place.Latitude,
                    place.Longitude,
                    place.Descript,
                    place.PhoneNumber,
                    place.Address,
                    place.WebSite);

                return(RedirectToAction("Details", "Place", new { placeId = place.PlaceId }));
            }
            else
            {
                place.Descript = HttpUtility.HtmlDecode(place.Descript);
                return(View(place));
            }
        }