コード例 #1
0
        public bool InserirNomes(Flores item)
        {
            if (string.IsNullOrWhiteSpace(item.Nome))
            {
                return(false);
            }

            FloresContext.Flores.Add(item);
            FloresContext.SaveChanges();

            return(true);
        }
コード例 #2
0
 public bool AdicionarFlores(Flores item)
 {
     if (string.IsNullOrWhiteSpace(item.Nome))
     {
         return(false);
     }
     if (item.Quantidade <= 0)
     {
         return(false);
     }
     contextDB.Flores.Add(item);
     contextDB.SaveChanges();
     return(true);
 }
コード例 #3
0
        public bool AddFlor(Flores item)
        {
            var retornoNome = (string.IsNullOrWhiteSpace(item.Nome));

            if (retornoNome)
            {
                return(false);
            }
            else
            {
                floresContext.Flor.Add(item);
                floresContext.SaveChanges();
                return(true);
            }
        }
コード例 #4
0
 public void AdicionarRegistro(string nome, string nomeCientifico,
                               string habitat, bool possuiPropMedicinal,
                               string propMedicinal)
 {
     Flores.Add(new Flor(nome, nomeCientifico, habitat, possuiPropMedicinal, propMedicinal));
 }
コード例 #5
0
 public void AddFlores(Flores flores)
 {
     floresContextDB.GetFlores.Add(flores);
     floresContextDB.SaveChanges();
 }
コード例 #6
0
 public void CadastrarFlor(Flores item)
 {
     contextDB.Flor.Add(item);
     contextDB.SaveChanges();
 }