日期:2014-05-17 浏览次数:20627 次
/// <summary>
/// 专辑文档添加
/// 被引用:AdminController.LibIndex:Post
/// </summary>
/// <param name="guidArr">文章Guid数组</param>
/// <param name="newAlbId">专辑ID</param>
public static void DocAddToAlb(string[] guidArr, int newAlbId)
{
using (var db = new WEBVODEntities())
{
for (int i = 0; i < guidArr.Length; i++)
{
LibAlbumDoc albumDoc = new LibAlbumDoc();
albumDoc.LibGuid = guidArr[i];
albumDoc.AlbumId = newAlbId;
albumDoc.PubDate = DateTime.Now;
albumDoc.LoginName = "admin"; //!!!用户名,以后要修改的。
db.LibAlbumDoc.AddObject(albumDoc);
}
db.SaveChanges(); //在这里就错误了。
}
}