public void Save() { if (base.HasFile) { if ((this.ImageHeight > 0) || (this.ImageWidth > 0)) { object obj2; System.Drawing.Image image = base.PostedFile.InputStream.StreamToImage(); string str = ""; if ((this.ImageWidth > 0) && ((image.Width < (this.ImageWidth - this.ImageRange)) || (image.Width > (this.ImageWidth + this.ImageRange)))) { obj2 = str; str = string.Concat(new object[] { obj2, @"\n图片宽度不正确!限制宽度:", this.ImageWidth, "px", (this.ImageRange > 0) ? ("误差:" + this.ImageRange + "px") : "", ",当前宽度:", image.Width, "px" }); } if ((this.ImageHeight > 0) && ((image.Height < (this.ImageHeight - this.ImageRange)) || (image.Height > (this.ImageHeight + this.ImageRange)))) { obj2 = str; str = string.Concat(new object[] { obj2, @"\n图片高度不正确!限制高度:", this.ImageHeight, "px", (this.ImageRange > 0) ? ("误差:" + this.ImageRange + "px") : "", ",当前高度:", image.Height, "px" }); } if (!string.IsNullOrWhiteSpace(str)) { SysAssert.InfoHintAssert(this.FieldName + str); } } this.MoveResourceInfo = base.PostedFile.SaveResource(this.ResourceCode, this.RestrictCode); if (this.MoveResourceInfo.Count > 0) { ResourceInfo info = this.MoveResourceInfo[0]; this.ResourcePath = info.ResourcePath; this.Md5Value = info.Md5Value; } } }
public int GetResourceMaxVerNo(string resourceID, int beginVerNo, int endVerNo) { try { if ((beginVerNo > 0) && (endVerNo > 0)) { beginVerNo = (from s in this.CurrentEntities.sys_resourcever where ((s.ResourceID == resourceID) && (s.VerNo >= beginVerNo)) && (s.VerNo <= endVerNo) select s.VerNo).Max <int>() + 1; } else { beginVerNo = (from s in this.CurrentEntities.sys_resourcever where s.ResourceID == resourceID select s.VerNo).Max <int>() + 1; } } catch { beginVerNo = (beginVerNo == 0) ? 1 : beginVerNo; } if ((beginVerNo > 0) && (endVerNo > 0)) { SysAssert.CheckCondition(beginVerNo > endVerNo, "超最大上传文件数", LogModuleType.ResourceLog); } return(beginVerNo); }
public ResourceInfo SaveResource(WTF.Resource.Entity.resource_filerestrict objresource_filerestrict, string resourceFileName, Stream objStream) { SysAssert.CheckCondition(objresource_filerestrict == null, "传入的资源配置不存在", LogModuleType.ResourceLog); SysAssert.CheckCondition((objStream == null) || (objStream.Length == 0L), "资源流为空", LogModuleType.ResourceLog); string fileResourceCode = objresource_filerestrict.resource_fileresource.FileResourceCode; DateTime now = DateTime.Now; string resourceVerID = Guid.NewGuid().ToString(); WTF.Resource.Entity.resource_filestoragepath _filestoragepath = objresource_filerestrict.resource_filestoragepath; string resourceGUIDFileName = resourceVerID + Path.GetExtension(resourceFileName); string randomSwitchString = _filestoragepath.VirtualName.GetRandomSwitchString(); string pathFormatValue = WTF.Resource.ResourceHelper.GetResourcePathFormatValue(now, resourceVerID, objresource_filerestrict.PathFormatCodeType); string resourcePath = WTF.Resource.ResourceHelper.GetResourceURL(randomSwitchString, (AccessModeCodeType)objresource_filerestrict.AccessModeCodeType, fileResourceCode, pathFormatValue, resourceGUIDFileName, resourceFileName, resourceVerID); string fileNamePath = WTF.Resource.ResourceHelper.GetresourceFullFileNamePath(_filestoragepath.StoragePath, (AccessModeCodeType)objresource_filerestrict.AccessModeCodeType, fileResourceCode, pathFormatValue, resourceGUIDFileName, resourceFileName, true); string str8 = WTF.Resource.ResourceHelper.GetDirectoryPath((AccessModeCodeType)objresource_filerestrict.AccessModeCodeType, fileResourceCode, pathFormatValue, resourceGUIDFileName, resourceFileName); byte[] bytes = new BinaryReader(objStream).ReadBytes((int)objStream.Length); string str9 = ""; if (objresource_filerestrict.IsMd5 == 1) { str9 = bytes.MD5Encrypt(); } bytes.CreateFile(fileNamePath, true); if (objStream != null) { objStream.Close(); } return(new ResourceInfo(Guid.Empty.ToString(), resourceVerID, 0, resourcePath, fileNamePath, resourceFileName) { Md5Value = str9 }); }
public void InsertResourceType(WTF.Resource.Entity.Sys_ResourceType objResourceType) { objResourceType.ResourceTypeCode.CheckIsNull("请输入资源类型代码", LogModuleType.ResourceLog); SysAssert.CheckCondition(this.CurrentEntities.sys_resourcetype.Any <WTF.Resource.Entity.Sys_ResourceType>(p => p.ResourceTypeCode == objResourceType.ResourceTypeCode), "输入的资源类型代码已经存在", LogModuleType.ResourceLog); objResourceType.ResourceTypeName.CheckIsNull("请输入资源类型名称", LogModuleType.ResourceLog); this.CurrentEntities.AddTosys_resourcetype(objResourceType); this.CurrentEntities.SaveChanges(); }
public void DeleteThemeConfigByKey(string primaryKey) { if (this.CurrentEntities.theme_moduletheme.Any <WTF.Theme.Entity.Theme_ModuleTheme>(s => s.ThemeConfigID == primaryKey)) { SysAssert.InfoHintAssert("对不起系统模块已经引用此主题,因此无法删除"); } this.CurrentEntities.theme_themeconfig.DeleteDataPrimaryKey <WTF.Theme.Entity.Theme_ThemeConfig>(primaryKey.ToString()); }
public void InsertHashType(Sys_HashType objHashType) { objHashType.HashTypeCode.CheckIsNull("请输入哈希类型代码", LogModuleType.ParameterLog); objHashType.HashTypeName.CheckIsNull("请输入哈希类型名称", LogModuleType.ParameterLog); SysAssert.CheckCondition(this.Sys_HashType.Any((Sys_HashType s) => s.HashTypeCode == objHashType.HashTypeCode), "输入的代码已经存在", LogModuleType.ParameterLog); this.CurrentEntities.AddTosys_hashtype(objHashType); this.CurrentEntities.SaveChanges(); }
public void InsertParameterType(Sys_ParameterType objParameterType) { objParameterType.ParameterTypeName.CheckIsNull("请输入参数类型名称", LogModuleType.ParameterLog); objParameterType.ParameterTypeCode.CheckIsNull("请输入参数类型代码", LogModuleType.ParameterLog); SysAssert.CheckCondition(this.CurrentEntities.sys_parametertype.Any((Sys_ParameterType p) => p.ParameterTypeCode == objParameterType.ParameterTypeCode), "输入的参数类型代码已经存在", LogModuleType.ParameterLog); this.CurrentEntities.AddTosys_parametertype(objParameterType); this.CurrentEntities.SaveChanges(); }
public void InsertDataTemplateType(Sys_DataTemplateType objDataTemplateType) { objDataTemplateType.DataTemplateTypeCode.CheckIsNull("请输入数据模板类型代码", LogModuleType.ParameterLog); objDataTemplateType.DataTemplateTypeName.CheckIsNull("请输入数据模板类型名称", LogModuleType.ParameterLog); SysAssert.CheckCondition(this.Sys_DataTemplateType.Any((Sys_DataTemplateType s) => s.DataTemplateTypeCode == objDataTemplateType.DataTemplateTypeCode), "输入的代码已经存在", LogModuleType.ParameterLog); this.CurrentEntities.AddTosys_datatemplatetype(objDataTemplateType); this.CurrentEntities.SaveChanges(); }
public void DeleteNotifyAddressByKey(int NotifyAddressID) { if (this.CurrentEntities.work_plannotify.Any((Work_PlanNotify s) => s.NotifyAddressID == NotifyAddressID)) { SysAssert.InfoHintAssert("此地址正在使用,无法删除"); } else { this.CurrentEntities.work_notifyaddress.DeleteDataPrimaryKey(NotifyAddressID.ToString()); } }
public ResourceInfo SaveResource(string ResourceCode, string RestrictCode, string resourceFileName, Stream objStream) { ResourceCode.CheckIsNull("请设置资源类型编码ResourceCode", LogModuleType.ResourceLog); RestrictCode.CheckIsNull("请设置RestrictCode", LogModuleType.ResourceLog); WTF.Resource.Entity.resource_filerestrict _filerestrict = this.resource_filerestrict.Where("it.RestrictCode='" + RestrictCode + "' and it.resource_fileresource.FileResourceCode='" + ResourceCode + "'", new ObjectParameter[0]).Include("resource_filestoragepath").FirstOrDefault <WTF.Resource.Entity.resource_filerestrict>(); if (_filerestrict == null) { SysAssert.InfoHintAssert("找不到此文件配置"); } return(this.SaveResource(_filerestrict, resourceFileName, objStream)); }
public Sys_Parameter GetParameter(string parameterTypeCode, int parameterCodeID) { Sys_Parameter sys_Parameter = this.CurrentEntities.sys_parameter.FirstOrDefault((Sys_Parameter s) => s.Sys_ParameterType.ParameterTypeCode == parameterTypeCode && s.ParameterCodeID == parameterCodeID); if (sys_Parameter.IsNull()) { SysAssert.ArgumentAssert <LogModuleType>(string.Concat(new object[] { "未设置枚举参数", parameterTypeCode, "-", parameterCodeID, "值" }), LogModuleType.Framework); } return(sys_Parameter); }
public string GetDataTemplate(string dataTemplateTypeCode, string templateCode) { Sys_DataTemplate sys_DataTemplate = this.CurrentEntities.sys_datatemplate.FirstOrDefault((Sys_DataTemplate s) => s.TemplateCode == templateCode && s.Sys_DataTemplateType.DataTemplateTypeCode == dataTemplateTypeCode); if (sys_DataTemplate.IsNull()) { SysAssert.ArgumentAssert <LogModuleType>(string.Concat(new string[] { "未设置数据模板", dataTemplateTypeCode, "-", templateCode, "值" }), LogModuleType.Framework); } return(sys_DataTemplate.TemplateContent); }
public string InsertResource(string resourceName, int resourceTypeID) { resourceName.CheckIsNull("资源类型名称不为空", LogModuleType.ResourceLog); SysAssert.CheckCondition(resourceTypeID <= 0, "资源类型标识不为空", LogModuleType.ResourceLog); WTF.Resource.Entity.Sys_ResourceType type = this.CurrentEntities.sys_resourcetype.FirstOrDefault <WTF.Resource.Entity.Sys_ResourceType>(p => p.ResourceTypeID == resourceTypeID); SysAssert.CheckCondition(type == null, "资源类型不存在,请在资源申请处添加", LogModuleType.ResourceLog); WTF.Resource.Entity.Sys_Resource entity = new WTF.Resource.Entity.Sys_Resource { ResourceID = Guid.NewGuid().ToString(), ResourceName = resourceName, VerCount = 0, CreateDate = DateTime.Now }; type.Sys_Resource.Add(entity); this.CurrentEntities.SaveChanges(); return(entity.ResourceID); }
public void Updatecachekey(cache_cachekey objcache_cachekey) { objcache_cachekey.CacheName.CheckIsNull("请输入缓存名称", "ParameterLog"); if (objcache_cachekey.CacheKey.IsNoNull()) { if (this.cache_cachekey.Any((cache_cachekey s) => s.CacheKeyID != objcache_cachekey.CacheKeyID && s.CacheKey == objcache_cachekey.CacheKey)) { SysAssert.ArgumentAssert <LogModuleType>("输入缓存Key已经存在", LogModuleType.ParameterLog); } } else if (objcache_cachekey.CacheKey.IsNull()) { cache_cachesite cache_cachesite = this.cache_cachesite.FirstOrDefault((cache_cachesite s) => s.CacheSiteID == objcache_cachekey.CacheSiteID); objcache_cachekey.CacheKey = cache_cachesite.CachePrefix + "_" + objcache_cachekey.CacheKeyID; this.CurrentEntities.SaveChanges(); } this.CurrentEntities.SaveChanges(); }
public void Insertcachekey(cache_cachekey objcache_cachekey) { objcache_cachekey.CacheName.CheckIsNull("请输入缓存名称", "ParameterLog"); if (objcache_cachekey.CacheKey.IsNoNull() && this.cache_cachekey.Any((cache_cachekey s) => s.CacheKey == objcache_cachekey.CacheKey)) { SysAssert.ArgumentAssert <LogModuleType>("输入依懒Key已经存在", LogModuleType.LogManager); } cache_cachesite cache_cachesite = this.cache_cachesite.FirstOrDefault((cache_cachesite s) => s.CacheSiteID == objcache_cachekey.CacheSiteID); objcache_cachekey.IDPath = cache_cachesite.IDPath; this.CurrentEntities.AddTocache_cachekey(objcache_cachekey); this.CurrentEntities.SaveChanges(); if (objcache_cachekey.CacheKey.IsNull()) { objcache_cachekey.CacheKey = cache_cachesite.CachePrefix + "_" + objcache_cachekey.CacheKeyID; this.CurrentEntities.SaveChanges(); } }
public string GetHashValue(string hashTypeCode, string hashKey) { Sys_Hash sys_Hash = (from s in this.CurrentEntities.sys_hash where s.HashKey == hashKey && s.Sys_HashType.HashTypeCode == hashTypeCode select s).FirstOrDefault <Sys_Hash>(); if (sys_Hash.IsNull()) { SysAssert.ArgumentAssert <LogModuleType>(string.Concat(new string[] { "未设置哈希参数", hashTypeCode, "-", hashKey, "值" }), LogModuleType.Framework); } return(sys_Hash.HashValue); }
public void ChangePlanEnable(int PlanID, bool isEnable) { if (isEnable) { if (!this.Work_PlanStep.Any((Work_PlanStep s) => s.PlanID == PlanID)) { SysAssert.InfoHintAssert("未设置步骤无法设置启动"); } } foreach (Work_Plan current in ((IEnumerable <Work_Plan>) this.Work_Plan.WhereKey(PlanID.ToString()))) { current.IsEnable = isEnable; } if (!isEnable) { this.DeletePlanRunByPlanID(PlanID); } this.CurrentEntities.SaveChanges(); }
public void CheckResourceID(string ResourceID, string resourceName, int resourceTypeID) { if (!this.CurrentEntities.sys_resource.Any <WTF.Resource.Entity.Sys_Resource>(s => (s.ResourceID == ResourceID))) { ResourceID.CheckIsNull("资源标识不能为空", LogModuleType.ResourceLog); resourceName.CheckIsNull("资源类型名称不为空", LogModuleType.ResourceLog); SysAssert.CheckCondition(resourceTypeID <= 0, "资源类型标识不为空", LogModuleType.ResourceLog); WTF.Resource.Entity.Sys_ResourceType type = this.CurrentEntities.sys_resourcetype.FirstOrDefault <WTF.Resource.Entity.Sys_ResourceType>(p => p.ResourceTypeID == resourceTypeID); SysAssert.CheckCondition(type == null, "资源类型不存在,请在资源申请处添加", LogModuleType.ResourceLog); WTF.Resource.Entity.Sys_Resource entity = new WTF.Resource.Entity.Sys_Resource { ResourceID = ResourceID, ResourceName = resourceName, VerCount = 0, CreateDate = DateTime.Now }; type.Sys_Resource.Add(entity); this.CurrentEntities.SaveChanges(); } }
public ResourceInfo SaveResource(WTF.Resource.Entity.resource_filerestrict objresource_filerestrict, HttpPostedFile objPostedFile) { string fileName = Path.GetFileName(objPostedFile.FileName); int contentLength = objPostedFile.ContentLength; string contentType = objPostedFile.ContentType; SysAssert.CheckCondition(objresource_filerestrict == null, "传入的资源配置不存在", LogModuleType.ResourceLog); string fileResourceCode = objresource_filerestrict.resource_fileresource.FileResourceCode; DateTime now = DateTime.Now; string resourceVerID = Guid.NewGuid().ToString(); WTF.Resource.Entity.resource_filestoragepath _filestoragepath = objresource_filerestrict.resource_filestoragepath; string resourceGUIDFileName = resourceVerID + Path.GetExtension(fileName); string pathFormatValue = WTF.Resource.ResourceHelper.GetResourcePathFormatValue(now, resourceVerID, objresource_filerestrict.PathFormatCodeType); string resourcePath = WTF.Resource.ResourceHelper.GetResourceURL(_filestoragepath.VirtualName, (AccessModeCodeType)objresource_filerestrict.AccessModeCodeType, fileResourceCode, pathFormatValue, resourceGUIDFileName, fileName, resourceVerID); string str8 = WTF.Resource.ResourceHelper.GetresourceFullFileNamePath(_filestoragepath.StoragePath, (AccessModeCodeType)objresource_filerestrict.AccessModeCodeType, fileResourceCode, pathFormatValue, resourceGUIDFileName, fileName, true); string str9 = WTF.Resource.ResourceHelper.GetDirectoryPath((AccessModeCodeType)objresource_filerestrict.AccessModeCodeType, fileResourceCode, pathFormatValue, resourceGUIDFileName, fileName); str8.CreateFileDirectory(); objPostedFile.SaveAs(str8); return(new ResourceInfo(Guid.Empty.ToString(), resourceVerID, 0, resourcePath, str8, fileName)); }
public void Save() { if (base.HasFile) { ResourceInfo info; ResourceRule rule = new ResourceRule(); this.ResourceTypeID.CheckIsNull("请设置资源类型标识", LogModuleType.ResourceLog); this.RestrictCode.CheckIsNull("请设置RestrictCode", LogModuleType.ResourceLog); Sys_ResourceRestrict resourceRestrict = rule.GetResourceRestrict(this.ResourceTypeID, this.RestrictCode); string fileExtension = Path.GetExtension(base.FileName).ToLower(); SysAssert.InfoHintAssert(!string.IsNullOrEmpty(resourceRestrict.FileExtension) && (resourceRestrict.FileExtension.IndexOf(fileExtension.Trim(new char[] { '.' })) == -1), "上传的文件扩展名必须是" + resourceRestrict.FileExtension); SysAssert.InfoHintAssert(((((double)base.PostedFile.ContentLength) / 1024.0) > resourceRestrict.FileMaxSize) && (resourceRestrict.FileMaxSize > 0), "对不起支持上传的文件大小为" + ((int)(resourceRestrict.FileMaxSize * 0x400)).RenderFileSize() + ",当前的文件大小超出"); if (this.ResourceID.IsNull()) { if (this.ResourceName.IsNull()) { this.ResourceName = string.Concat(new object[] { "类型:", resourceRestrict.ResourceTypeID, "限制标识", resourceRestrict.ResourceRestrictID.ToString(), base.FileName }); } this.ResourceID = rule.InsertResource(this.ResourceName, this.ResourceTypeID); } else { if (this.ResourceName.IsNull()) { this.ResourceName = string.Concat(new object[] { "类型:", resourceRestrict.ResourceTypeID, "限制标识", resourceRestrict.ResourceRestrictID.ToString(), base.FileName }); } rule.CheckResourceID(this.ResourceID, this.ResourceName, resourceRestrict.ResourceTypeID); } if ((base.PostedFile.ContentType.IndexOf("image") != -1) && (resourceRestrict.Sys_ResourceRestrictPic.Count > 0)) { System.Drawing.Image image; Sys_WaterImage image2; System.Drawing.Image image3; if (resourceRestrict.Sys_ResourceRestrictPic.Count > 1) { this._MoveResourceInfo = new List <ResourceInfo>(); using (List <Sys_ResourceRestrictPic> .Enumerator enumerator = (from s in resourceRestrict.Sys_ResourceRestrictPic orderby s.VerNo orderby s.ResourceRestrictPicID select s).ToList <Sys_ResourceRestrictPic>().GetEnumerator()) { while (enumerator.MoveNext()) { Stream stream; Sys_ResourceRestrictPic objFileVerInfo = enumerator.Current; int verNo = objFileVerInfo.VerNo; if (verNo == 0) { verNo = rule.GetResourceMaxVerNo(this.ResourceID, resourceRestrict.BeginVerNo, resourceRestrict.EndVerNo); } image = base.PostedFile.InputStream.StreamToImage(); if ((objFileVerInfo.ImageWidth > 0) && (objFileVerInfo.ImageHeight > 0)) { if ((image.Width > objFileVerInfo.ImageWidth) || (image.Height > objFileVerInfo.ImageHeight)) { image = image.CreateThumbnail("<=" + objFileVerInfo.ImageWidth.ToString(), "<=" + objFileVerInfo.ImageHeight.ToString()); if (objFileVerInfo.CreateWaterMark) { if (objFileVerInfo.WatermarkType == 2) { SysAssert.CheckCondition(string.IsNullOrEmpty(objFileVerInfo.WatermarkText), "请输入水印的文本", LogModuleType.ResourceLog); image = image.CreateWatermark(objFileVerInfo.WatermarkText, (HorizontalAlign)objFileVerInfo.HorizontalAlign, (VerticalAlign)objFileVerInfo.VerticalAlign); } else { image2 = rule.Sys_WaterImage.FirstOrDefault <Sys_WaterImage>(s => s.WaterImageID == objFileVerInfo.WaterImageID); if (image2.IsNoNull()) { image3 = System.Drawing.Image.FromFile(SysVariable.CurrentContext.Server.MapPath(image2.WaterImagePath), false); image = image.CreateWatermark(image3, (HorizontalAlign)objFileVerInfo.HorizontalAlign, (VerticalAlign)objFileVerInfo.VerticalAlign); image3.Dispose(); } } } this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), verNo, this.Remark)); image.Dispose(); } else if (objFileVerInfo.CreateWaterMark) { if (objFileVerInfo.WatermarkType == 2) { SysAssert.CheckCondition(string.IsNullOrEmpty(objFileVerInfo.WatermarkText), "请输入水印的文本", LogModuleType.ResourceLog); image = image.CreateWatermark(objFileVerInfo.WatermarkText, (HorizontalAlign)objFileVerInfo.HorizontalAlign, (VerticalAlign)objFileVerInfo.VerticalAlign); } else { image2 = rule.Sys_WaterImage.FirstOrDefault <Sys_WaterImage>(s => s.WaterImageID == objFileVerInfo.WaterImageID); if (image2.IsNoNull()) { image3 = System.Drawing.Image.FromFile(SysVariable.CurrentContext.Server.MapPath(image2.WaterImagePath), false); image = image.CreateWatermark(image3, (HorizontalAlign)objFileVerInfo.HorizontalAlign, (VerticalAlign)objFileVerInfo.VerticalAlign); image3.Dispose(); } } this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), verNo, this.Remark)); image.Dispose(); } else { stream = image.ImageToStream(fileExtension); this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", stream, verNo, this.Remark)); } } else if (objFileVerInfo.CreateWaterMark) { if (objFileVerInfo.WatermarkType == 2) { SysAssert.CheckCondition(string.IsNullOrEmpty(objFileVerInfo.WatermarkText), "请输入水印的文本", LogModuleType.ResourceLog); image = image.CreateWatermark(objFileVerInfo.WatermarkText, (HorizontalAlign)objFileVerInfo.HorizontalAlign, (VerticalAlign)objFileVerInfo.VerticalAlign); } else { image2 = rule.Sys_WaterImage.FirstOrDefault <Sys_WaterImage>(s => s.WaterImageID == objFileVerInfo.WaterImageID); if (image2.IsNoNull()) { image3 = System.Drawing.Image.FromFile(SysVariable.CurrentContext.Server.MapPath(image2.WaterImagePath), false); image = image.CreateWatermark(image3, (HorizontalAlign)objFileVerInfo.HorizontalAlign, (VerticalAlign)objFileVerInfo.VerticalAlign); image3.Dispose(); } } this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), verNo, this.Remark)); image.Dispose(); } else { stream = image.ImageToStream(fileExtension); this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", stream, objFileVerInfo.VerNo, this.Remark)); } image.Dispose(); } } return; } Sys_ResourceRestrictPic objSys_ResourceRestrictPic = resourceRestrict.Sys_ResourceRestrictPic.FirstOrDefault <Sys_ResourceRestrictPic>(); if (this.VerNo == 0) { this.VerNo = objSys_ResourceRestrictPic.VerNo; } if (objSys_ResourceRestrictPic.CreateWaterMark && (fileExtension != ".gif")) { image = base.PostedFile.InputStream.StreamToImage(); if (((objSys_ResourceRestrictPic.ImageWidth > 0) && (objSys_ResourceRestrictPic.ImageHeight > 0)) && ((image.Width > objSys_ResourceRestrictPic.ImageWidth) || (image.Height > objSys_ResourceRestrictPic.ImageHeight))) { image = image.CreateThumbnail("<=" + objSys_ResourceRestrictPic.ImageWidth.ToString(), "<=" + objSys_ResourceRestrictPic.ImageHeight.ToString()); } if (objSys_ResourceRestrictPic.WatermarkType == 2) { SysAssert.CheckCondition(string.IsNullOrEmpty(objSys_ResourceRestrictPic.WatermarkText), "请输入水印的文本", LogModuleType.ResourceLog); image = image.CreateWatermark(objSys_ResourceRestrictPic.WatermarkText, (HorizontalAlign)objSys_ResourceRestrictPic.HorizontalAlign, (VerticalAlign)objSys_ResourceRestrictPic.VerticalAlign); } else { image2 = rule.Sys_WaterImage.FirstOrDefault <Sys_WaterImage>(s => s.WaterImageID == objSys_ResourceRestrictPic.WaterImageID); if (image2.IsNoNull()) { image3 = System.Drawing.Image.FromFile(SysVariable.CurrentContext.Server.MapPath(image2.WaterImagePath), false); image = image.CreateWatermark(image3, (HorizontalAlign)objSys_ResourceRestrictPic.HorizontalAlign, (VerticalAlign)objSys_ResourceRestrictPic.VerticalAlign); } } info = rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, resourceRestrict.BeginVerNo, resourceRestrict.EndVerNo), this.Remark); image.Dispose(); } else if ((objSys_ResourceRestrictPic.ImageWidth > 0) && (objSys_ResourceRestrictPic.ImageHeight > 0)) { image = base.PostedFile.InputStream.StreamToImage(); if ((objSys_ResourceRestrictPic.ImageWidth > 0) && (objSys_ResourceRestrictPic.ImageHeight > 0)) { if ((image.Width > objSys_ResourceRestrictPic.ImageWidth) || (image.Height > objSys_ResourceRestrictPic.ImageHeight)) { image = image.CreateThumbnail("<=" + objSys_ResourceRestrictPic.ImageWidth.ToString(), "<=" + objSys_ResourceRestrictPic.ImageHeight.ToString()); info = rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, resourceRestrict.BeginVerNo, resourceRestrict.EndVerNo), this.Remark); } else { info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, resourceRestrict.BeginVerNo, resourceRestrict.EndVerNo), "admin", base.PostedFile, this.Remark); } } else { info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, resourceRestrict.BeginVerNo, resourceRestrict.EndVerNo), "admin", base.PostedFile, this.Remark); } image.Dispose(); } else { info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, resourceRestrict.BeginVerNo, resourceRestrict.EndVerNo), "admin", base.PostedFile, this.Remark); } } else { if (this.VerNo == 0) { this.VerNo = resourceRestrict.VerNo; } info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, resourceRestrict.BeginVerNo, resourceRestrict.EndVerNo), "admin", base.PostedFile, this.Remark); } this.ResourceID = info.ResourceID; this.ResourcePath = info.ResourcePath; this.VerNo = info.VerNo; } }
public override void RenderEndTag(HtmlTextWriter writer) { base.RenderEndTag(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript"); writer.RenderBeginTag(HtmlTextWriterTag.Script); StringBuilder builder = new StringBuilder(); string str = SysVariable.ApplicationPath + "/" + this.ThemePath + "/uploadify.swf"; writer.Write(builder.ToString()); builder.AppendLine(" $(function () {"); builder.AppendLine(" setTimeout(function(){ $(\"#" + this.ClientID + "\").uploadify({"); builder.AppendFormat("'{0}':{1},", "auto", this.AutoPost.ToString().ToLower()); builder.AppendFormat("'{0}':{1},", "removeTimeout", this.RemoveTimeout); builder.AppendFormat("'{0}':{1},", "multi", this.IsMulti.ToString().ToLower()); builder.AppendFormat("'{0}':'{1}',", "buttonText", this.ButtonText); builder.AppendFormat("'{0}':'{1}',", "swf", str); string str2 = SysVariable.ApplicationPath + "/" + this.ThemePath + "/UploadHandler.ashx?ResourceCode=" + this.ResourceCode + "&RestrictCode=" + this.RestrictCode; builder.AppendFormat("'{0}':'{1}',", "uploader", str2); if (!string.IsNullOrWhiteSpace(this.ConfigOptions)) { this.ConfigOptions = this.ConfigOptions.Trim(); this.ConfigOptions = this.ConfigOptions + ","; builder.Append(this.ConfigOptions); } if (this.ResourceCode.IsNoNull() && this.RestrictCode.IsNoNull()) { FileResourceRule rule = new FileResourceRule(); resource_filerestrict _filerestrict = rule.resource_filerestrict.Where("it.RestrictCode='" + this.RestrictCode + "' and it.resource_fileresource.FileResourceCode='" + this.ResourceCode + "'", new ObjectParameter[0]).Include("resource_filestoragepath").Include("resource_filerestrictpic").FirstOrDefault <resource_filerestrict>(); if (_filerestrict == null) { SysAssert.InfoHintAssert("找不到此文件配置"); } if (_filerestrict.FileExtension.IsNoNull()) { builder.AppendFormat("'{0}':'{1}',", "fileTypeExts", "*." + _filerestrict.FileExtension.Replace(",", ";*.")); } if (_filerestrict.FileMaxSize > 0) { builder.AppendFormat("'{0}':'{1}KB',", "fileSizeLimit", _filerestrict.FileMaxSize); } string str3 = ""; if ((_filerestrict.FileMaxSize > 0) || _filerestrict.FileExtension.IsNoNull()) { str3 = "请上传:" + (_filerestrict.FileExtension.IsNoNull() ? ("文件类型:" + _filerestrict.FileExtension) : "") + ((_filerestrict.FileMaxSize > 0) ? ((_filerestrict.FileExtension.IsNoNull() ? "," : "") + "文件必须小于" + ((int)(_filerestrict.FileMaxSize * 0x400)).RenderFileSize()) : ""); } resource_filerestrictpic _filerestrictpic = (from s in _filerestrict.resource_filerestrictpic orderby s.ImageWidth descending select s).FirstOrDefault <resource_filerestrictpic>(); if ((_filerestrictpic != null) && (_filerestrictpic.ImageWidth > 0)) { object obj2 = str3; str3 = string.Concat(new object[] { obj2, ",尺寸:", _filerestrictpic.ImageWidth, " x ", _filerestrictpic.ImageHeight }); } if (!string.IsNullOrWhiteSpace(str3)) { builder.AppendFormat("'{0}':'{1}',", "fileTypeDesc", str3); } } builder.AppendFormat("'{0}':'{1}',", "fileObjName", this.FileObjName); builder.AppendFormat("'{0}':'{1}',", "width", this.Width.Value); builder.AppendFormat("'{0}':'{1}',", "height", this.Height.Value); builder.AppendFormat("'{0}':{1},", "onUploadSuccess", this.OnUploadSuccess); string onUploadError = " function(file, errorCode, errorMsg, errorString) { alert('文件:' + file.name + ' 上传失败: ' + errorString)}"; if (!string.IsNullOrWhiteSpace(this.OnUploadError)) { onUploadError = this.OnUploadError; } builder.AppendFormat("'{0}':{1}", "onUploadError", onUploadError); builder.AppendLine("});"); builder.AppendLine("},10);"); builder.AppendLine("});"); writer.Write(builder.ToString()); writer.RenderEndTag(); }
private void ValidationInit() { if ((this.ValidationGroup.IsNoNull() && this.ResourceCode.IsNoNull()) && this.RestrictCode.IsNoNull()) { FileResourceRule rule = new FileResourceRule(); resource_filerestrict _filerestrict = rule.resource_filerestrict.Where("it.RestrictCode='" + this.RestrictCode + "' and it.resource_fileresource.FileResourceCode='" + this.ResourceCode + "'", new ObjectParameter[0]).Include("resource_filestoragepath").Include("resource_filerestrictpic").FirstOrDefault <resource_filerestrict>(); if (_filerestrict == null) { SysAssert.InfoHintAssert("找不到此文件配置"); } if (_filerestrict.FileExtension.IsNoNull()) { this.ValidationExpression = "(" + _filerestrict.FileExtension.Replace(',', '|') + ")$"; } if (this.HintMessage.IsNull()) { object hintMessage; if ((_filerestrict.FileMaxSize > 0) || _filerestrict.FileExtension.IsNoNull()) { this.HintMessage = (_filerestrict.FileExtension.IsNoNull() ? ("文件类型:" + _filerestrict.FileExtension) : "") + ((_filerestrict.FileMaxSize > 0) ? ((_filerestrict.FileExtension.IsNoNull() ? "," : "") + "文件必须小于" + ((int)(_filerestrict.FileMaxSize * 0x400)).RenderFileSize()) : ""); this.ErrorMessage = "请上传:" + (_filerestrict.FileExtension.IsNoNull() ? ("文件类型:" + _filerestrict.FileExtension) : "") + ((_filerestrict.FileMaxSize > 0) ? ((_filerestrict.FileExtension.IsNoNull() ? "," : "") + "文件必须小于" + ((int)(_filerestrict.FileMaxSize * 0x400)).RenderFileSize()) : ""); } resource_filerestrictpic _filerestrictpic = (from s in _filerestrict.resource_filerestrictpic orderby s.ImageWidth descending select s).FirstOrDefault <resource_filerestrictpic>(); if (_filerestrictpic != null) { if (_filerestrictpic.ImageWidth > 0) { hintMessage = this.HintMessage; this.HintMessage = string.Concat(new object[] { hintMessage, ",尺寸:", _filerestrictpic.ImageWidth, "x", _filerestrictpic.ImageHeight }); hintMessage = this.ErrorMessage; this.ErrorMessage = string.Concat(new object[] { hintMessage, ",尺寸:", _filerestrictpic.ImageWidth, "x", _filerestrictpic.ImageHeight }); } } else if ((this.ImageWidth > 0) || (this.ImageHeight > 0)) { hintMessage = this.HintMessage; this.HintMessage = string.Concat(new object[] { hintMessage, ",尺寸:", this.ImageWidth, "x", this.ImageHeight, (this.ImageRange > 0) ? (",误差:" + this.ImageRange) : "" }); hintMessage = this.ErrorMessage; this.ErrorMessage = string.Concat(new object[] { hintMessage, ",尺寸:", this.ImageWidth, "x", this.ImageHeight, (this.ImageRange > 0) ? (",误差:" + this.ImageRange) : "" }); } } if (!string.IsNullOrEmpty(this.ValidationGroup)) { base.Attributes.Add("ValidationGroup", this.ValidationGroup); } else { base.Attributes.Remove("ValidationGroup"); } if (!string.IsNullOrEmpty(this.ValidationExpression)) { base.Attributes.Add("ValidationExpression", this.ValidationExpression); } else { base.Attributes.Remove("ValidationExpression"); } if (!string.IsNullOrEmpty(this.ErrorMessage)) { base.Attributes.Add("ErrorMessage", this.ErrorMessage); base.Attributes.Add("onblur", "$(this).BlurValidationError(" + (this.BlurSucessCall.IsNull() ? "" : this.BlurSucessCall) + ");"); } else { base.Attributes.Remove("ErrorMessage"); base.Attributes.Remove("onblur"); } if (!string.IsNullOrEmpty(this.HintMessage)) { base.Attributes.Add("HintMessage", this.HintMessage); base.Attributes.Add("onfocus", "$(this).FocusValidationHint();"); } else { base.Attributes.Remove("HintMessage"); base.Attributes.Remove("onfocus"); } if (this.MessageWidth != 0) { base.Attributes.Add("MessageWidth", this.MessageWidth.ToString()); } else { base.Attributes.Remove("MessageWidth"); } if (this.CheckValueEmpty) { base.Attributes.Add("CheckValueEmpty", this.CheckValueEmpty.ToString()); } else { base.Attributes.Remove("CheckValueEmpty"); } } }
public void Save() { if (base.HasFile) { ResourceInfo info; ResourceRule rule = new ResourceRule(); string fileExtension = Path.GetExtension(base.FileName).ToLower(); SysAssert.InfoHintAssert(!string.IsNullOrEmpty(this.FileExtension) && (this.FileExtension.IndexOf(fileExtension.Trim(new char[] { '.' })) == -1), "上传的文件扩展名必须是" + this.FileExtension); SysAssert.InfoHintAssert((this.MaxFileSize > 0) && ((((double)base.PostedFile.ContentLength) / 1024.0) > this.MaxFileSize), "对不起支持上传的文件大小为" + ((int)(this.MaxFileSize * 0x400)).RenderFileSize() + "当前的文件大小超出"); if (this.ResourceID.IsNull()) { SysAssert.CheckCondition(this.ResourceTypeID <= 0, "请选择资源类型参数标识", LogModuleType.ResourceLog); if (this.ResourceName.IsNull()) { this.ResourceName = "类型:" + this.ResourceTypeID + base.FileName; } this.ResourceID = rule.InsertResource(this.ResourceName, this.ResourceTypeID); } else { if (this.ResourceName.IsNull()) { this.ResourceName = "类型:" + this.ResourceTypeID + base.FileName; } rule.CheckResourceID(this.ResourceID, this.ResourceName, this.ResourceTypeID); } if (base.PostedFile.ContentType.IndexOf("image") != -1) { System.Drawing.Image image; if (this.FileVers.Count > 0) { this._MoveResourceInfo = new List <ResourceInfo>(); foreach (FileVerInfo info2 in this.FileVers) { Stream stream; if (info2.VerNo == 0) { info2.VerNo = rule.GetResourceMaxVerNo(this.ResourceID, this.BeginVerNo, this.EndVerNo); } image = base.PostedFile.InputStream.StreamToImage(); if ((info2.ImageWidth > 0) && (info2.ImageHeight > 0)) { if ((image.Width > info2.ImageWidth) || (image.Height > info2.ImageHeight)) { image = image.CreateThumbnail("<=" + info2.ImageWidth.ToString(), "<=" + info2.ImageHeight.ToString()); this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), info2.VerNo, this.Remark)); } else { stream = image.ImageToStream(fileExtension); this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", stream, info2.VerNo, this.Remark)); } } else { stream = image.ImageToStream(fileExtension); this._MoveResourceInfo.Add(rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", stream, info2.VerNo, this.Remark)); } image.Dispose(); } return; } if (this.CreateWaterMark && (fileExtension != ".gif")) { image = base.PostedFile.InputStream.StreamToImage(); if (((this.ImageWidth > 0) && (this.ImageHeight > 0)) && ((image.Width > this.ImageWidth) || (image.Height > this.ImageHeight))) { image = image.CreateThumbnail("<=" + this.ImageWidth.ToString(), "<=" + this.ImageHeight.ToString()); } if (this.WatermarkTypeValue == WatermarkType.WaterText) { SysAssert.CheckCondition(string.IsNullOrEmpty(this.WatermarkText), "请输入水印的文本", LogModuleType.ResourceLog); image = image.CreateWatermark(this.WatermarkText, this.WatermarkHorizontalAlign, this.WatermarkVerticalAlign); } info = rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, this.BeginVerNo, this.EndVerNo), this.Remark); image.Dispose(); } else if ((this.ImageWidth > 0) && (this.ImageHeight > 0)) { image = base.PostedFile.InputStream.StreamToImage(); if ((this.ImageWidth > 0) && (this.ImageHeight > 0)) { if ((image.Width > this.ImageWidth) || (image.Height > this.ImageHeight)) { image = image.CreateThumbnail("<=" + this.ImageWidth.ToString(), "<=" + this.ImageHeight.ToString()); info = rule.InsertResourceVer(this.ResourceID, Path.GetFileName(base.PostedFile.FileName), base.PostedFile.ContentLength, base.PostedFile.ContentType, "admin", image.ImageToStream(fileExtension), (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, this.BeginVerNo, this.EndVerNo), this.Remark); } else { info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, this.BeginVerNo, this.EndVerNo), "admin", base.PostedFile, this.Remark); } } else { info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, this.BeginVerNo, this.EndVerNo), "admin", base.PostedFile, this.Remark); } image.Dispose(); } else { info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, this.BeginVerNo, this.EndVerNo), "admin", base.PostedFile, this.Remark); } } else { info = rule.InsertResourceVer(this.ResourceID, (this.VerNo != 0) ? this.VerNo : rule.GetResourceMaxVerNo(this.ResourceID, this.BeginVerNo, this.EndVerNo), "admin", base.PostedFile, this.Remark); } this.ResourceID = info.ResourceID; this.ResourcePath = info.ResourcePath; this.VerNo = info.VerNo; } }
public ResourceInfo InsertResourceVer(string resourceID, string resourceFileName, int resourceSize, string contentType, string account, Stream objStream, int verNo, string remark) { string resourceVerID = Guid.NewGuid().ToString(); resourceFileName.CheckIsNull("资源文件名为空", LogModuleType.ResourceLog); contentType.CheckIsNull("资源文件类型为空", LogModuleType.ResourceLog); account.CheckIsNull("帐号为空", LogModuleType.ResourceLog); SysAssert.CheckCondition((objStream == null) || (objStream.Length == 0L), "资源流为空", LogModuleType.ResourceLog); SysAssert.CheckCondition(verNo <= 0, "版本号小于零", LogModuleType.ResourceLog); this.DeleteResource(resourceID, verNo.ToString()); SysAssert.CheckCondition(resourceID.IsNull(), "资源类型标识不为空", LogModuleType.ResourceLog); WTF.Resource.Entity.Sys_Resource objResource = this.CurrentEntities.sys_resource.Where(" it.ResourceID == '" + resourceID.ToString() + "'", new ObjectParameter[0]).Include("Sys_ResourceType").First <WTF.Resource.Entity.Sys_Resource>(); DateTime now = DateTime.Now; WTF.Resource.Entity.Sys_ResourcePath path = this.CurrentEntities.sys_resourcepath.First <WTF.Resource.Entity.Sys_ResourcePath>(s => s.ResourcePathID == objResource.Sys_ResourceType.ResourcePathID); string resourceGUIDFileName = Guid.NewGuid() + Path.GetExtension(resourceFileName); string pathFormatValue = this.GetResourcePathFormatValue(now, resourceVerID, objResource.Sys_ResourceType.PathFormatCodeType); string resourcePath = this.GetResourceURL(path.VirtualName, (AccessModeCodeType)objResource.Sys_ResourceType.AccessModeCodeType, objResource.Sys_ResourceType.ResourceTypeCode, pathFormatValue, resourceGUIDFileName, resourceFileName, resourceVerID); string fileNamePath = this.GetresourceFullFileNamePath(path.StoragePath, (AccessModeCodeType)objResource.Sys_ResourceType.AccessModeCodeType, objResource.Sys_ResourceType.ResourceTypeCode, pathFormatValue, resourceGUIDFileName, resourceFileName, true); string str6 = this.GetDirectoryPath((AccessModeCodeType)objResource.Sys_ResourceType.AccessModeCodeType, objResource.Sys_ResourceType.ResourceTypeCode, pathFormatValue, resourceGUIDFileName, resourceFileName); WTF.Resource.Entity.Sys_ResourceVer entity = new WTF.Resource.Entity.Sys_ResourceVer { ResourceVerID = resourceVerID, ResourceSize = resourceSize, ResourcePath = resourcePath, DictionaryPath = str6, ResourceGUIDFileName = resourceGUIDFileName, ResourceFileName = resourceFileName, VerNo = verNo, CreateDateTime = now, ContentType = contentType, UpdateDateTime = now, Account = account, RefCount = 1, Remark = remark }; objResource.VerCount++; byte[] fileByteData = new BinaryReader(objStream).ReadBytes((int)objStream.Length); if (objResource.Sys_ResourceType.StorageType != 1) { WTF.Resource.Entity.Sys_ResourceData data = new WTF.Resource.Entity.Sys_ResourceData { ResourceVerID = resourceVerID, ResourceData = fileByteData, FileExtension = Path.GetExtension(resourceFileName) }; entity.Sys_ResourceData = data; } objResource.Sys_ResourceVer.Add(entity); this.CurrentEntities.SaveChanges(); if (objResource.Sys_ResourceType.StorageType != 2) { fileByteData.CreateFile(fileNamePath, true); } if (objStream != null) { objStream.Close(); } return(new ResourceInfo(resourceID, resourceVerID, verNo, resourcePath, fileNamePath, resourceFileName)); }
public WTF.Resource.Entity.Sys_ResourceRestrict GetResourceRestrict(int resourceTypeID, string restrictCode) { WTF.Resource.Entity.Sys_ResourceRestrict instance = this.Sys_ResourceRestrict.Where(string.Concat(new object[] { "it.ResourceTypeID=", resourceTypeID, " and it.RestrictCode='", restrictCode, "'" }), new ObjectParameter[0]).Include("Sys_ResourceRestrictPic").ToList <WTF.Resource.Entity.Sys_ResourceRestrict>().FirstOrDefault <WTF.Resource.Entity.Sys_ResourceRestrict>(); SysAssert.CheckCondition(instance.IsNull(), string.Concat(new object[] { "请正确传入的资源类型标识:", resourceTypeID, ",限制码", restrictCode }), LogModuleType.ResourceLog); return(instance); }