Exemple #1
0
        public void CreateMsg(string text,
                              Guid?chatID,
                              Guid userID,
                              string username)
        {
            DateTime datetimenow = TimeZoneManager.DateTimeNow;

            using (Searchwar_netEntities db = new Searchwar_netEntities())
            {
                SW_chat chate = null;

                if (!chatID.HasValue)
                {
                    chate               = new SW_chat();
                    chate.ChatId        = Guid.NewGuid();
                    chate.ChatDateAdded = datetimenow;
                    chate.ChatDateEdit  = datetimenow;
                    chate.ChatIsClosed  = false;

                    db.SW_chat.AddObject(chate);
                    db.SaveChanges();
                }
                else
                {
                    chate = db.SW_chat.SingleOrDefault(c => c.ChatId == chatID);
                    chate.ChatDateEdit = datetimenow;
                    chate.ChatIsClosed = false;
                }

                if (chate != null)
                {
                    SW_ChatPerson createPerson = db.SW_ChatPersons.SingleOrDefault(p => p.ChatPersonId == userID);

                    if (createPerson == null)
                    {
                        createPerson = new SW_ChatPerson();
                        createPerson.ChatPersonId   = userID;
                        createPerson.ChatPersonName = Membership.GetUser(userID) != null?Membership.GetUser(userID).UserName : username;

                        createPerson.ChatPersonDateAdded = datetimenow;
                        createPerson.ChatPersonDateEdit  = datetimenow;

                        db.SW_ChatPersons.AddObject(createPerson);
                        db.SaveChanges();
                    }

                    SW_ChatMessage createText = new SW_ChatMessage();
                    createText.ChatId           = chatID.Value;
                    createText.ChatMsgId        = Guid.NewGuid();
                    createText.ChatPersonId     = createPerson.ChatPersonId;
                    createText.ChatMsgText      = text;
                    createText.ChatMsgDateAdded = datetimenow;

                    db.SW_ChatMessages.AddObject(createText);
                    db.SaveChanges();
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Insert SiteMapNodeRoles to cSiteMapNode
        /// (Insert RoleIds with AddRoleId) (Remove RoleIds with RemoveRoleId)
        ///
        /// Needed to know what cSiteMapNode you want to Insert SiteMapNodeRoles to!
        /// (Insert SiteMapNodeIdsToList with AddSiteMapNodeId) (Remove SiteMapNodeIds with RemoveSiteMapNodeIdFromList)
        /// </summary>
        /// <param name="userId">Insert UserId</param>
        /// <param name="siteMapNodeId">Insert siteMapNodeId</param>
        public void AddAllSiteMapNodeRoles(Guid userId, int siteMapNodeId)
        {
            DateTime dateTimeNow = TimeZoneManager.DateTimeNow;
            List <SW_SiteMapNodeRole> listOfAddedSiteMapNodeRoles;


            // using statement free the memory after metode is done
            using (Searchwar_netEntities db = new Searchwar_netEntities())
            {
                // Check Added RoleIds for empty
                if (_roleIds.Count() != 0)
                {
                    listOfAddedSiteMapNodeRoles = new List <SW_SiteMapNodeRole>();

                    foreach (Guid roleId in _roleIds)
                    {
                        aspnet_Role getRoleId = (db.aspnet_Roles.Where(r => r.RoleId.Equals(roleId))).SingleOrDefault();

                        // Check roleid in database
                        if (getRoleId != null)
                        {
                            SW_SiteMapNode getCurrentSiteMapNode = (db.SW_SiteMapNode.Where(
                                                                        s => s.SiteMapNodeId.Equals(siteMapNodeId))).SingleOrDefault();

                            // Check roleid in database
                            if (getCurrentSiteMapNode != null)
                            {
                                SW_SiteMapNodeRole createRoleToSiteMapNode = new SW_SiteMapNodeRole
                                {
                                    SiteMapNodeRoleAddedDate =
                                        dateTimeNow,
                                    SiteMapNodeRoleAddedUserId =
                                        userId,
                                    RoleId        = roleId,
                                    SiteMapNodeId = siteMapNodeId
                                };

                                listOfAddedSiteMapNodeRoles.Add(createRoleToSiteMapNode);
                            }
                            else
                            {
                                throw (new ArgumentNullException("siteMapNodeId", "Cant find siteMapNodeId '" + siteMapNodeId + "' in database"));
                            }
                        }
                        else
                        {
                            throw (new ArgumentNullException("roleId", "Cant find RoleId '" + roleId + "' in database"));
                        }
                    }

                    foreach (var item in listOfAddedSiteMapNodeRoles)
                    {
                        db.SW_SiteMapNodeRoles.AddObject(item);
                    }
                }

                db.SaveChanges();
            }
        }
Exemple #3
0
        public void OpenChat(Guid chatID)
        {
            DateTime datetimenow     = TimeZoneManager.DateTimeNow;
            Searchwar_netEntities db = new Searchwar_netEntities();

            SW_chat chatobj = db.SW_chat.SingleOrDefault(c => c.ChatId == chatID);

            if (chatobj != null)
            {
                chatobj.ChatIsClosed = false;
                chatobj.ChatDateEdit = datetimenow;
            }

            db.SaveChanges();
        }
Exemple #4
0
        /// <summary>
        /// Update MetaTags to a cSiteMapNode
        /// </summary>
        /// <param name="metaTagsId">Insert SiteMapNodeId</param>
        /// <param name="langId">Insert LangId</param>
        /// <param name="metaTagTitle">Insert Title</param>
        /// <param name="metaTagDescription">Insert Desc</param>
        /// <param name="metaTagKeywords">Insert keywords like "word, word, word"</param>
        /// <param name="metaTagLanguage">Insert lang like "da" or "en"</param>
        /// <param name="metaTagAuthor">Insert author</param>
        /// <param name="metaTagPublisher">Insert publisher</param>
        /// <param name="metaTagCopyright">Insert Copyright</param>
        /// <param name="metaTagRevisitAfter">Insert Revisitafter like "7 days"</param>
        /// <param name="metaTagRobots">Insert Robots like "index,follow"</param>
        /// <param name="metaTagCache">Insert cache like "no-cache"</param>
        /// <param name="metaTagCacheControl">Insert cachecontrol like "no-cache"</param>
        /// <param name="newLangId">Insert newLangId</param>
        /// <param name="userId">Insert UserId</param>
        public void UpdateMetaTags(int metaTagsId,
                                   int langId,
                                   string metaTagTitle,
                                   string metaTagDescription,
                                   string metaTagKeywords,
                                   string metaTagLanguage,
                                   string metaTagAuthor,
                                   string metaTagPublisher,
                                   string metaTagCopyright,
                                   string metaTagRevisitAfter,
                                   string metaTagRobots,
                                   string metaTagCache,
                                   string metaTagCacheControl,
                                   int?newLangId,
                                   Guid userId)
        {
            DateTime dateTimeNow = TimeZoneManager.DateTimeNow;


            // using statement free the memory after metode is done
            using (Searchwar_netEntities db = new Searchwar_netEntities())
            {
                SW_SiteMapNodeMetaTag updateMeta = db.SW_SiteMapNodeMetaTags.Single <SW_SiteMapNodeMetaTag>(m => m.MetaTagsId.Equals(metaTagsId));
                updateMeta.MetaTagsEditUserId = userId;
                updateMeta.MetaTagsEditDate   = dateTimeNow;

                SW_SiteMapNodeMetaTagsData updateMetaData = updateMeta.SW_SiteMapNodeMetaTagsData.Single <SW_SiteMapNodeMetaTagsData>(d => d.MetaTagsId.Equals(metaTagsId) && d.LangId.Equals(langId));
                updateMetaData.MetaTagsTitle        = metaTagTitle;
                updateMetaData.MetaTagsDescription  = metaTagDescription;
                updateMetaData.MetaTagsKeywords     = metaTagKeywords;
                updateMetaData.MetaTagsLanguage     = metaTagLanguage;
                updateMetaData.MetaTagsAuthor       = metaTagAuthor;
                updateMetaData.MetaTagsPublisher    = metaTagPublisher;
                updateMetaData.MetaTagsCopyright    = metaTagCopyright;
                updateMetaData.MetaTagsRevisitAfter = metaTagRevisitAfter;
                updateMetaData.MetaTagsRobots       = metaTagRobots;
                updateMetaData.MetaTagsCache        = metaTagCache;
                updateMetaData.MetaTagsCacheControl = metaTagCacheControl;
                if (newLangId.HasValue)
                {
                    updateMetaData.LangId = newLangId.Value;
                }


                db.SaveChanges();
            }
        }
Exemple #5
0
        public void CloseChat(Guid chatID, int minutes)
        {
            DateTime datetimenow     = TimeZoneManager.DateTimeNow;
            Searchwar_netEntities db = new Searchwar_netEntities();

            SW_chat chatobj = db.SW_chat.SingleOrDefault(c => c.ChatId == chatID);

            if (chatobj != null)
            {
                if (chatobj.ChatDateEdit < datetimenow.AddMinutes(-minutes))
                {
                    chatobj.ChatIsClosed = true;
                    chatobj.ChatDateEdit = datetimenow;
                }
            }

            db.SaveChanges();
        }
Exemple #6
0
        /// <summary>
        /// Remove SiteMapNodeRoles from cSiteMapNode
        /// (Insert RoleIds with AddRoleId) (Remove RoleIds with RemoveRoleId)
        ///
        /// Needed to know what cSiteMapNode you want to delete SiteMapNodeRoles from!
        /// (Insert SiteMapNodeIds with AddSiteMapNodeIdToList) (Remove SiteMapNodeIds with RemoveSiteMapNodeIdFromList)
        /// </summary>
        public void RemoveAllSiteMapNodeRoles()
        {
            // using statement free the memory after metode is done
            using (Searchwar_netEntities db = new Searchwar_netEntities()) {
                // Check RemoveRoleIds for empty
                if (_roleIds.Count() != 0)
                {
                    // Select all SiteMapNodeRoles
                    IQueryable <SW_SiteMapNodeRole> getSiteMapNodeRoles = (from r in db.SW_SiteMapNodeRoles
                                                                           where _roleIds.Contains(r.RoleId)
                                                                           select r).AsQueryable <SW_SiteMapNodeRole>();

                    // Convert to List and Remove all SiteMapNodeRoles
                    foreach (var item in getSiteMapNodeRoles)
                    {
                        db.SW_SiteMapNodeRoles.DeleteObject(item);
                    }
                }

                db.SaveChanges();
            }
        }
        public void CreateBolig(string title,
                                string text,
                                int langid,
                                Guid UserID)
        {
            using (Searchwar_netEntities db = new Searchwar_netEntities())
            {
                SW_Blog createblog = new SW_Blog();
                createblog.BlogAddedByUserId = UserID;
                createblog.BlogEditByUserId  = UserID;
                createblog.BlogAddedDate     = TimeZoneManager.DateTimeNow;
                createblog.BlogEditDate      = TimeZoneManager.DateTimeNow;

                db.SaveChanges();

                SW_BlogData createBlogData = new SW_BlogData();
                createBlogData.BlogId    = createblog.BlogId;
                createBlogData.BlogText  = text;
                createBlogData.LangId    = langid;
                createBlogData.BlogTitle = title;

                db.SW_Blog.AddObject(createblog);
            }
        }
Exemple #8
0
        /// <summary>
        /// Insert a path in cSiteMapNode (Insert RoleIds with AddRoleId)
        /// </summary>
        /// <param name="path">Insert URL (Ex. ~/default.aspx)</param>
        /// <param name="userId">Insert UserId</param>
        /// <param name="showSiteMapNode">Show URL in menu or not? (true)Show - (false)Dont show in menu</param>
        /// <param name="siteMapNodeSubId">If you want this URL like a sub for a URL, then insert ID of the URL</param>
        /// <param name="title">Inser title of URL</param>
        /// <param name="langaugeId">Insert ID of that langauge it write in</param>
        /// <param name="metatagsObject">to add metatags to sitemap (just left it null if you dont want metatags with)</param>
        protected void CreateSiteMapNode_Single(string path,
                                                Guid userId,
                                                bool showSiteMapNode,
                                                int?siteMapNodeSubId,
                                                string title,
                                                int langaugeId,
                                                int sort,
                                                SiteMapNodeMetatagsObject m)
        {
            DateTime dateTimeNow = TimeZoneManager.DateTimeNow;

            // using statement free the memory after metode is done
            using (Searchwar_netEntities db = new Searchwar_netEntities())
            {
                SW_SiteMapNode createSiteMapNode = new SW_SiteMapNode
                {
                    SiteMapNodePath        = path,
                    SiteMapNodeAddedUserId = userId,
                    SiteMapNodeEditUserId  = userId,
                    SiteMapNodeShow        = showSiteMapNode,
                    SiteMapNodeEditDate    = dateTimeNow,
                    SiteMapNodeAddedDate   = dateTimeNow,
                    SiteMapNodeSort        = sort
                };

                SW_SiteMapNodeData createSiteMapNodeData = new SW_SiteMapNodeData
                {
                    LangId = langaugeId
                };


                // Check title for empty
                if (!string.IsNullOrEmpty(title))
                {
                    createSiteMapNodeData.SiteMapNodeTitle = title;
                }


                // Check SubId for empty
                if (siteMapNodeSubId.HasValue)
                {
                    SW_SiteMapNode siteMapNodeSub = (from s in db.SW_SiteMapNode
                                                     where s.SiteMapNodeId.Equals(siteMapNodeSubId)
                                                     select s).SingleOrDefault();

                    // Check path is in database
                    if (siteMapNodeSub != null)
                    {
                        createSiteMapNode.SiteMapNodeSubId = siteMapNodeSubId;
                    }
                    else
                    {
                        throw (new ArgumentNullException("siteMapNodeSubId", "Cant find SiteMapId '" + siteMapNodeSubId + "' in database"));
                    }
                }

                db.SW_SiteMapNode.AddObject(createSiteMapNode);
                db.SaveChanges();

                // Insert SiteMapId
                createSiteMapNodeData.SiteMapNodeId = createSiteMapNode.SiteMapNodeId;

                db.SW_SiteMapNodeData.AddObject(createSiteMapNodeData);
                db.SaveChanges();


                if (m != null)
                {
                    new SearchWar.SiteMap.MetaTags.SiteMapNodeMetaTags().CreateMetaTags(createSiteMapNode.SiteMapNodeId,
                                                                                        m.MetaTagTitle,
                                                                                        m.MetaTagDescription,
                                                                                        m.MetaTagKeywords,
                                                                                        m.MetaTagLanguage,
                                                                                        m.MetaTagAuthor,
                                                                                        m.MetaTagPublisher,
                                                                                        m.MetaTagCopyright,
                                                                                        m.MetaTagRevisitAfter,
                                                                                        m.MetaTagRobots,
                                                                                        m.MetaTagCache,
                                                                                        m.MetaTagCacheControl,
                                                                                        userId,
                                                                                        langaugeId);
                }
            }
        }
Exemple #9
0
        /// <summary>
        /// Update a path in cSiteMapNode
        /// (Insert RoleIds with AddRoleId and Remove RoleIds with RemoveRoleId)
        /// </summary>
        /// <param name="siteMapNodeId">Insert SiteMapId</param>
        /// <param name="path">Insert URL (Ex. ~/default.aspx)</param>
        /// <param name="userId">Insert UserId</param>
        /// <param name="showSiteMapNode">Show URL in menu or not? (true)Show - (false)Dont show in menu</param>
        /// <param name="siteMapNodeSubId">If you want this URL like a sub for a URL, then insert ID of the URL</param>
        /// <param name="title">Inser title of URL</param>
        /// <param name="langaugeId">Insert ID of that langauge it write in</param>
        /// <param name="newLangId">Insert newLangId</param>
        protected void UpdateSiteMap(int siteMapNodeId,
                                     int langaugeId,
                                     string path,
                                     Guid userId,
                                     bool showSiteMapNode,
                                     int?siteMapNodeSubId,
                                     string title,
                                     int?newLangId,
                                     int sort,
                                     SiteMapNodeMetatagsObject m)
        {
            DateTime dateTimeNow = TimeZoneManager.DateTimeNow;

            // using statement free the memory after metode is done
            using (Searchwar_netEntities db = new Searchwar_netEntities())
            {
                SW_SiteMapNode siteMapNode = (from s in db.SW_SiteMapNode
                                              where s.SiteMapNodeId.Equals(siteMapNodeId)
                                              select s).SingleOrDefault();

                // Check SiteMapId in database
                if (siteMapNode != null)
                {
                    siteMapNode.SiteMapNodePath       = path;
                    siteMapNode.SiteMapNodeShow       = showSiteMapNode;
                    siteMapNode.SiteMapNodeSubId      = siteMapNodeSubId;
                    siteMapNode.SiteMapNodeEditUserId = userId;
                    siteMapNode.SiteMapNodeEditDate   = dateTimeNow;
                    siteMapNode.SiteMapNodeSort       = sort;

                    SW_SiteMapNodeData siteMapNodeData = siteMapNode.SW_SiteMapNodeData.Single <SW_SiteMapNodeData>(d => d.SiteMapNodeId.Equals(siteMapNodeId) && d.LangId.Equals(langaugeId));
                    siteMapNodeData.SiteMapNodeTitle = title;
                    if (newLangId.HasValue)
                    {
                        siteMapNodeData.LangId = newLangId.Value;
                    }

                    db.SaveChanges();

                    object checkMetaTags =
                        db.SW_SiteMapNodeMetaTags.Where(mt => mt.MetaTagsId == siteMapNodeId).SingleOrDefault();

                    if (m != null && checkMetaTags != null)
                    {
                        new SearchWar.SiteMap.MetaTags.SiteMapNodeMetaTags().UpdateMetaTags(siteMapNodeId,
                                                                                            langaugeId,
                                                                                            m.MetaTagTitle,
                                                                                            m.MetaTagDescription,
                                                                                            m.MetaTagKeywords,
                                                                                            m.MetaTagLanguage,
                                                                                            m.MetaTagAuthor,
                                                                                            m.MetaTagPublisher,
                                                                                            m.MetaTagCopyright,
                                                                                            m.MetaTagRevisitAfter,
                                                                                            m.MetaTagRobots,
                                                                                            m.MetaTagCache,
                                                                                            m.MetaTagCacheControl,
                                                                                            null,
                                                                                            userId);
                    }
                }
                else
                {
                    throw (new ArgumentNullException("siteMapNodeId", "Cant find SiteMap '" + siteMapNodeId + "' in database"));
                }
            }
        }
Exemple #10
0
        /// <summary>
        /// Delete paths in SiteMapNodes
        /// </summary>
        protected void DeleteSiteMapNodes()
        {
            // using statement free the memory after metode is done
            using (Searchwar_netEntities db = new Searchwar_netEntities()) {
                // Check RemoveRoleIds for empty
                if (_siteMapNodeIds.Count() > 0)
                {
                    IQueryable <SW_SiteMapNode> deleteSiteMapNodes = (from s in db.SW_SiteMapNode
                                                                      where _siteMapNodeIds.Contains(s.SiteMapNodeId)
                                                                      select s).AsQueryable <SW_SiteMapNode>();

                    IQueryable <SW_SiteMapNodeData> deleteSiteMapNodesData = (from sd in db.SW_SiteMapNodeData
                                                                              where _siteMapNodeIds.Contains(sd.SiteMapNodeId)
                                                                              select sd).AsQueryable <SW_SiteMapNodeData>();

                    IQueryable <SW_SiteMapNodeRole> DeleteSiteMapNodesRoles = (from r in db.SW_SiteMapNodeRoles
                                                                               where _siteMapNodeIds.Contains(r.SiteMapNodeId)
                                                                               select r).AsQueryable <SW_SiteMapNodeRole>();

                    IQueryable <SW_SiteMapNodeMetaTag> deleteSiteMapNodesMetaTags = (from m in db.SW_SiteMapNodeMetaTags
                                                                                     where _siteMapNodeIds.Contains(m.MetaTagsId)
                                                                                     select m).AsQueryable <SW_SiteMapNodeMetaTag>();

                    IQueryable <SW_SiteMapNodeMetaTagsData> deleteSiteMapNodesMetaTagsData = (from md in db.SW_SiteMapNodeMetaTagsData
                                                                                              where _siteMapNodeIds.Contains(md.MetaTagsId)
                                                                                              select md).AsQueryable <SW_SiteMapNodeMetaTagsData>();

                    // Delete all SiteMapNodesMetaTagsData
                    foreach (var item in deleteSiteMapNodesMetaTagsData)
                    {
                        db.SW_SiteMapNodeMetaTagsData.DeleteObject(item);
                    }

                    // Delete all SiteMapNodesMetaTags
                    foreach (var item in deleteSiteMapNodesMetaTags)
                    {
                        db.SW_SiteMapNodeMetaTags.DeleteObject(item);
                    }

                    // Delete all SiteMapNodesRoles
                    foreach (var item in DeleteSiteMapNodesRoles)
                    {
                        db.SW_SiteMapNodeRoles.DeleteObject(item);
                    }

                    // Delete all SiteMapNodesData
                    foreach (var item in deleteSiteMapNodesData)
                    {
                        db.SW_SiteMapNodeData.DeleteObject(item);
                    }

                    // Delete all SiteMapNodes
                    foreach (var item in deleteSiteMapNodes)
                    {
                        db.SW_SiteMapNode.DeleteObject(item);
                    }

                    db.SaveChanges();
                }
            }
        }
Exemple #11
0
        /// <summary>
        /// Create MetaTags to a cSiteMapNode
        /// </summary>
        /// <param name="siteMapNodeId">Insert SiteMapNodeId</param>
        /// <param name="metaTagTitle">Insert Title</param>
        /// <param name="metaTagDescription">Insert Desc</param>
        /// <param name="metaTagKeywords">Insert keywords like "word, word, word"</param>
        /// <param name="metaTagLanguage">Insert lang like "da" or "en"</param>
        /// <param name="metaTagAuthor">Insert author</param>
        /// <param name="metaTagPublisher">Insert publisher</param>
        /// <param name="metaTagCopyright">Insert Copyright</param>
        /// <param name="metaTagRevisitAfter">Insert Revisitafter like "7 days"</param>
        /// <param name="metaTagRobots">Insert Robots like "index,follow"</param>
        /// <param name="metaTagCache">Insert cache like "no-cache"</param>
        /// <param name="metaTagCacheControl">Insert cachecontrol like "no-cache"</param>
        /// <param name="langaugeId">Insert ID of that langauge this metatags is write in</param>
        /// <param name="userId">Insert UserId</param>
        public void CreateMetaTags(int siteMapNodeId,
                                   string metaTagTitle,
                                   string metaTagDescription,
                                   string metaTagKeywords,
                                   string metaTagLanguage,
                                   string metaTagAuthor,
                                   string metaTagPublisher,
                                   string metaTagCopyright,
                                   string metaTagRevisitAfter,
                                   string metaTagRobots,
                                   string metaTagCache,
                                   string metaTagCacheControl,
                                   Guid userId,
                                   int langaugeId)
        {
            DateTime dateTimeNow = TimeZoneManager.DateTimeNow;


            // using statement free the memory after metode is done
            using (Searchwar_netEntities db = new Searchwar_netEntities())
            {
                SW_SiteMapNode getCurrentSiteMapNode = (from s in db.SW_SiteMapNode
                                                        where s.SiteMapNodeId.Equals(siteMapNodeId)
                                                        select s).SingleOrDefault();

                // Check cSiteMapNode
                if (getCurrentSiteMapNode != null)
                {
                    SW_SiteMapNodeMetaTag createMeta = new SW_SiteMapNodeMetaTag
                    {
                        MetaTagsId          = siteMapNodeId,
                        MetaTagsAddedUserId = userId,
                        MetaTagsEditUserId  = userId,
                        MetaTagsAddedDate   = dateTimeNow,
                        MetaTagsEditDate    = dateTimeNow
                    };

                    SW_SiteMapNodeMetaTagsData createMetaData = new SW_SiteMapNodeMetaTagsData
                    {
                        MetaTagsTitle        = metaTagTitle,
                        MetaTagsDescription  = metaTagDescription,
                        MetaTagsKeywords     = metaTagKeywords,
                        MetaTagsLanguage     = metaTagLanguage,
                        MetaTagsAuthor       = metaTagAuthor,
                        MetaTagsPublisher    = metaTagPublisher,
                        MetaTagsCopyright    = metaTagCopyright,
                        MetaTagsRevisitAfter = metaTagRevisitAfter,
                        MetaTagsRobots       = metaTagRobots,
                        MetaTagsCache        = metaTagCache,
                        MetaTagsCacheControl = metaTagCacheControl,
                        LangId     = langaugeId,
                        MetaTagsId = siteMapNodeId
                    };


                    db.SW_SiteMapNodeMetaTags.AddObject(createMeta);
                    db.SW_SiteMapNodeMetaTagsData.AddObject(createMetaData);
                    db.SaveChanges();
                }
                else
                {
                    throw (new ArgumentNullException("siteMapNodeId", "Cant find siteMapNodeId '" + siteMapNodeId + "' in database"));
                }
            }
        }