예제 #1
0
        public InfoModel <string> EditForTouristArea([FromBody] EditInputForTouristArea model)
        {
            SAID.Ver();
            var info = TouristAreaContext.GetInfo(
                HttpContext.RequestServices,
                model.TaId);

            if (!info.IsEmpty())
            {
                model.ParentId = info.GetEntity().ParentID;
            }
            TouristAreaContext.SubWithBase(
                HttpContext.RequestServices,
                model.TaId,
                model.ParentId,
                SAID.GetKey(),
                model.Lng,
                model.Lat,
                model.Title,
                model.Description,
                model.Remarks,
                model.DescriptionForSecPayment,
                model.PriceForSecPayment.ConvertToCents(),
                DateTime.Now,
                DateTime.Now,
                HttpContext.Connection.RemoteIpAddress.ToString(),
                "");
            return(new InfoModel <string>
            {
                Data = "添加成功!"
            });
        }
예제 #2
0
        public InfoModel <EditInputForTouristArea> PullTouristArea([FromForm] string taId)
        {
            var info = TouristAreaContext.GetInfo(
                HttpContext.RequestServices,
                taId);

            if (info.IsEmpty())
            {
                return new InfoModel <EditInputForTouristArea> {
                           Data = new EditInputForTouristArea()
                }
            }
            ;
            return(new InfoModel <EditInputForTouristArea>
            {
                Data = new EditInputForTouristArea
                {
                    SaId = info.GetKey(),
                    Description = info.GetEntity().Description,
                    DescriptionForSecPayment = info.GetEntity().DescriptionForSecPayment,
                    Lat = info.GetEntity().Lat,
                    Lng = info.GetEntity().Lng,
                    ParentId = info.GetEntity().ParentID,
                    Remarks = info.GetEntity().Remarks,
                    TaId = info.GetEntity().TAid,
                    Title = info.GetEntity().Title
                }
            });
        }
예제 #3
0
        public InfoModel <string> DelForTouristArea([FromForm] string taId)
        {
            var touristAreaInfo = TouristAreaContext.GetInfo(
                HttpContext.RequestServices,
                taId);

            touristAreaInfo.Ver();
            touristAreaInfo.MoveToRecycle();
            return(new InfoModel <string>
            {
                Data = "操作成功!"
            });
        }