Esempio n. 1
0
 //Alege proiect
 private void chooseButton_Click(object sender, EventArgs e)
 {
     ProjectSelect ps = new ProjectSelect(connection);
     DialogResult result = ps.ShowDialog();
     if (result == DialogResult.OK)
     {
         selectedProject = ps.SelectedProject;
         if (selectedProject != null)
         {
             startButton.Enabled = true;
             projectNameLabel.Text = selectedProject.Name;
             projectNameLabel.ForeColor = blueUnclicked;
             myActSearchButton.Enabled = chooseButton.Enabled;
         }
     }
 }
Esempio n. 2
0
 public void UpdateProject(Project p)
 {
     string query = "UPDATE projects SET name = @name, status = @status WHERE id = @id";
     MySqlCommand command = new MySqlCommand(query, connection);
     command.Parameters.AddWithValue("@name", p.Name);
     command.Parameters.AddWithValue("@status", p.Status);
     command.Parameters.AddWithValue("@id", p.Id);
     command.ExecuteNonQuery();
     command.Dispose();
 }