private void AddTag(string tagText, int PostID) { if (tagText != null) { string[] tags; tags = tagText.Split(','); List <PostTag> taglist = new List <PostTag>(); foreach (var item in tags) { PostTag tag = new PostTag(); tag.PostID = PostID; tag.TagContent = item; tag.AddDate = DateTime.Now; tag.LastUpdateDate = DateTime.Now; tag.LastUpdateUserID = UserStatic.UserID; taglist.Add(tag); } foreach (var item in taglist) { int tagID = dao.AddTag(item); LogDAO.AddLog(General.ProcessType.TagAdd, General.TableName.Tag, tagID); } } }