Esempio n. 1
0
        private Image _image; //local instance of the object Image i.e. putting empty varibles to put something in

        #endregion Fields

        #region Constructors

        // constructor
        public Place(string city, string description, Image image)
        {
            _city = city;
              _description = description;
              _places.Add(this);
              _id = _places.Count;
              _image = image;
        }
Esempio n. 2
0
 public HomeModule()
 {
     Get["/"] = _ => {
     return View["index.cshtml"];
       };
       Get["/places"] = _ => {
     List<Place> allPlaces = Place.GetAll();
     return View["places.cshtml", allPlaces];
       };
       Get["/places/new"] = _ => {
     return View["place_form.cshtml"];
       };
       Post["/places"] = _ => {
     Image image  =  new Image(Request.Form["new-image"]);
     Place newPlace = new Place(Request.Form["new-place"], Request.Form["new-description"],image);
     List<Place> allPlaces = Place.GetAll();
     return View["places.cshtml", allPlaces];
       };
       Get["/places/{id}"] = parameters => {
     Place place = Place.Find(parameters.id);
     return View["/place.cshtml", place];
       };
 }
Esempio n. 3
0
 public void SetImage(Image image)
 {
     _image = image;
 }