Esempio n. 1
0
        private bool validateConnection(ContactConnection connection)
        {
            bool valid = true;
            ValidationDic.Clear();

            int existingConnections = _repo.QueryNetworkConnections().Where(c => (c.LeftId == connection.LeftId && c.RightId == connection.RightId) || (c.RightId == connection.LeftId && c.LeftId == connection.RightId)).Count();

            if (existingConnections > 0)
            {
                valid = false;
                ValidationDic.Add("Connection", "These Companies are already connected.");
            }

            return valid;
        }
Esempio n. 2
0
        public bool RemoveNetworkConnection(ContactConnection connection)
        {
            try
            {
                _repo.DeleteNetworkConnection(connection);
                _repo.SaveChanges();
                return true;

            }
            catch (Exception ex)
            {
                ValidationDic.Clear();
                ValidationDic.Add("Exception", ex.Message);
                return false;
            }
        }