コード例 #1
0
 private void initDaos()
 {
     if (currentPath == null)
     {
         return;
     }
     maquinarioDao    = new MaquinarioDAO(currentPath);
     combustiveisDao  = new CombustiveisDAO(currentPath);
     pastagemDao      = new PastagemDAO(currentPath);
     tipoPastagemDao  = new TipoPastagemDAO(currentPath);
     gastosDao        = new GastosDAO(currentPath);
     unidadeAnimalDao = new UnidadeAnimalDAO(currentPath);
 }
コード例 #2
0
        public TipoPastageUserControl(string id = null)
        {
            InitializeComponent();
            currentID       = -1;
            tipoPastagemDao = new TipoPastagemDAO(MainWindow.currentPath);

            if (id != null)
            {
                currentID           = int.Parse(id);
                currentTipoPastagem = tipoPastagemDao.selectById(int.Parse(id));
                textBox1.Text       = currentTipoPastagem.nome;
            }
        }
コード例 #3
0
        public PastagemUserControl(string id = null)
        {
            InitializeComponent();
            currentID                    = -1;
            currentPastagemDao           = new PastagemDAO(MainWindow.currentPath);
            currentTipoPastagemDao       = new TipoPastagemDAO(MainWindow.currentPath);
            tipoPastoComboBox.DataSource = currentTipoPastagemDao.selectIdAndString().Values.ToArray();

            if (id != null)
            {
                currentID                       = int.Parse(id);
                currentPastagem                 = currentPastagemDao.selectById(currentID);
                nomePastoTextBox.Text           = currentPastagem.nome;
                areaUtilTextBox.Text            = currentPastagem.areaUtil.ToString();
                tipoPastoComboBox.SelectedIndex = currentPastagem.tipoPastagemID;
            }
        }