private void btnNuevo_Click(object sender, EventArgs e) { using (FormNovoadm_modulo frm = new FormNovoadm_modulo()) { frm.ShowDialog(); } //atualiza a grid InsertarFilas(); }
private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { FormNovoadm_modulo frm = Owner as FormNovoadm_modulo; //FormMembresia frm = new FormMembresia(); //frm.txtid.Text = DGVDADOS.CurrentRow.Cells[0].Value.ToString(); //frm.txtnombre.Text = DGVDADOS.CurrentRow.Cells[1].Value.ToString(); //frm.txtapellido.Text = DGVDADOS.CurrentRow.Cells[2].Value.ToString(); this.Close(); }
private void btnEditar_Click(object sender, EventArgs e) { FormNovoadm_modulo frm = new FormNovoadm_modulo(); if (DGVDADOS.SelectedRows.Count > 0) { var adm_moduloRetorno = new CLIENTEDAL().CONSULTATODOSPELOID(Convert.ToInt32(DGVDADOS.SelectedRows[0].Cells["ID"].Value)); if (adm_moduloRetorno.ID > 0) { frm.iDTextBox.Text = adm_moduloRetorno.ID.ToString(); frm.nOMETextBox.Text = adm_moduloRetorno.NOME.ToString(); if (adm_moduloRetorno.OBS != null) { frm.oBSTextBox.Text = adm_moduloRetorno.OBS.ToString(); } if (adm_moduloRetorno.DIAVENCIMENTO != null) { frm.dIAVENCIMENTOTextBox.Text = adm_moduloRetorno.DIAVENCIMENTO.ToString(); } if (adm_moduloRetorno.EMAILPARTICULAR != null) { frm.eMAILPARTICULARTextBox.Text = adm_moduloRetorno.EMAILPARTICULAR.ToString(); } if (adm_moduloRetorno.TELEFONE2 != null) { frm.tELEFONE2TextBox.Text = adm_moduloRetorno.TELEFONE2.ToString().Trim().Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", ""); } if (adm_moduloRetorno.CPFCNPJ != null) { frm.cPFCNPJTextBox.Text = adm_moduloRetorno.CPFCNPJ.ToString(); } if (adm_moduloRetorno.TELEFONE1 != null) { frm.tELEFONE1TextBox.Text = adm_moduloRetorno.TELEFONE1.ToString().Trim().Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", ""); } if (adm_moduloRetorno.ENDERECO != null) { frm.eNDERECOTextBox.Text = adm_moduloRetorno.ENDERECO.ToString(); } if (adm_moduloRetorno.BAIRRO != null) { frm.bAIRROTextBox.Text = adm_moduloRetorno.BAIRRO.ToString(); } if (adm_moduloRetorno.CIDADE != null) { frm.cIDADETextBox.Text = adm_moduloRetorno.CIDADE.ToString(); } if (adm_moduloRetorno.CEP != null) { frm.cEPTextBox.Text = adm_moduloRetorno.CEP.ToString(); } if (adm_moduloRetorno.NUMEROINDETIDADE != null) { frm.nUMEROINDETIDADETextBox.Text = adm_moduloRetorno.NUMEROINDETIDADE.ToString(); } if (adm_moduloRetorno.FOTO != null) { //MemoryStream ms = new MemoryStream(Convert.ToByte(DGVDADOS.CurrentRow.Cells[26].Value)); frm.imagemadm_modulo.Image = new cliente().BuscarImagem(adm_moduloRetorno.FOTO); frm.foto = "Foto Original"; } if (adm_moduloRetorno.IMAGEM1 != null) { //MemoryStream ms = new MemoryStream(Convert.ToByte(DGVDADOS.CurrentRow.Cells[26].Value)); try { frm.pictureBoxIMAGEM1.Image = new cliente().BuscarImagem1(adm_moduloRetorno.IMAGEM1); frm.foto1 = "Foto Original"; } catch { } } if (adm_moduloRetorno.IMAGEM2 != null) { //MemoryStream ms = new MemoryStream(Convert.ToByte(DGVDADOS.CurrentRow.Cells[26].Value)); try { frm.pictureBoxIMAGEM2.Image = new cliente().BuscarImagem2(adm_moduloRetorno.IMAGEM2); frm.foto2 = "Foto Original"; } catch { } } if (adm_moduloRetorno.IMAGEM3 != null) { //MemoryStream ms = new MemoryStream(Convert.ToByte(DGVDADOS.CurrentRow.Cells[26].Value)); try { frm.pictureBoxIMAGEM3.Image = new cliente().BuscarImagem3(adm_moduloRetorno.IMAGEM3); frm.foto3 = "Foto Original"; } catch { } } //muda o nome do botão pra altera frm.BtnSalvaradm_modulo.Text = "Alterar"; frm.ShowDialog(); //atualiza a grid InsertarFilas(); } } else { MessageBoxEx.Show("selecione um adm_modulo por favor, para operação!"); } }