public static int AddLink(List <int> fileIDs) { // Create the link group (without setting up a memo) string insert = "Insert Into LinkMemos (dMemoCreated, dMemoUpdated) " + "Values (GetDate(), GetDate()); " + "Select Convert(int, Scope_Identity());"; int newID = (int)Db.ExecuteScalar(insert); // Add list of files to the group foreach (int id in fileIDs) { FileLinkDAL.Join(newID, id); } return(newID); }
public static int AddLink(List <int> fileIDs, string linkMemo) { // Create the link group List <SqlParameter> args = new List <SqlParameter>(); args.Add(new SqlParameter("@Memo", linkMemo)); string insert = "Insert Into LinkMemos (sLinkMemo, dMemoCreated, dMemoUpdated) " + "Values (@Memo, GetDate(), GetDate()); " + "Select Convert(int, Scope_Identity());"; int newID = (int)Db.ExecuteScalar(insert, args.ToArray()); // Add list of files to the group foreach (int id in fileIDs) { FileLinkDAL.Join(newID, id); } return(newID); }