Пример #1
0
        public JsonResult SaveSvgData(BuildingSvgConfigModel model)
        {
            if (string.IsNullOrWhiteSpace(model.Svg))
            {
                model.Svg = string.Empty;
            }

            var prevSvg = ApartmentManager.GetSvgData(model.BuildingId, model.AssetId);

            if (prevSvg != null)
            {
                prevSvg.Svg = model.Svg;
                ApartmentManager.UpdateSvgData(prevSvg);
            }
            else
            {
                var newBuildingSvg = new SvgData();
                newBuildingSvg.BuildingId = model.BuildingId;
                newBuildingSvg.AssetId    = model.AssetId;
                newBuildingSvg.Svg        = model.Svg;
                newBuildingSvg.Type       = 0;

                ApartmentManager.SaveSvgData(newBuildingSvg);
            }

            return(Json(new { Message = "Success" }));
        }
Пример #2
0
        public JsonResult GetSvgData(BuildingSvgConfigModel model)
        {
            var data = ApartmentManager.GetSvgData(model.BuildingId, model.AssetId);

            return(Json(new { svgData = data }));
        }