温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:Maolz个人展示网站源码
当前文件:
maolz/SubSonicDAL/MySiteProvider/Custom/Tag.cs[1K,2009-6-12 11:47:17],打开代码结构图
maolz/SubSonicDAL/MySiteProvider/Custom/Tag.cs[1K,2009-6-12 11:47:17],打开代码结构图1using System; 2
using System.Text; 3
using System.Data; 4
using System.Data.SqlClient; 5
using System.Data.Common; 6
using System.Collections; 7
using System.Collections.Generic; 8
using System.ComponentModel; 9
using System.Configuration; 10
using System.Xml; 11
using System.Xml.Serialization; 12
using SubSonic; 13
using SubSonic.Utilities; 14
15
namespace SubSonic.Generated 16
{ 17
using MySite.Utils; 18
public partial class Tag 19
{ 20
/// <summary> 21
/// 输入Tag集的字符串,将Tag集进行切割,并将新的tag储存到tags表中,对原来的tag进行更新,返回输入的tag的集合 22
/// </summary> 23
/// <param name="tags"></param> 24
/// <returns></returns> 25
public static TagCollection UpdateAndReturnTags(string tags) 26
{ 27
string[] strs = tags.Trim().Split(Constant.tagSeparator, StringSplitOptions.RemoveEmptyEntries); 28
TagCollection tagColl = new TagCollection(); 29
foreach (string str in strs) 30
{ 31
Tag tag = new Tag(Tag.Columns.Name, str); 32
if (tag.IsNew) 33
{ 34
tag.Name = str; 35
tag.UseTimes = 1; 36
} 37
else 38
{ 39
tag.UseTimes += 1; 40
} 41
tag.Save(); 42
tagColl.Add(tag); 43
} 44
return tagColl; 45
} 46
} 47
48
} 49
50






}