Ejemplo n.º 1
0
 public JsonResult Edit(LeafletViewModel leaflet)
 {
     if (_leafletService.Edit(leaflet))
     {
         return(Json("مکان شما با موفقیت ثبت شد"));
     }
     return(Json("خطا در ویرایش مکان شما"));
 }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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);
        }