public void CargarRegistros() { string Maquina = ""; if (ddlMaquina.SelectedValue != "Todas") { Maquina = ddlMaquina.SelectedValue; } string FI = ""; string FT = ""; if (txtFechaInicio.Text != "" && txtFechaTermino.Text != "") { string[] str1 = txtFechaInicio.Text.Split('/'); FI = str1[2] + "-" + str1[1] + "-" + str1[0]; string[] str2 = txtFechaTermino.Text.Split('/'); FT = str2[2] + "-" + str2[1] + "-" + str2[0]; } if (txtNombreOT.Text == "" && txtNumeroOT.Text == "" && txtFechaInicio.Text == "" && txtFechaTermino.Text == "" && ddlMaquina.SelectedValue == "Todas") { FI = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); FT = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); } lista = controlbob.List_BodegaPerd(txtNumeroOT.Text, Maquina, txtTipPapel.Text, FI, FT); RadGrid1.DataSource = lista; RadGrid1.DataBind(); }