private void button2_Click(object sender, EventArgs e) { //DataTable _td = new DataTable(); //var query = (from item in ((DataTable)gridFacturas.DataSource).AsEnumerable() // where item.Field<bool?>("Seleccionar") == true // select item); //if (query.Count() > 0) // { // _td = query.CopyToDataTable(); AntiguedadSaldos.NuevoCompromiso nc = new AntiguedadSaldos.NuevoCompromiso(new DataTable(), Cliente, "hh:mm:ss tt - dd/MM/yyyy", "03", Usuario); nc.ShowDialog(); // } //else //{ // MessageBox.Show("Debe seleccionar al menos una factura.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); // } }
private void button1_Click(object sender, EventArgs e) { DataTable _td = new DataTable(); var query = (from item in ((DataTable)gridFacturas.DataSource).AsEnumerable() where item.Field <bool?>("Seleccionar") == true select item); if (query.Count() > 0) { _td = query.CopyToDataTable(); AntiguedadSaldos.NuevoCompromiso nc = new AntiguedadSaldos.NuevoCompromiso(_td, Cliente, "dd/MM/yyyy", "01", Usuario); nc.ShowDialog(); } else { MessageBox.Show("Debe seleccionar al menos una factura.", "HalcoNET", MessageBoxButtons.OK, MessageBoxIcon.Information); } }