/// <summary> /// 修改资源信息 /// </summary> /// <param name="resource">资源实体</param> /// <returns>是否成功</returns> public bool ModifyResource(Resource resource) { ResourceM r = new ResourceM(); r.Bind(resource); r.RSID.IsInc = false; r.Create_Time.IsInc = false; r.Last_Update.Value = DateTime.Now; return(r.NoLock().Where(r.RSID == resource.RSID).Update()); }
/// <summary> /// 获取某一资源信息 /// </summary> /// <param name="rsid">资源ID</param> /// <returns>资源实体</returns> public Resource GetResource(int rsid) { ResourceM r = new ResourceM(); return(r.NoLock().Where(r.RSID == rsid).SelectOne <Resource>()); }
/// <summary> /// 是否存在某资源 /// </summary> /// <param name="rsid">资源ID</param> /// <returns>是否存在</returns> public bool Exists(int rsid) { ResourceM r = new ResourceM(); return(r.NoLock().Where(r.RSID == rsid).Exists()); }