Пример #1
0
        private void SearchFormSt1_Load(object sender, EventArgs e)
        {
            CancelSearch = true;
            //Загрузка департаментов в дерево
            treeViewDepartments.Nodes.Clear();
            Db     = new DevicesDatabase();
            SpgNew = new SearchParametersGroup();
            var list = Db.GetDepartments(SpgNew);

            foreach (var department in list)
            {
                var node = new TreeNode
                {
                    Text = department.NodeName,
                    Tag  = new NodeProperty(department.NodeId, NodeTypeEnum.DepartmentNode)
                };
                TreeNodesHelper.AddNode(node, treeViewDepartments.Nodes, treeViewDepartments.Nodes, department.ParentNodeId);
            }

            //Загрузка типов узлов в combobox
            var view = Db.GetDeviceTypes();

            comboBoxDevTypes.DisplayMember = "DeviceType";
            for (var i = 0; i < view.Table.Rows.Count; i++)
            {
                comboBoxDevTypes.Items.Add(new DeviceTypeComboboxItem(view.Table.Rows[i]["Type"].ToString(),
                                                                      Convert.ToInt32(view.Table.Rows[i]["ID Device Type"])));
            }
        }
Пример #2
0
 public MoveComputersForm(NodeProperty np)
 {
     InitializeComponent();
     Np    = np;
     Moved = false;
     Spg   = new SearchParametersGroup();
     Db    = new DevicesDatabase();
     LoadNodes();
 }
Пример #3
0
        public MainForm(string[] args)
        {
            InitializeComponent();
            Spg = new SearchParametersGroup();
            var arguments            = args.Select(r => r.Split(new[] { '=' }, 2));
            var deviceCommandLineArg = arguments.FirstOrDefault(r => r.Length > 1 && r[0] == "--computer");

            if (deviceCommandLineArg != null)
            {
                _deviceNameCommandLineArg = deviceCommandLineArg[1];
            }
        }
Пример #4
0
 private void toolStripButton6_Click(object sender, EventArgs e)
 {
     if (toolStripButton6.Checked)
     {
         toolStripButton6.Checked = false;
         var selectedNodeProperty = (NodeProperty)treeViewComputers.SelectedNode.Tag;
         Spg = new SearchParametersGroup();
         Reload();
         SelectNodeByNodeId(treeViewComputers.Nodes, selectedNodeProperty.NodeId);
     }
     else
     {
         var sfs = new SearchFormSt1 {
             Spg = Spg
         };
         sfs.ShowDialog();
         if (!sfs.CancelSearch)
         {
             Reload(true);
             toolStripButton6.Checked = true;
         }
         sfs.Dispose();
     }
 }
Пример #5
0
 private void comboBoxDevTypes_SelectedIndexChanged(object sender, EventArgs e)
 {
     SpgNew = new SearchParametersGroup();
     InitDataGridView();
 }