コード例 #1
0
        private void refreshList()
        {
            if (tipoComboBox.SelectedIndex == -1)
            {
                return;
            }
            switch (tipoComboBox.SelectedIndex)
            {
            case 0:
                // DebugDLL.Debug.debug("Maq");
                referentList = maquinarioDao.selectIdAndString().Values.ToList();
                break;

            case 1:
                //  DebugDLL.Debug.debug("Comb");
                referentList = combustiveisDao.selectIdAndString().Values.ToList();
                break;

            case 2:
                // DebugDLL.Debug.debug("Past");
                referentList = pastagemDao.selectIdAndString().Values.ToList();
                break;

            case 3:
                // DebugDLL.Debug.debug("UA");
                referentList = unidadeAnimalDao.selectIdAndString().Values.ToList();
                break;

            case 4:
                // DebugDLL.Debug.debug("Outros");
                referentList = new List <string>();
                referentList.Add("Outros");
                break;
            }
            referenteComboBox.DataSource = referentList;
        }
コード例 #2
0
        public void updateTreeNodes()
        {
            treeView2.Nodes.Clear();

            #region GastosNode

            var gastosNode = new TreeNode("Gastos");
            var selectedIdAndStringFromDb = gastosDao.selectIdAndString();
            foreach (var b in selectedIdAndStringFromDb)
            {
                gastosNode.Nodes.Add(b.Key + "", b.Value);
            }
            treeView2.Nodes.Add(gastosNode);

            #endregion GastosNode

            #region MaquinarioNode

            var maquinarioNode = new TreeNode("Maquinario");
            selectedIdAndStringFromDb = maquinarioDao.selectIdAndString();
            foreach (var b in selectedIdAndStringFromDb)
            {
                maquinarioNode.Nodes.Add(b.Key + "", b.Value);
            }
            treeView2.Nodes.Add(maquinarioNode);

            #endregion MaquinarioNode

            #region CombustivelNode

            var combustivelNode = new TreeNode("Combustivel");
            selectedIdAndStringFromDb = combustiveisDao.selectIdAndString();
            foreach (var b in selectedIdAndStringFromDb)
            {
                combustivelNode.Nodes.Add(b.Key + "", b.Value);
            }
            treeView2.Nodes.Add(combustivelNode);

            #endregion CombustivelNode

            #region PastagemNode

            var pastagemNode = new TreeNode("Pastagem");
            selectedIdAndStringFromDb = pastagemDao.selectIdAndString();
            foreach (var b in selectedIdAndStringFromDb)
            {
                pastagemNode.Nodes.Add(b.Key + "", b.Value);
            }
            treeView2.Nodes.Add(pastagemNode);

            #endregion PastagemNode

            #region TipoPastagemNode

            var tipoPastagemNode = new TreeNode("Tipo de Pastagem");
            selectedIdAndStringFromDb = tipoPastagemDao.selectIdAndString();
            foreach (var b in selectedIdAndStringFromDb)
            {
                tipoPastagemNode.Nodes.Add(b.Key + "", b.Value);
            }
            treeView2.Nodes.Add(tipoPastagemNode);

            #endregion TipoPastagemNode

            #region unidadeAnimalNode

            var unidadeAnimalNode = new TreeNode("Unidade Animal");
            selectedIdAndStringFromDb = unidadeAnimalDao.selectIdAndString();
            foreach (var b in selectedIdAndStringFromDb)
            {
                unidadeAnimalNode.Nodes.Add(b.Key + "", b.Value);
            }
            treeView2.Nodes.Add(unidadeAnimalNode);

            #endregion unidadeAnimalNode
        }