public void AddNodeToCustomer(Node node, Int32 customerID)
        {
            repo.AddNodeToCustomer(node, customerID);
            repo.SaveChanges();

            this.Clients.Group("nodes").refreshNodes(repo.GetNodes());
            this.Clients.Group("nodes.CustomerID:" + customerID).refreshNodes(repo.GetCustomerNodes(customerID));
        }
        public void UpdateNode(Node node)
        {
            repo.UpdateNode(node);
            repo.SaveChanges();

            this.Clients.Group("nodes").refreshNodes();
            this.Clients.Group("nodes.CustomerID:" + node.CustomerID).returnUpdateNode(node);
        }
        public static IEnumerable<Customer> CreateTestCustomer_Mem()
        {
            // Preparation
            var customer = new Customer();
            var contact1 = new Contact();
            var contact2 = new Contact();
            var node1 = new Node();
            var node2 = new Node();
            var node3 = new Node();
            var credential1 = new Credential();
            var credential2 = new Credential();
            var credential3 = new Credential();

            // Build customer
            customer.Name = "Test Customer";
            customer.Symbol = "ASA";

            // Build contact1
            contact1.FirstName = "Anita";
            contact1.LastName = "Neal";
            contact1.Email = "*****@*****.**";
            contact1.MyCustomer = customer;

            // Build contact2
            contact2.FirstName = "Monster";
            contact2.LastName = "Energy";
            contact2.Email = "*****@*****.**";
            contact2.MyCustomer = customer;

            // build node1
            node1.Address = "node1.billmcg.com";
            node1.Name = "Node1 is best node!";
            node1.Comment = "No comment here";
            node1.MyCustomer = customer;

            // build node2
            node2.Address = "node2.billmcg.com";
            node2.Name = "Node2 FTW!";
            node2.Comment = "Worst Connection US";
            node2.MyCustomer = customer;

            // build node3
            node2.Address = "node3.billmcg.com";
            node2.Name = "Test Server";
            node3.Comment = "Use RDP fool";
            node3.MyCustomer = customer;

            // build credential1
            credential1.Domain = "SPLITH";
            credential1.UserName = "******";
            credential1.Password = "******";

            // build credential2
            credential2.Domain = "AURORA_NT";
            credential2.UserName = "******";
            credential2.Password = "******";

            // build credential3
            credential3.Domain = "AURORA_NT";
            credential3.UserName = "******";
            credential3.Password = "******";

            // assembly
            customer.Contacts.Add(contact1);
            customer.Contacts.Add(contact2);

            customer.Credentials.Add(credential2);
            customer.Credentials.Add(credential3);

            customer.Nodes.Add(node1);
            customer.Nodes.Add(node2);
            customer.Nodes.Add(node3);

            node1.Credentials.Add(credential1);

            return new List<Customer>(new Customer[] { customer });
        }