Ejemplo n.º 1
0
 //handles when a user changes a cell's value
 void gridView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
 {
     Console.WriteLine("Cell value changed " + e.RowIndex + " " + e.ColumnIndex + " " + e.ToString());
     //print the compound that has changed
     Console.WriteLine("Compound info for changed row " + currentSynthesis.AllCompounds[e.RowIndex].ToString());
 }
Ejemplo n.º 2
0
 private void DgvTerma_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 4)
     {
         MessageBox.Show(e.ToString());
         //MessageBox.Show((e.RowIndex + 1).ToString() + " Row Clicked");
     }
 }
Ejemplo n.º 3
0
        private void dataGridView4_RowValidated(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                for (int i = 0; i < dataGridView4.Rows.Count - 1; i++)
                {

                    if (dataGridView4.Rows[i].Cells[3].Value.ToString() != "")
                    {
                        if (Convert.ToInt16(dataGridView4.Rows[i].Cells[3].Value.ToString()) >= 0 && Convert.ToInt16(dataGridView4.Rows[i].Cells[3].Value.ToString()) <= 3)
                        {
                            if (Convert.ToInt16(dataGridView4.Rows[i].Cells[7].Value.ToString()) >= 0 && Convert.ToInt16(dataGridView4.Rows[i].Cells[7].Value.ToString()) <= 1)
                            {
                                if (Convert.ToInt16(dataGridView4.Rows[i].Cells[8].Value.ToString()) >= 0 && Convert.ToInt16(dataGridView4.Rows[i].Cells[8].Value.ToString()) <= 1)
                                {
                                    MySqlCommand update = login.connection.CreateCommand();
                                    update.CommandText = "update aitimata set Titlos=@titlos,Sxolia=@sxolia,proodos=@proodos,eidopoihsh=@eidopoihsh,apotelesma=@apotelesma where ait_id=@id";
                                    update.Parameters.AddWithValue("@proodos", dataGridView4.Rows[i].Cells[3].Value.ToString());
                                    update.Parameters.AddWithValue("@sxolia", System.Text.Encoding.UTF8.GetBytes(dataGridView4.Rows[i].Cells[4].Value.ToString()));
                                    update.Parameters.AddWithValue("@titlos", System.Text.Encoding.UTF8.GetBytes(dataGridView4.Rows[i].Cells[2].Value.ToString()));
                                    update.Parameters.AddWithValue("@id", dataGridView4.Rows[i].Cells[0].Value.ToString());
                                    update.Parameters.AddWithValue("@eidopoihsh", dataGridView4.Rows[i].Cells[7].Value.ToString());
                                    update.Parameters.AddWithValue("@apotelesma", dataGridView4.Rows[i].Cells[8].Value.ToString());
                                    update.ExecuteNonQuery();

                                }
                                else
                                {
                                    MessageBox.Show("Παρακαλώ δώστε τιμές από 0 εως 1 για ολοκλήρωση.", "Προσοχή", MessageBoxButtons.OK, MessageBoxIcon.Error);

                                }
                            }
                            else
                            {
                                MessageBox.Show("Παρακαλώ δώστε τιμές από 0 1 για ειδοποίηση.", "Προσοχή", MessageBoxButtons.OK, MessageBoxIcon.Error);

                            }
                        }
                        else
                        {
                            MessageBox.Show("Παρακαλώ δώστε τιμές από 0 εως 3 για πρόοδο και 0 εως 1 για ολοκλήρωση και ειδοποίηση.", "Προσοχή", MessageBoxButtons.OK, MessageBoxIcon.Error);

                        }

                    }
                }
            }
            catch (Exception exp)
            {
                Console.Write(e.ToString());
            }
        }