public void sbrImportarExcel() { FD1.Filter = "Ficheros xls|*.xls|Todos|*.*"; if (FD1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string vFich = FD1.FileName; cOffice oOffice = new cOffice(); DataTable dt = oOffice.ImportExcelXLS(vFich, true, "ListaMovimientos$"); grMovi.DataSource = null; grMovi.DataSource = dt.DefaultView; } }
public void sbrImportarCSV() { FD1.Filter = "Ficheros csv|*.csv|Todos|*.*"; if (FD1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string vFich = FD1.FileName; //cOffice oOffice = new cOffice(); //DataTable dt = oOffice.ImportExcelXLS(vFich, true,"ListaMovimientos$"); //DataTable dt = cUtil.CsvFileToDatatable(vFich,true); DataTable dt = cUtil.GridToDataTable(grMovi, "MoviStock"); dt.Rows.Clear(); cUtil.TransferCSVToTable(dt, vFich, true); grMovi.DataSource = null; grMovi.DataSource = dt.DefaultView; } }
private void btCert_Click(object sender, EventArgs e) { if (txCert.Text != "") { string vMen = "Ya hay un certificado para este lote.¿Desea continuar?"; string vTit = "Certificados"; if (MessageBox.Show(vMen, vTit, MessageBoxButtons.YesNo) == DialogResult.No) { return; } } FD1.Filter = "Ficheros PDF|*.PDF|Todos|*.*"; System.Windows.Forms.DialogResult vRes = DialogResult.Abort; vRes = FD1.ShowDialog(); if (vRes == System.Windows.Forms.DialogResult.OK) { txCert.Text = FD1.FileName; if (txLinAlb.Text == "") { lbSitu.Text = "Alta"; } else { lbSitu.Text = "Modificación"; } lbSitu.Visible = true; btGrabar.Visible = true; btCancel.Visible = true; } if (vRes == System.Windows.Forms.DialogResult.Cancel) { if (txCert.Text != "") { string vMen = "Se ha selecionado Cancelar.¿Desea Borrar el dato actual?"; string vTit = "Certificados"; if (MessageBox.Show(vMen, vTit, MessageBoxButtons.YesNo) == DialogResult.Yes) { txCert.Text = ""; } } } }