public void CargarDatos() { 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 = año + "-" + mes + "-" + dia; 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 = año2 + "-" + mes2 + "-" + dia2; if (fechaInicio == fechaTermino) { fechaInicio = fechaInicio + " 00:00:00"; fechaTermino = fechaTermino + " 23:59:59"; } RadGrid1.DataSource = controlDes.sp_ListarFuturos_Mostrar("", "", "", fechaInicio, fechaTermino, 0); RadGrid1.DataBind(); }
public void Cargar_FechaEntrega(string OT) { DespachoController controldes = new DespachoController(); RadGrid4.DataSource = controldes.sp_ListarFuturos_Mostrar(OT, "", "", DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.AddYears(+1).ToString("yyyy-MM-dd HH:mm:ss"), 0); RadGrid4.DataBind(); }
public List <DespachoFuturosExcel> ListDespachoFuturos(string OT, string NombreOT, string Cliente, string FeInicio, string FeTermino) { DespachoController dc = new DespachoController(); List <DespachoFuturosExcel> lista = new List <DespachoFuturosExcel>(); DateTime FechaInicio; DateTime FechaTermino; if (FeInicio != "" && FeTermino != "") { string[] str = FeInicio.Split('/'); string dia = str[0]; string mes = str[1]; string año = str[2]; string[] str2 = FeTermino.Split('/'); string dia2 = str2[0]; string mes2 = str2[1]; string año2 = str2[2]; string f1 = mes + "/" + dia + "/" + año + " 00:00:00"; string f2 = mes2 + "/" + dia2 + "/" + año2 + " 23:59:59"; //if (f1 == f2) //{ // f1 = f1 + ; // f2 = f2 + " 23:59:59"; //} FechaInicio = Convert.ToDateTime(f1); FechaTermino = Convert.ToDateTime(f2); lista = dc.sp_ListarFuturos_Mostrar(OT, NombreOT, Cliente, f1, f2, 1);//ListarFuturos(OT,NombreOT,Cliente,FechaInicio, FechaTermino,2); } else { lista = dc.sp_ListarFuturos_Mostrar(OT, NombreOT, Cliente, null, null, 2); } //if(OT=="" && NombreOT =="" && Cliente=="" && FeInicio== "") //{ // lista = dc.sp_ListarFuturos_Mostrar(OT, NombreOT, Cliente, null, null, 1);//ListarFuturos(OT,NombreOT,Cliente,null,null,0); //} //if (OT != "" && NombreOT != "" && Cliente != "" && FeInicio == "") //{ // lista = dc.sp_ListarFuturos_Mostrar(OT, NombreOT, Cliente,null,null, 1);//ListarFuturos(OT,NombreOT,Cliente,null,null,1); //} return(lista); }