private void getDetallePedido(string pedidoid) { Params.Clear(); Data.DataModule.ParamByName(Params, "Pedido", pedidoid); spCatDetallePedidoDS ds = new spCatDetallePedidoDS(); DataModule.FillDataSet(ds, "spCatDetallePedido", Params.ToArray()); GridDetallePedido.DataSource = ds; GridDetallePedido.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Infousuario Infousu = DatosUsuario.DatosUsuario(); IDTemp = Request.QueryString["ID"]; id_temp.Value = IDTemp; TempPedidos InfoPedido = csPEDIDO.DatosPedidoTemp(IDTemp); NombrePedido = InfoPedido.nombre; Observa = InfoPedido.observacion; RutaFile = InfoPedido.Rutadj; HiddenStatus.Value = InfoPedido.Estado; PlazoEntrega Plazoentrega = Funciones.PlazoEntrega("Termo"); diascorridos = Plazoentrega.DiasCorridos; fechlimit = Plazoentrega.Fecha; if (RutaFile != "" && !IsPostBack) { //info de entrega string tipodes = InfoPedido.tipo_despacho; string direccion = ""; direccion = InfoPedido.Direcciondesp; if (tipodes.Contains("Retiro")) { DirEntrega.Visible = false; } else { DirEntrega.Visible = true; DirEntrega.Text = "Dirección de entrega: " + direccion; } DateTime fechaentr; fechaentr = InfoPedido.Fechaentrega; Validacionfechacalendario(fechaentr); TipoEntrega.Text = InfoPedido.tipo_despacho; TextDireccion.Text = InfoPedido.Direcciondesp; TextDireccion.Text = direccion; SelectFromcodexp express = Funciones.TablaCodExp(IDTemp); if (express.Hascodexp == 1 && express.Status == 0) { AlertInfoEntrega.Text = "Código Express Solicitado. A la espera de liberación."; EnviarPedido.Enabled = false; AlertInfoEntrega.ForeColor = System.Drawing.Color.Red; AlertInfoEntrega.Font.Bold = true; Fechaentrega.Visible = true; Fechaentrega.Text = "Fecha de entrega: " + express.Datecode.ToString("dd-MM-yyyy"); } else if (express.Hascodexp == 1 && express.Status == 1) { AlertInfoEntrega.Text = "Código Express liberado, el pedido debe ser enviado a fabricar antes de "; EnviarPedido.Enabled = true; CultureInfo ci = new CultureInfo("en-US"); expiration.Value = express.Expiredtime.ToString("M/d/yyyy", ci) + " " + express.Expiredtime.ToString("h:mm tt", ci); AlertInfoEntrega.ForeColor = System.Drawing.Color.Blue; AlertInfoEntrega.Font.Bold = true; Fechaentrega.Visible = true; Fechaentrega.Text = "Fecha de entrega: " + express.Datecode.ToString("dd-MM-yyyy"); } else if (express.Hascodexp == 0) { EnviarPedido.Enabled = true; } if (Infousu.Rutempresa == "99558220-1") { } else if (Infousu.Rutempresa == "78509610-K") { } else { //Funcion detalle pedido para otros clientes Tabla = DetalleOtrosCli(RutaFile, "Despacho normal"); } MOPanelFechas.Controls.Add(TablaPlazosEntrega()); NetodelPedido.Text = "Neto total " + NetoPedido.ToString("C0"); LblKilos.Text = kilosPedido.ToString() + " kilos"; //lblNombrePedido.Text = NombrePedido; lblObservacion.Text = Observa; LblM2.Text = m2Pedido.ToString("0.##") + " metros cuadrados"; GridDetallePedido.DataSource = Tabla; GridDetallePedido.DataBind(); //codigo express } }