Пример #1
0
        public static void AddUserVLan(int userId, UserVlan vLan)
        {
            UserInfo user = GetUser(userId);

            //
            if (user == null)
            {
                throw new ApplicationException(String.Format("User with UserID={0} not found", userId));
            }

            XDocument doc   = XDocument.Parse(user.AdditionalParams ?? userAdditionalParamsTemplate);
            XElement  vlans = doc.Root.Element("VLans");

            vlans.Add(new XElement("VLan", new XAttribute("VLanID", vLan.VLanID), new XAttribute("Comment", vLan.Comment)));

            user.AdditionalParams = doc.ToString();
            UpdateUser(user);
        }
Пример #2
0
 public void AddUserVLan(int userId, UserVlan vLan)
 {
     UserController.AddUserVLan(userId, vLan);
 }