public AssetAddForm() { InitializeComponent(); damService = MainForm.GetDamService(); platService = MainForm.GetPlatService(); platUserService = MainForm.GetPlatUserService(); // 设置责任人 WSUserArray userList = platUserService.queryAllUser(new long[] { 1 }); if (userList.errorCode == 0) { if (userList.userArray == null || userList.userArray.Length == 0) { MessageBox.Show("系统中必须至少存在一个平台用户"); } else { foreach (User user in userList.userArray) { CombItem item = new CombItem(user.userName, user.id.Value); this.comboBoxResponser.Items.Add(item); } } } else { MessageBox.Show("查询平台用户失败"); } this.comboBoxResponser.SelectedIndex = 0; // 设置计算机类型 this.comboBoxComputerType.Items.AddRange(new object[] { "pc", "laptop", "workstation", "server", "other"}); this.comboBoxComputerType.SelectedIndex = 0; // 设置资产分组 queryAssetGroupResponse response = damService.queryAssetGroup(); if ([email protected] == 0) { foreach (RetAssetGroupInfo groupInfo in [email protected]) { CombItem item = new CombItem(groupInfo.groupName, groupInfo.groupId.Value); this.comboBoxGroupID.Items.Add(item); } this.comboBoxGroupID.SelectedIndex = 0; } else { MessageBox.Show("无法获取资产分组信息"); } this.buttonOK.DialogResult = DialogResult.OK; this.buttonCancel.DialogResult = DialogResult.Cancel; }
public AssetGroupListForm(UamWebService.MainForm parent) { InitializeComponent(); this.MdiParent = parent; DataGridViewRowCollection rows = this.dataGridView.Rows; damService = MainForm.GetDamService(); queryAssetGroupResponse response = damService.queryAssetGroup(); foreach(RetAssetGroupInfo groupInfo in [email protected]){ String[] row = new string[3]; row[0] = groupInfo.groupId.ToString(); row[1] = groupInfo.groupName; row[2] = groupInfo.groupDescription; rows.Add(row); } //string[] row0 = { "123", "29"}; //string[] row1 = { "456", "30" }; //DataGridViewRowCollection rows = this.dataGridView.Rows; //rows.Add(row0); //rows.Add(row1); }