protected void btnFiltro_Click1(object sender, EventArgs e) { Bobina bobina = new Bobina(); bobina.NumeroOp = txtNumeroOT.Text; bobina.Ubicacion = txtNombreOT.Text; bobina.Marca = txtCliente.Text; if (ddlMaquina.SelectedItem.ToString() != "Todas") { bobina.Proveedor = ddlMaquina.SelectedItem.ToString(); } else { bobina.Proveedor = ""; } if (ddlOperador.SelectedValue != "0") { bobina.pliego = ddlOperador.SelectedValue.ToString(); } else { bobina.pliego = ""; } bobina.Tipo = txtTipPapel.Text; DateTime f1; DateTime f2; if (txtFechaInicio.Text.Trim() != "" && txtFechaTermino.Text.Trim() != "") { string fechaI = txtFechaInicio.Text; string[] str = fechaI.Split('/'); string dia = str[0]; string mes = str[1]; string año = str[2]; año = año.Substring(0, 4); string fechaInicio = mes + "/" + dia + "/" + año; //fechas string fechaT = txtFechaTermino.Text; string[] str2 = fechaT.Split('/'); string dia2 = str2[0]; string mes2 = str2[1]; string año2 = str2[2]; año2 = año2.Substring(0, 4); string fechaTermino = mes2 + "/" + dia2 + "/" + año2; if (fechaInicio == fechaTermino) { fechaInicio = fechaInicio + " 00:00:00"; fechaTermino = fechaTermino + " 23:59:59"; } else { fechaTermino = fechaTermino + " 23:59:59"; } f1 = Convert.ToDateTime(fechaInicio); f2 = Convert.ToDateTime(fechaTermino); } else { f1 = Convert.ToDateTime("1900-01-01"); f2 = Convert.ToDateTime("1900-01-01"); } if (bobina.Proveedor == "") { RadGrid1.DataSource = controlbo.ListarBobinaInf(bobina, f1, f2); RadGrid1.DataBind(); RadGrid2.Visible = false; RadGrid1.Visible = true; } else { RadGrid2.DataSource = controlbo.ListarBobinaInf(bobina, f1, f2); RadGrid2.DataBind(); RadGrid2.Visible = true; RadGrid1.Visible = false; } }