コード例 #1
0
        public ActionResult FileUpload(HttpPostedFileBase
                                       file, string linkid, string filestate = "0")
        {
            Infrastructure.File.FileUpload up = new Infrastructure.File.FileUpload();
            if (string.IsNullOrEmpty(linkid))
            {
                linkid = Guid.Empty.ToString();
            }
            var state = Convert.ToInt32(filestate);
            var str   = up.SaveToDB(file, Guid.Parse(linkid), state);

            return(Json(str, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
ファイル: BaseCaseDAL.cs プロジェクト: zykitzy/Com.HSJF.HEAS
        private string SaveFiles(string filenames, string linkid, string linkkey)
        {
            Infrastructure.File.FileUpload up = new Infrastructure.File.FileUpload();//文件上传
            string files = string.Empty;

            if (string.IsNullOrEmpty(filenames))
            {
                return(files);
            }
            foreach (var file in filenames.Split(','))
            {
                var filemodel = up.Single(new Guid(file));
                if (filemodel != null)
                {
                    var entity = CopyFile(filemodel);
                    entity.LinkID  = Guid.Parse(linkid);
                    entity.LinkKey = linkkey;
                    up.SaveFileDescription(entity);
                    files += entity.ID;
                    files += ",";
                }
            }
            return(files.Trim(','));
        }