Пример #1
0
        public InfoModelList <EditInputForTouristArea> PullTouristAreas([FromForm] string parentId)
        {
            var list = TouristAreaContext.GetListPageWithSAid(
                HttpContext.RequestServices,
                new PageInfo(0, 10000),
                parentId,
                SAID.GetKey());

            return(new InfoModelList <EditInputForTouristArea>
            {
                ListData = list.ConvertAll(T =>
                {
                    return new EditInputForTouristArea
                    {
                        Description = T.GetEntity().Description,
                        SaId = T.GetEntity().SAid,
                        PriceForSecPayment = T.GetEntity().PriceForSecPayment.ConvertToYuanString(),
                        DescriptionForSecPayment = T.GetEntity().DescriptionForSecPayment,
                        Lat = T.GetEntity().Lat,
                        Lng = T.GetEntity().Lng,
                        ParentId = T.GetEntity().ParentID,
                        Remarks = T.GetEntity().Remarks,
                        TaId = T.GetEntity().TAid,
                        Title = T.GetEntity().Title
                    };
                })
            });
        }
Пример #2
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 = "添加成功!"
            });
        }
Пример #3
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
                }
            });
        }
Пример #4
0
        public InfoModel <string> DelForTouristArea([FromForm] string taId)
        {
            var touristAreaInfo = TouristAreaContext.GetInfo(
                HttpContext.RequestServices,
                taId);

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