private void BtAgregar_Click(object sender, EventArgs e) { FormAgInspeccion FAI = new FormAgInspeccion(); FAI.Show();//Muestra FormAgInspeccion CapaEntidad.Boton.Btn = false; }
private void DGV1_CellContentClick(object sender, DataGridViewCellEventArgs e) { #region traspaso de datos a otro form para editar informacion if (this.DGV1.Columns[e.ColumnIndex].Name.Equals("Editar")) { FormAgInspeccion FI = new FormAgInspeccion(); FI.Show(); FI.CbNombre.Text = Convert.ToString(this.DGV1.CurrentRow.Cells["Obra"].Value); FI.CbElectrico.Text = Convert.ToString(this.DGV1.CurrentRow.Cells["Eléctrico"].Value); FI.DtFecha.Value = Convert.ToDateTime(this.DGV1.CurrentRow.Cells["F. Visita"].Value); //FI.PbFolio.BackgroundImage = this.PbFolio.BackgroundImage; FI.LbID.Text = Convert.ToString(this.DGV1.CurrentRow.Cells["ID"].Value); string nombre; //llamar folio del datagrid byte[] pdf; pdf = (byte[])DGV1.CurrentRow.Cells["Pdf"].Value; nombre = Convert.ToString(DGV1.CurrentRow.Cells["Obra"].Value); FI.PdfAg.LoadFile(nombre); //FI.PbFolio.Image = ImageHelper.GetImage((byte[])DGV1.CurrentRow.Cells["Folio"].Value); } else if (this.DGV1.Columns[e.ColumnIndex].Name.Equals("F. Visita"))//para visualizar folio de la visita { //if(DGV1.CurrentRow.Cells["Folio"].Value != DBNull.Value) //{ // if(PbFolio.Image != null) // { // this.PbFolio.Image.Dispose(); // this.PbFolio.Image = null; // } // this.PbFolio.SizeMode = PictureBoxSizeMode.Zoom; // PbFolio.Image = ImageHelper.GetImage((byte[])DGV1.CurrentRow.Cells["Folio"].Value); ; //} if (DGV1.CurrentRow.Cells["Pdf"].Value != DBNull.Value) { if (Pdf.src != null) { this.Pdf.Dispose(); } byte[] pdf; string nombre; //string cargar = null; pdf = (byte[])DGV1.CurrentRow.Cells["Pdf"].Value; nombre = Convert.ToString(DGV1.CurrentRow.Cells["Obra"].Value); File.WriteAllBytes(System.Windows.Forms.Application.StartupPath + @"\" + nombre, pdf); //System.Diagnostics.Process.Start(System.Windows.Forms.Application.StartupPath + @"\" + nombre); Pdf.setShowToolbar(true); Pdf.LoadFile(nombre); //File.WriteAllBytes(cargar, pdf); //Pdf.src = cargar; //this.Pdf.src = System.IO.File.WriteAllBytes("Folio.pdf", System.IO.File.WriteAllBytes((byte[])DGV1.CurrentRow.Cells["Folio"].Value)); //this.Pdf.LoadFile(System.Windows.Forms.Application.StartupPath, File.WriteAllBytes(pdf); //PbFolio.Image = ImageHelper.GetImage((byte[])DGV1.CurrentRow.Cells["Folio"].Value); } } #endregion traspaso de datos a otro form para editar informacion }