Beispiel #1
0
        public static ImageInfoModel NewArtList(ArtInfoParams artInfoParams)
        {
            Tk_GalleryDetailBLL tk_GalleryDetailBLL = new Tk_GalleryDetailBLL();
            string json = artInfoParams.TryToJson();
            List <Tk_GalleryDetail> list = tk_GalleryDetailBLL.GetPageList(new Pagination()
            {
                page = 1, rows = 1, sidx = "PeriodsNumber", sord = "desc"
            }, json).ToList();
            ImageInfoModel rtdata = new ImageInfoModel();

            if (list.Count > 0)
            {
                rtdata = new ImageInfoModel()
                {
                    PeriodsNumber = list[0].PeriodsNumber
                };
            }
            // rtdata = rtdata.OrderBy(s => s.GalleryNumber).ToList();//升序排序
            return(rtdata);
        }
        public HttpResponseMessage QueryArtInfo(ArtInfoParams artInfoParams)
        {
            BaseJson <ImageInfoModel> resultMsg = new BaseJson <ImageInfoModel> {
                Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null
            };

            Logger(typeof(GallerMangerApiController), artInfoParams.TryToJson(), "GallerMangerApi/QueryArtInfo链接成功", () =>
            {
                if (string.IsNullOrEmpty(artInfoParams.GalleryId) && string.IsNullOrEmpty(artInfoParams.ID) && string.IsNullOrEmpty(artInfoParams.PeriodsNumber))
                {
                    resultMsg = new BaseJson <ImageInfoModel>
                    {
                        Status  = (int)JsonObjectStatus.Fail,
                        Data    = null,
                        Message = JsonObjectStatus.Fail.GetEnumText() + "GallerMangerApi/QueryArtInfo参数错误: ",
                        BackUrl = null
                    };
                }
                ImageInfoModel data = TKApiBLL.QueryArtInfo(artInfoParams);
                resultMsg           = new BaseJson <ImageInfoModel>
                {
                    Status  = (int)JsonObjectStatus.Success,
                    Data    = data,
                    Message = JsonObjectStatus.Success.GetEnumText(),
                    BackUrl = null
                };
            }, e =>
            {
                resultMsg = new BaseJson <ImageInfoModel>
                {
                    Status  = (int)JsonObjectStatus.Exception,
                    Data    = null,
                    Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
                    BackUrl = null
                };
            });

            return(resultMsg.TryToJson().ToHttpResponseMessage());
        }
Beispiel #3
0
        /// <summary>
        /// 查询图谜实体
        /// </summary>
        /// <param name="artInfoParams"></param>
        /// <returns></returns>
        public static ImageInfoModel QueryArtInfo(ArtInfoParams artInfoParams)
        {
            Tk_GalleryDetailBLL tk_GalleryDetailBLL = new Tk_GalleryDetailBLL();
            string json = artInfoParams.TryToJson();
            List <Tk_GalleryDetail> list = tk_GalleryDetailBLL.GetPageList(new Pagination()
            {
                page = 1, rows = 1, sidx = "PeriodsNumber", sord = "desc"
            }, json).ToList();
            ImageInfoModel rtdata = new ImageInfoModel();

            if (list.Count > 0)
            {
                rtdata = new ImageInfoModel()
                {
                    galleryId     = list[0].GalleryId,
                    SortCode      = list[0].SortCode.Value,
                    ID            = list[0].ID,
                    ImageUrl      = list[0].ImageUrl,
                    PeriodsNumber = list[0].PeriodsNumber
                };
            }
            return(rtdata);
        }