Example #1
0
        /******************************************************************** LISTAR INGREDIENTE - ALTERAR INGREDIENTE F ********************************************************************/
        public List <Ingrediente> IngredienteF()
        {
            //SqlConnection Conexao = new SqlConnection(ConfigurationManager.ConnectionStrings["BancoEstoque"].ConnectionString);
            SqlConnection Conexao = new SqlConnection("Server = DESKTOP-PHTQI5U\\SQLEXPRESS; Database = DRLTCC; Trusted_Connection = True;");

            Conexao.Open();
            SqlCommand Comando = new SqlCommand();

            Comando.Connection = Conexao;

            Comando.CommandText = "SELECT CodigoIngrediente, NomeIngrediente FROM Ingrediente;";

            SqlDataReader Leitor = Comando.ExecuteReader();

            while (Leitor.Read())
            {
                Ingrediente I = new Ingrediente();
                I.CodigoIngrediente = Convert.ToInt32(Leitor["CodigoIngrediente"].ToString());
                I.NomeIngrediente   = Leitor["NomeIngrediente"].ToString();

                Ingredientes.Add(I);
            }
            Conexao.Close();

            return(Ingredientes);
        }
Example #2
0
        private void LerIngredientes()
        {
            var valores = LerMultiplasEntradas(NumeroDeIngredientes);

            for (int i = 0; i < NumeroDeIngredientes; i++)
            {
                Ingredientes.Add(new Ingrediente(i, valores[i]));
            }
        }
Example #3
0
 public override void CriarIngredientes()
 {
     Ingredientes.Add(new Pao());
     Ingredientes.Add(new Alface());
     Ingredientes.Add(new Peru());
     Ingredientes.Add(new Maionese());
     Ingredientes.Add(new Alface());
     Ingredientes.Add(new Peru());
 }
Example #4
0
        public static void AgregarIngrediente(string nombre, int precio, int puntoDePedido, int cantidadActual)
        {
            Ingrediente ingrediente = new Ingrediente
            {
                Nombre            = nombre,
                Precio            = precio,
                PuntoPedidoMinimo = puntoDePedido,
                Cantidad          = cantidadActual
            };

            Ingredientes.Add(ingrediente);
            Guardar();
        }
        public AgrotoxicoPDF(Agrotoxico agrotoxico)
        {
            Numero            = agrotoxico.NumeroCadastro.ToString();
            NomeComercial     = agrotoxico.NomeComercial;
            NumeroProcessoSEP = agrotoxico.NumeroProcessoSep.ToString();
            TitularRegistro   = new PessoaPDF()
            {
                NomeRazaoSocial = agrotoxico.TitularRegistro.NomeRazaoSocial, CPFCNPJ = agrotoxico.TitularRegistro.CPFCNPJ
            };
            ClassificacaoToxicologica.Nome = agrotoxico.ClassificacaoToxicologica.Texto;
            Periculosidade.Nome            = agrotoxico.PericulosidadeAmbiental.Texto;

            //Classes
            foreach (var item in agrotoxico.ClassesUso)
            {
                Classes.Add(new ConfiguracaoVegetalItemPDF()
                {
                    Nome = item.Texto
                });
            }

            //Ingredientes
            foreach (var item in agrotoxico.IngredientesAtivos)
            {
                Ingredientes.Add(new ConfiguracaoVegetalItemPDF()
                {
                    Nome = item.Texto
                });
            }

            //Culturas
            foreach (var item in agrotoxico.Culturas)
            {
                Culturas.Add(new AgrotoxicoCulturaPDF()
                {
                    Nome = item.Cultura.Nome
                });
            }
        }
Example #6
0
        /******************************************************************** LISTAR INGREDIENTE ********************************************************************/
        public List <Ingrediente> ListarIngredientes()
        {
            //SqlConnection Conexao = new SqlConnection(ConfigurationManager.ConnectionStrings["BancoEstoque"].ConnectionString);
            SqlConnection Conexao = new SqlConnection("Server = DESKTOP-PHTQI5U\\SQLEXPRESS; Database = DRLTCC; Trusted_Connection = True;");

            Conexao.Open();
            SqlCommand Comando = new SqlCommand();

            Comando.Connection = Conexao;

            Comando.CommandText = "SELECT I.*, L.CodigoLote, L.NomeLote FROM Ingrediente I JOIN Lote L ON CodigoLote = FK_CodigoLote;";

            SqlDataReader Leitor = Comando.ExecuteReader();



            while (Leitor.Read())
            {
                Ingrediente I = new Ingrediente();
                I.FK_CodigoLote     = Convert.ToInt32(Leitor["FK_CodigoLote"].ToString());
                I.NomeLote          = Leitor["NomeLote"].ToString();
                I.CodigoIngrediente = Convert.ToInt32(Leitor["CodigoIngrediente"].ToString());
                I.NomeIngrediente   = Leitor["NomeIngrediente"].ToString();
                I.QtdIngrediente    = Convert.ToInt32(Leitor["QtdIngrediente"].ToString());
                I.UnidadeMedida     = Leitor["UnidadeMedida"].ToString();
                I.NivelRisco        = Convert.ToInt32(Leitor["NivelRisco"].ToString());
                I.FK_CodigoLote     = Convert.ToInt32(Leitor["FK_CodigoLote"].ToString());


                Ingredientes.Add(I);
            }
            Conexao.Close();

            teste = Ingredientes.Count();
            return(Ingredientes);
        }
Example #7
0
 public void AdicionarIngrediente(Ingrediente ingrediente)
 {
     Ingredientes.Add(ingrediente);
     CalculaValorTotal();
 }