예제 #1
0
        /// <summary>批量删除,根据JoinName和JoinId</summary>
        /// <param name="joinName">相关表名,即UploadConfig.JoinName</param>
        /// <param name="joinId">相关ID,即UploadConfig.JoinID</param>
        public static void Upload_BatDelPic(string joinName, int joinId)
        {
            if (string.IsNullOrEmpty(joinName) || joinId < 1)
            {
                return;
            }
            //string sql = "select Id,Path from UploadFile where JoinName='+joinName+' and JoinId=" + joinId;

            //-------------------------------------------------
            var dt = UploadFile.Find(x => x.JoinId == joinId && x.JoinName == joinName);

            foreach (var rs in dt)
            {
                DirFileHelper.DelPicFile(rs.Path);
                UploadFile.Delete(x => x.Id == rs.Id);
            }
        }