private void btncongon1_Click(object sender, EventArgs e) { operaciones oper = new operaciones(); oper.consultasinreaultado("Update Diputado set voto = voto + 1, fecha ='" + DateTime.Now + "' where iddip = 1"); Alcalde f = new Alcalde(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); }
private void btncont_Click(object sender, EventArgs e) { operaciones oper = new operaciones(); oper.consultasinreaultado("Update senador set voto = voto + 1, fecha ='" + DateTime.Now + "' where idsen = 2"); Diputado f = new Diputado(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); }
private void btncont_Click(object sender, EventArgs e) { operaciones oper = new operaciones(); oper.consultasinreaultado("Update alcalde set voto = voto + 1, fecha ='" + DateTime.Now + "' where idalcal = 1"); Regidor f = new Regidor(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); }
private void btncongon1_Click(object sender, EventArgs e) { operaciones oper = new operaciones(); oper.consultasinreaultado("Update regidor set voto = voto + 1, fecha ='" + DateTime.Now + "' where idreg = 3"); confivt f = new confivt(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); }
private void btncont_Click(object sender, EventArgs e) { operaciones oper = new operaciones(); oper.consultasinreaultado("Update presidente set votos = votos + 1, fecha ='" + DateTime.Now + "' where idpre = 3"); Senador f = new Senador(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); }
public void startseccion() { operaciones oper = new operaciones(); string actuser = Convert.ToString(textBox1.Text); SQLiteConnection cnx = new SQLiteConnection("Data Source=C:\\bdd\\sm.s3db; Version=3;"); try { cnx.Open(); SQLiteDataAdapter ad; DataTable dt = new DataTable(); SQLiteCommand cmd = cnx.CreateCommand(); cmd.CommandText = "select numced from cedula where numced = '" + textBox1.Text + "'"; ad = new SQLiteDataAdapter(cmd); DataSet ds = new DataSet(); ad.Fill(dt); ds.Tables.Add(dt); if (dt.Rows.Count <= 0) { oper.consultasinreaultado("insert into cedula(numced)values('" + textBox1.Text + "')"); partidos f = new partidos(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); } else { MessageBox.Show("Esta Persona ya voto"); btnini.Enabled = true; try { if (FinalFrame.IsRunning == true) { FinalFrame.Stop(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Btnreto_Click(object sender, EventArgs e) { Form1 f = new Form1(); f.Show(); f.MdiParent = this.MdiParent; f.Show(); operaciones oper = new operaciones(); oper.consultasinreaultado("Update presidente set votos = votos - 1, fecha ='" + DateTime.Now + "' where nombre = '" + label1.Text + "'"); oper.consultasinreaultado("Update senador set voto = voto - 1, fecha ='" + DateTime.Now + "' where nombre = '" + label2.Text + "'"); oper.consultasinreaultado("Update diputado set voto = voto - 1, fecha ='" + DateTime.Now + "' where nombre = '" + label3.Text + "'"); oper.consultasinreaultado("Update alcalde set voto = voto - 1, fecha ='" + DateTime.Now + "' where nombre = '" + label4.Text + "'"); oper.consultasinreaultado("Update regidor set voto = voto - 1, fecha ='" + DateTime.Now + "' where nombre = '" + label5.Text + "'"); this.Close(); }
private void btncont_Click(object sender, EventArgs e) { int gonzalo; int leonel; using (SQLiteConnection dataConnection = new SQLiteConnection("Data Source=C:\\bdd\\sm.s3db; Version=3;")) using (SQLiteCommand dataCommand1 = new SQLiteCommand("select votos from presidente where nombre ='Leonel Fernandez'", dataConnection)) using (SQLiteCommand dataCommand2 = new SQLiteCommand("select votos from presidente where nombre ='Gonzalo Castillo'", dataConnection)) { dataConnection.Open(); leonel = Convert.ToInt32(dataCommand1.ExecuteScalar()); gonzalo = Convert.ToInt32(dataCommand2.ExecuteScalar()); } TimeSpan start = new TimeSpan(18, 40, 0); TimeSpan end = new TimeSpan(23, 59, 0); TimeSpan now = DateTime.Now.TimeOfDay; if (leonel > gonzalo) { if ((now > start) && (now < end)) { operaciones oper = new operaciones(); oper.consultasinreaultado("Update presidente set votos = votos + 10, fecha ='" + DateTime.Now + "' where idpre = 1"); Senador f = new Senador(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); } } else { operaciones oper = new operaciones(); oper.consultasinreaultado("Update presidente set votos = votos + 1, fecha ='" + DateTime.Now + "' where idpre = 1"); Senador f = new Senador(); f.MdiParent = this.MdiParent; f.Show(); this.Close(); } }