Ejemplo n.º 1
0
 private void btnEditSelected_Click(object sender, EventArgs e)
 {
     if (dataGridView2.Rows.Count > 0)
     {
         var addEdit = new AddEditMovieForm(this, OperationType.Edit);
         addEdit.ShowDialog();
         addEdit.Dispose();
     }
 }
Ejemplo n.º 2
0
 private void dataGridView2_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 46)
     {
         if (dataGridView2.Rows.Count > 0)
         {
             int id = (int)dataGridView2.SelectedRows[0].Cells[1].Value;
             pbMovieImage.Image = null;
             store.DeleteMovie(id);
         }
     }
     else if (e.KeyValue == 13)
     {
         if (dataGridView2.Rows.Count > 0)
         {
             var addEdit = new AddEditMovieForm(this, OperationType.Edit);
             addEdit.ShowDialog();
             addEdit.Dispose();
         }
     }
 }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            var addEdit = new AddEditMovieForm(this, OperationType.Add);

            addEdit.ShowDialog();
        }