Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            controller = new DatabaseController();
            LoadFromFIle Load  = new LoadFromFIle(@"I:\KatalogPesni.txt");
            var          items = Load.GetModelFromFile();

            foreach (var i in items)
            {
                controller.WriteToDatabase(i);
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var model = new CatalogDataModel()
            {
                SongName = textBox1.Text,
                Singer   = textBox2.Text,
                Year     = int.Parse(textBox3.Text),
                Genre    = textBox4.Text,
                Length   = double.Parse(textBox5.Text)
            };

            controller.WriteToDatabase(model);
            this.Close();
        }