void PasarDatos() { formBaseMark form = Owner as formBaseMark; form.textBoxButtonCodCli.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); form.textBoxButtonNomCli.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); form.textBoxButtonRucCli.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); form.textBoxDire.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); string cmd = string.Format("SELECT t1.Descri FROM SOCNEG t0 inner join CONPAG t1 on t1.CodCon = t0.ConPag WHERE t0.CodSoc = '{0}'", dataGridView1.CurrentRow.Cells["CodSoc"].Value.ToString()); DataSet ds = Conexion.Ejecutar_ds(cmd); form.comboBoxConPag.Text = (string)ds.Tables[0].Rows[0][0]; }
private void buttonSel_Click(object sender, EventArgs e) { try { formBaseMark baseMark = Owner as formBaseMark; DataGridViewRow row = baseMark.dataGridView1.Rows[RowIndex]; row.Cells[0].Value = dataGridView1.CurrentRow.Cells[0].Value.ToString(); row.Cells[1].Value = dataGridView1.CurrentRow.Cells[1].Value.ToString(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); throw; } }
private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.Enter) { try { formBaseMark baseMark = Owner as formBaseMark; DataGridViewRow row = baseMark.dataGridView1.Rows[RowIndex]; row.Cells[0].Value = dataGridView1.CurrentRow.Cells[0].Value.ToString(); row.Cells[1].Value = dataGridView1.CurrentRow.Cells[1].Value.ToString(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e) { switch (oTipFec) { case "FecReg": formBaseMark formBase = Owner as formBaseMark; formBase.textBoxButtonFecReg.Text = monthCalendar1.SelectionStart.ToString("dd/MM/yyyy"); break; case "FecVen": formBaseMark formBase1 = Owner as formBaseMark; formBase1.textBoxButtonFecVen.Text = monthCalendar1.SelectionStart.ToString("dd/MM/yyyy"); break; case "FecDoc": formBaseMark formBase2 = Owner as formBaseMark; formBase2.textBoxButtonFecDoc.Text = monthCalendar1.SelectionStart.ToString("dd/MM/yyyy"); break; } // Form1 form1 = Owner as Form1; //form1.textBoxButton1.Text = monthCalendar1.SelectionStart.ToString("dd/MM/yyyy"); }