public ActionResult Upload(AddMaterialListModel model)
        {
            if (!ModelState.IsValid)
            {
                throw new KnownException(ModelState.GetFirstError());
            }
            var result = new StandardJsonResult <bool>();

            result.Try(() =>
            {
                var file      = Request.Files;
                int filecount = file.Count;
                for (int i = 0; i < filecount; i++)
                {
                    FileType ftype = FileType.All;
                    if (model.ext.ToLower().IndexOf("doc") >= 0)
                    {
                        ftype = FileType.Word;
                    }
                    else if (model.ext.ToLower().IndexOf("xls") >= 0)
                    {
                        ftype = FileType.Excel;
                    }
                    else if (model.ext.ToLower().IndexOf("ppt") >= 0)
                    {
                        ftype = FileType.PPT;
                    }
                    else if (model.ext.ToLower().IndexOf("pdf") >= 0)
                    {
                        ftype = FileType.PDF;
                    }
                    else
                    {
                        throw new KnownException("上传的格式不对");
                    }

                    var f        = file[i];
                    Stream sf    = f.InputStream;
                    result.Value = service.UpLoading(new KnowlegeDto()
                    {
                        Deleted       = false,
                        Name          = model.fileName == null ? f.FileName : model.fileName + "." + model.ext,
                        KnowledgeType = model.materialType,
                        DocumentType  = ftype,
                        FileStream    = sf,
                        EnterpriseID  = BCSession.User.EnterpriseID,
                        DocumentSize  = f.ContentLength,
                        ID            = DateTime.Now.ToFileTime().ToString() + "." + model.ext,
                        FileGUID      = model.guid,
                        FileAllSize   = model.byteLength,
                        FileNumber    = model.chunk,
                    });
                }
            });
            if (result.Value && result.Success)
            {
                result.Message = "添加成功";
            }
            return(result);
        }
        public ActionResult Update(AddMaterialListModel model, string fileID)
        {
            if (!ModelState.IsValid)
            {
                throw new KnownException(ModelState.GetFirstError());
            }
            var result = new StandardJsonResult <bool>();

            result.Try(() =>
            {
                result.Value = service.UpdateFileType(fileID, model.materialType, model.guid);
            });
            if (result.Value && result.Success)
            {
                result.Message = "修改成功";
            }

            return(result);
        }