public int AddPlace(place place) { db.places.InsertOnSubmit(place); db.SubmitChanges(); return place.PID; }
partial void Deleteplace(place instance);
partial void Insertplace(place instance);
partial void Updateplace(place instance);
public ActionResult SavePlace(int userID, string latval, string longval, string placename, string comment, string town, string username) { place newplace = new place(); newplace.UserID = userID; newplace.LatVal = Convert.ToDecimal(latval); newplace.LongVal = Convert.ToDecimal(longval); newplace.Name = placename; newplace.Username = username; newplace.Flag = 0; newplace.Town = town; var newplaceID = dataRepository.AddPlace(newplace); comment newcomm = new comment(); newcomm.Comment1 = comment; newcomm.PlaceID = newplaceID; newcomm.UserID = userID; newcomm.Datetime = DateTime.Now; dataRepository.AddComment(newcomm); db.SubmitChanges(); return new JsonpResult("Done"); }