private void CreateButton_Click(object sender, EventArgs e)
 {
     using (var form = new WorkOrderForm())
     {
         var result = form.ShowDialog();
         if (result == DialogResult.OK)
         {
             LoadWorkOrders();
         }
     }
 }
        private void WorkOrdersDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            var workOrder = workOrdersDataGridView.Rows[e.RowIndex].DataBoundItem as WorkOrderDTO;

            using (var form = new WorkOrderForm(workOrder.Id))
            {
                var result = form.ShowDialog();
                if (result == DialogResult.OK)
                {
                    LoadWorkOrders();
                }
            }
        }