public JsonResult Edit(LeafletViewModel leaflet) { if (_leafletService.Edit(leaflet)) { return(Json("مکان شما با موفقیت ثبت شد")); } return(Json("خطا در ویرایش مکان شما")); }
public bool Edit(LeafletViewModel leaflet) { var me = GetCurentUser(); string strPointWellKnownText = string.Format(CultureInfo.InvariantCulture.NumberFormat, "POINT({0} {1})", leaflet.Lng, leaflet.Lat); DbGeography oDbGeography = DbGeography.PointFromText (pointWellKnownText: strPointWellKnownText, coordinateSystemId: 4326); me.GeoLocation = oDbGeography; me.Location = leaflet.Address; return(_userRepository.Update(me)); }
public LeafletViewModel GetLocation() { var me = GetCurentUser(); if (!(me.GeoLocation is null)) { var result = new LeafletViewModel() { Lat = (double)me.GeoLocation.Latitude, Lng = (double)me.GeoLocation.Longitude, Address = me.Location }; return(result); } return(null); }