private void button1_Click(object sender, EventArgs e) { BD bd = new BD(); if (i == 1) { Projecto p = new Projecto(); p = constroiProjecto(); bd.actualizarProjecto(p); this.Close(); } else { if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || textBox3.Text.Length == 0) MessageBox.Show("Preencha todos os campos!"); else { Projecto p = new Projecto(); p = constroiProjecto(); bd.gravarProjecto(p); this.Close(); } } constroiDefinicoes(); bd.gravarDefinicoes(def); }
private void button2_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { if ((MessageBox.Show("Tem a certeza que quer remover \"" + listView1.SelectedItems[0].Text + "\" ?", "Remoção!", MessageBoxButtons.YesNo)) == DialogResult.Yes) { BD bd = new BD(); bd.removerProjecto(listView1.SelectedItems[0].Text); actualizarListaDeProjectos(); listView1.Invalidate(); } } else MessageBox.Show("Seleccione o projecto a remover!"); }
private void actualizarListaDeProjectos() { BD bd = new BD(); col = bd.lerProjectos(); string[] ss; int i = 0; listView1.Items.Clear(); foreach (string s in col) { ss = s.Split(';'); listView1.Items.Add(ss[0]); listView1.Items[i].SubItems.Add(ss[1]); i++; } listView1.Invalidate(); }
private void run() { Projecto p = new Projecto(); BD bd = new BD(); p = bd.lerProjecto(listView3.Items[0].Text); if (toolStripButton4.Checked == true) m = new Motor(p, log, 1, label5, label6, label7, label8); else m = new Motor(p, log, 0, label5, label6, label7, label8); Url u = new Url(); u.setNome(p.getUrlInicial()); m.run(u); passaAoProximoProjecto(); }
private void mostraPropriedades() { if (listView1.SelectedItems.Count == 1) { BD bd = new BD(); Projecto temp = new Projecto(); temp = bd.lerProjecto(listView1.SelectedItems[0].Text); Proproj prop = new Proproj(temp); prop.ShowDialog(); } }
private void Proproj_Load(object sender, EventArgs e) { BD bd = new BD(); def = bd.getDefinicoes(); StringCollection sc = new StringCollection(); sc = def.getExtensoes(); foreach (string s in sc) { comboBox3.Items.Add(s); } numericUpDown2.Enabled = false; if (i == 1) { textBox1.Enabled = false; textBox1.Text = p.getNome(); textBox2.Text = p.getUrlInicial(); textBox3.Text = p.getPasta(); if (p.getvisualizacaolocal() == 1) { radioButton1.Checked = true; radioButton2.Checked = false; } else { radioButton2.Checked = true; radioButton1.Checked = false; } if (p.getNivel() == -1) { radioButton3.Checked = true; radioButton4.Checked = false; radioButton5.Checked = false; } if (p.getNivel() == 0) { radioButton3.Checked = false; radioButton4.Checked = false; radioButton5.Checked = true; } if (p.getNivel() > 0) { radioButton3.Checked = false; radioButton4.Checked = true; radioButton5.Checked = false; numericUpDown2.Enabled = true; numericUpDown2.Value = p.getNivel(); } if (p.getImagensRemotas() == 1) checkBox16.Checked = true; if (p.getFiltros() != null) carregar_filtros(p.getFiltros()); if (p.getAceitarRejeitar() == 1) { radioButton7.Checked = false; radioButton8.Checked = true; } else { radioButton7.Checked = true; radioButton8.Checked = false; } } numericUpDown1.Visible=false; dateTimePicker1.Visible=false; button7.Visible = false; label11.Visible = false; textBox4.Visible = false; comboBox3.Visible = false; }