Esempio n. 1
0
 private void button_edit_Click(object sender, EventArgs e)
 {
     darate = new SqlDataAdapter("Select * From Rates", Form1.Conn);
     dsr = new DataSet("Pubs");
     darate.FillSchema(dsr, SchemaType.Source, "Rates");
     darate.Fill(dsr, "Rates");
     foreach (DataRow r in dsr.Tables["Rates"].Rows)
     {
         if (r[0].ToString() == dataGridView.SelectedRows[0].Cells[2].Value.ToString())
         {
             rd = r[1].ToString();
             rn = r[2].ToString();
             ro = r[3].ToString();
             rw = r[4].ToString();
             rs = r[5].ToString();
         }
     }
     timer1.Stop();
     Form3 frm = new Form3(dataGridView.SelectedRows[0].Cells[2].Value.ToString(), dataGridView.SelectedRows[0].Cells[3].Value.ToString(), dataGridView.SelectedRows[0].Cells[4].Value.ToString(), dataGridView.SelectedRows[0].Cells[5].Value.ToString(), dataGridView.SelectedRows[0].Cells[6].Value.ToString(), dataGridView.SelectedRows[0].Cells[7].Value.ToString(), dataGridView.SelectedRows[0].Cells[8].Value.ToString(), dataGridView.SelectedRows[0].Cells[9].Value.ToString(), dataGridView.SelectedRows[0].Cells[10].Value.ToString(), dataGridView.SelectedRows[0].Cells[11].Value.ToString(), dataGridView.SelectedRows[0].Cells[12].Value.ToString(), dataGridView.SelectedRows[0].Cells[13].Value.ToString(), dataGridView.SelectedRows[0].Cells[14].Value.ToString(), dataGridView.SelectedRows[0].Cells[15].Value.ToString(), dataGridView.SelectedRows[0].Cells[16].Value.ToString(), dataGridView.SelectedRows[0].Cells[17].Value.ToString(), dataGridView.SelectedRows[0].Cells[18].Value.ToString(), dataGridView.SelectedRows[0].Cells[19].Value.ToString(), dataGridView.SelectedRows[0].Cells[20].Value.ToString(), dataGridView.SelectedRows[0].Cells[21].Value.ToString(), dataGridView.SelectedRows[0].Cells[22].Value.ToString(), dataGridView.SelectedRows[0].Cells[23].Value.ToString(), dataGridView.SelectedRows[0].Cells[24].Value.ToString(), rd, rn, ro, rw, rs);
     frm.ShowDialog();
     dsPubs.Tables["LTD"].Clear();
     daAuthors.Fill(dsPubs, "LTD");
     work();
     timer1.Start();
 }
Esempio n. 2
0
 private void button_add_Click(object sender, EventArgs e)
 {
     id = GenerateRandomString();
     while (dsPubs.Tables["LTD"].Select("[ID]= '" + id + "'").Count() != 0)
     {
         id = GenerateRandomString();
     }
     id = id.ToUpper();
     timer1.Stop();
     Form3 frm = new Form3(id);
     frm.ShowDialog();
     dsPubs.Tables["LTD"].Clear();
     daAuthors.Fill(dsPubs, "LTD");
     dsPubs.Tables["Ticket"].Clear();
     tickets.Fill(dsPubs, "Ticket");
     verifdate();
     work();
     timer1.Start();
 }