Exemplo n.º 1
0
        public static string GetimageLibraryByid(int id)
        {
            int totalcount = 0;

            try
            {
                var list = B2bCompanyImageData.GetimageLibraryByid(id);
                if (list == null)
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到图片", totalCount = 0 }));
                }

                IEnumerable result = "";
                if (list != null)
                {
                    list.Imgurl_address = FileSerivce.GetImgUrl(list.Imgurl);//获取图片实际地址
                }

                return(JsonConvert.SerializeObject(new { type = 100, msg = list, totalCount = totalcount }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Exemplo n.º 2
0
        private void ShowImgBind()
        {
            var comid = UserHelper.CurrentCompany.ID;

            if (id != 0)
            {
                var imagemodel = B2bCompanyImageData.GetimageLibraryByid(id);
                if (imagemodel != null)
                {
                    usetype = imagemodel.Usetype;
                    modelid = imagemodel.Modelid;

                    FileUploadModel identityFileUpload = new FileUploadData().GetFileById(imagemodel.Imgurl);
                    if (identityFileUpload != null)
                    {
                        headPortraitImgSrc = identityFileUpload.Relativepath;
                    }
                }
            }
        }