private string CreateEnterpriseDomainZoneSubnet(string enterprisename) { // Create an enterprise Enterprise enterprise = new Enterprise(); enterprise.NUName = enterprisename; enterprise.NUDescription = ""; session.getMe().createChild(session, enterprise); User u1 = new User(); u1.NUUserName = "******"; u1.NUFirstName = "Patrick"; u1.NULastName = "Dumais"; u1.NUPassword = "******"; u1.NUEmail = "*****@*****.**"; enterprise.createChild(session, u1); Group g1 = new Group(); g1.NUName = "Group1"; enterprise.createChild(session, g1); g1.assign(session, new List <User>() { u1 }); return(enterprise.NUId); }
private void button4_Click(object sender, EventArgs e) { if (treeView1.SelectedNode == null || treeView1.SelectedNode.Level != 2) { MessageBox.Show("Please select a subnet in the treeview above first"); return; } Random rd = new Random(); string r = rd.Next().ToString(); string mac = maskedTextBox6.Text; VM vm = new VM(); vm.NUName = maskedTextBox5.Text; vm.NUUUID = maskedTextBox4.Text; VMInterface vmi = new VMInterface(); vmi.NUAttachedNetworkType = VMInterface.EAttachedNetworkType.SUBNET; vmi.NUAttachedNetworkID = treeView1.SelectedNode.Name; vmi.NUName = mac.Replace(':', '_'); vmi.NUMAC = mac; vm.NUInterfaces = new List <VMInterface>(); vm.NUInterfaces.Add(vmi); session.getMe().createChild(session, vm); updateVMList(); }