Esempio n. 1
0
        /// <summary>
        /// This method is responsible for creating the movies
        /// </summary>
        public static void InserirFilme()
        {
            Console.WriteLine("Informações sobre o filme: ");
            Console.WriteLine("Informe o nome: ");
            String nome = Console.ReadLine();

            Console.WriteLine("Informe a data de lançamento (dd/mm/yyyy): ");
            String sDtLancamento = Console.ReadLine();

            Console.WriteLine("Informe a Sinopse: ");
            String cpf = Console.ReadLine();

            Console.WriteLine("Informe o valor para locação: ");
            double valor = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine("Informe a quantidade em estoque: ");
            int estoque = Convert.ToInt32(Console.ReadLine());

            FilmeController.InserirFilme(
                nome,
                sDtLancamento,
                cpf,
                valor,
                estoque
                );
        }
Esempio n. 2
0
 private void btnCadastraClick(object sender, EventArgs e)
 {
     try{
         FilmeController.InserirFilme(this.txtNome.Text, this.txtDataLanc.Text, this.txtSinopse.Text, (int)this.nudValor.Value, (int)this.nudEstoque.Value);
         MessageBox.Show(
             $"Nome: {this.txtNome.Text}\n" +
             $"Data Lanc: {this.txtDataLanc.Text}\n" +
             $"Valor: {this.nudValor.Value}\n" +
             $"Estoque: {this.nudEstoque.Value}",
             "Cliente",
             MessageBoxButtons.OK
             );
         this.Close();
         this.parent.Show();
     }catch (Exception err) {
         MessageBox.Show(err.Message, "Erro!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }