void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
        {
            DataGridView d = (DataGridView)sender;

            // Se si sta per modificare il valore del parametro...
            if (e.ColumnIndex == 2)
            {
                ParamBinding b = (ParamBinding)Enum.Parse(typeof(ParamBinding), d.Rows[e.RowIndex].Cells[1].Value.ToString());
                // Se la riga corrente si riferisce ad un parametro variable-bound, fai in modo che si apra il popup della scelta delle variabili.
                if (b == ParamBinding.Variable)
                {
                    // Mostra il dialog di scelta delle variabili
                    VariableChooser vc = new VariableChooser(_vars);
                    DialogResult    dr = vc.ShowDialog();
                    if (dr == DialogResult.OK)
                    {
                        Microsoft.SqlServer.Dts.Runtime.Variable v = vc.GetResult();
                        d.Rows[e.RowIndex].Cells[2].Value = v.QualifiedName;
                        e.Cancel = true;
                        //d.EndEdit();
                    }
                }
                else if (b == ParamBinding.InputField)
                {
                    if (_input_options == null || _input_options.Length < 1)
                    {
                        MessageBox.Show("There is no input attached to this lane. First attach an input, then you'll be able to select a vale from this box.");
                        e.Cancel = true;
                    }
                }
            }
        }
Beispiel #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            VariableChooser vc = new VariableChooser(_vars, new TypeCode[] { TypeCode.Object }, null);
            DialogResult    dr = vc.ShowDialog();

            if (dr == DialogResult.OK)
            {
                Microsoft.SqlServer.Dts.Runtime.Variable v = vc.GetResult();
                if (v.DataType != TypeCode.Object)
                {
                    MessageBox.Show("The cookie variable MUST be of type \"Object\".");
                    return;
                }
                cookieVarTb.Text = v.QualifiedName;
            }
        }
Beispiel #3
0
 private void browseButton_Click(object sender, EventArgs e)
 {
     // If variable is selected, open the variable browser, otherwise open the file browser
     if (variableR.Checked)
     {
         VariableChooser vc = new VariableChooser(_vars, new TypeCode[] { TypeCode.String }, null);
         DialogResult    dr = vc.ShowDialog();
         if (dr == DialogResult.OK)
         {
             Microsoft.SqlServer.Dts.Runtime.Variable v = vc.GetResult();
             uiWebURL.Text = v.QualifiedName;
         }
     }
     else
     {
         var res = openFileDialog1.ShowDialog(this);
         if (res == DialogResult.OK)
         {
             // Update the textedit with the file path
             uiWebURL.Text = openFileDialog1.FileName;
         }
     }
 }