Example #1
0
        /// <summary>
        /// 根据id删除附件资源
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult RemoveAttachById(int id)
        {
            StateModel res = new StateModel();

            res.Status = AttachmentMgr.DeleteById(id);
            return(Json(res));
        }
Example #2
0
        /// <summary>
        /// 上传产品描述视频
        /// 上传较大文件需要在web.config中进行配置 maxRequestLength和maxAllowedContentLength
        /// </summary>
        /// <param name="productID"></param>
        /// <returns></returns>
        public JsonResult UploadProductVideo(int productID)
        {
            StateModel state = AttachmentMgr.AddAttachment(
                HttpContext.Request.Files,
                productID,
                AttachmentType.ProductVideo);

            return(Json(state));
        }
Example #3
0
        /// <summary>
        /// 获取关联id对应的资源集合
        /// </summary>
        /// <param name="relatedId">关联资源主键ID</param>
        /// <returns></returns>
        public JsonResult GetListByRelatedId(int relatedId)
        {
            List <Attachment> res = AttachmentMgr.GetListByRelatedId(relatedId);

            return(Json(res));
        }