本文整理汇总了C#中Microblog.insert方法的典型用法代码示例。如果您正苦于以下问题:C# Microblog.insert方法的具体用法?C# Microblog.insert怎么用?C# Microblog.insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microblog
的用法示例。
在下文中一共展示了Microblog.insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Insert
public virtual void Insert( Microblog blog, int i )
{
String rcontent = blog.Content;
MicroblogBinder smbinder = new MicroblogBinder();
MicroblogParser mp = new MicroblogParser( blog.Content, smbinder );
mp.Process();
blog.Content = mp.ToString();
blog.Content = processEmotions( blog.Content );
Result result = blog.insert();
if( i==0 ) {
// ����tag
TagService.SaveDataTag( blog, mp.GetTagList() );
// ��֪ͨ
addNotification( smbinder.GetValidUsers(), blog );
}
// ת����Ҫˢ��ԭ����ת����
if (blog.ParentId > 0) {
Microblog parent = GetById( blog.ParentId );
if (parent != null) {
parent.Reposts = Microblog.count( "ParentId=" + parent.Id );
parent.update( "Reposts" );
}
}
if (result.IsValid) addFeedInfo( blog );
}
示例2: Insert
public virtual void Insert( Microblog blog, int i )
{
String rcontent = blog.Content;
MicroblogBinder smbinder = new MicroblogBinder();
//�ȱ���ԭʼ��content��ͬ������Ҫ
string statusText = blog.Content;
MicroblogParser mp = new MicroblogParser( blog.Content, smbinder );
mp.Process();
blog.Content = mp.ToString();
blog.Content = processEmotions( blog.Content );
Result result = blog.insert();
if( i==0 ) {
// ����tag
TagService.SaveDataTag( blog, mp.GetTagList() );
// ��֪ͨ
addNotification( smbinder.GetValidUsers(), blog );
}
// ת����Ҫˢ��ԭ����ת����
if (blog.ParentId > 0) {
Microblog parent = GetById( blog.ParentId );
if (parent != null) {
parent.Reposts = Microblog.count( "ParentId=" + parent.Id );
parent.update( "Reposts" );
}
}
if (result.IsValid) {
addFeedInfo(blog);
//�������ת�������Ǿ�ͬ��
if (blog.ParentId == 0)
{
string picUrl = string.IsNullOrEmpty(blog.PicOriginal) ? null : PathHelper.Map(blog.PicOriginal);
if (string.IsNullOrEmpty(picUrl))
MicroblogSyncManager.Instance.Sync(blog.User, statusText);
else
MicroblogSyncManager.Instance.SyncWithPic(blog.User, statusText, picUrl);
}
}
}
示例3: AddSimple
/// <summary>
/// 纯粹插入数据库,不检查表情、at用户、不处理tag;不处理转发
/// </summary>
/// <param name="creator"></param>
/// <param name="msg"></param>
/// <param name="dataType"></param>
/// <param name="dataId"></param>
/// <param name="ip"></param>
public virtual void AddSimple(User creator, string msg, string dataType, long dataId, string ip)
{
Microblog x = new Microblog();
x.User = creator;
x.Content = msg;
x.Ip = ip;
x.DataType = dataType;
x.DataId = dataId;
x.insert();
}
示例4: AddSimplePrivate
/// <summary>
/// 不展示在信息流中的数据,可以供管理员和自己查看,但朋友看不到
/// </summary>
/// <param name="creator"></param>
/// <param name="msg"></param>
/// <param name="dataType"></param>
/// <param name="dataId"></param>
/// <param name="ip"></param>
public virtual void AddSimplePrivate( User creator, String msg, String dataType, int dataId, String ip )
{
Microblog x = new Microblog();
x.User = creator;
x.Content = msg;
x.Ip = ip;
x.DataType = dataType;
x.DataId = dataId;
x.SaveStatus = SaveStatus.Private;
x.insert();
}