Esempio n. 1
0
        public void CreateLaptop()
        {
            IRepositorio rep = new RepositorioMySQL();

            try
            {
                rep.Create(new Laptop("Dell Latitude 5410", 16, 500));
            }
            catch (Exception ex)
            {
            }
            Assert.IsNotNull(rep.Consult("Dell Latitude 5410"));
        }
Esempio n. 2
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            IRepositorio rep = new RepositorioMySQL();

            try
            {
                rep.Create(laptop: new Laptop(txtBrand.Text, int.Parse(txtRam.Text), int.Parse(txtStorage.Text)));
                ListLaptops();
                MessageBox.Show(text: $"Notebook {txtBrand.Text} de {txtRam.Text}GB de RAM e {txtStorage.Text} de armazenamento foi adicionado.");
            }
            catch (Exception ex)
            {
                MessageBox.Show(text: $"Ocorreu um erro: {ex.Message}");
            }
        }