示例#1
0
        public ActionResult Save(Models.SysFileModels.SysFileModel model)
        {
            var group = new UCMS.Entitys.SysFile()
            {
                Id        = model.Id,
                FileName  = model.FileName,
                FilePath  = new Common.FileHelper().SaveFileRelative("FilePath", "", Common.FileConfig.FilePath),
                IsDelete  = (int)Common.EnumModel.EIsDelete.NotDelete,
                TimeStamp = DateTime.Now,
            };
            var line = provider.Edit(group);

            return(Json(new { d = line > 0 ? 1 : 0 }));
        }
示例#2
0
        public ActionResult Create(long?Id)
        {
            var model = new Models.SysFileModels.SysFileModel();

            if (Id != null)
            {
                var file = provider.GetFile(Id.Value);
                if (file != null)
                {
                    model = new Models.SysFileModels.SysFileModel
                    {
                        Id       = file.Id,
                        FileName = file.FileName,
                        FilePath = new Common.FileHelper().GetFileUrl(file.FilePath, Common.FileConfig.FilePath, this.HttpContext),
                    };
                }
            }
            return(View(model));
        }