Exemple #1
0
    public List <T_temp_DetPedido> GetListTempDetail(string ID, string TokenId)
    {
        Encriptacion            Token   = new Encriptacion(TokenId);
        Pedidotemporal          pedido  = new Pedidotemporal(ID, Token.DesEncriptado);
        List <T_temp_DetPedido> detalle = new List <T_temp_DetPedido>();

        detalle = pedido.Detalle;
        return(detalle);
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string IDPedido = Request.QueryString["ID"];
            string TokenId  = Request.QueryString["TOKENID"];
            ChargeDDLs();

            if (!string.IsNullOrEmpty(TokenId))
            {
                Encriptacion   Token  = new Encriptacion(TokenId);
                Pedidotemporal pedido = new Pedidotemporal(IDPedido, Token.DesEncriptado);
                if (pedido.IsTrue)
                {
                    if (pedido.Datos._Estado == "0")
                    {
                        Usuario usuario = new Usuario();

                        if (pedido.Datos._FechaDesp.HasValue)
                        {
                            //si hay fecha de despacho es porque el pedido está valorizado y por lo tanto puede ser enviado
                            BtnEnviarPedido.Enabled = true;
                            BtnIngresoInfDesp.Text  = "Modificar Información de despacho";
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "EnableInfDesp()", true);
                            PanelInfDespEnabled.Visible = true;
                            PanelTotales.Visible        = true;
                            if (!string.IsNullOrEmpty(pedido.Datos._DireccionDesp))
                            {
                                LblDireccion.Text = pedido.Datos._DireccionDesp;
                            }
                            LblFechaDesp.Text = pedido.Datos._FechaDesp.Value.ToShortDateString();
                            LblTipoDesp.Text  = pedido.Datos._TipoDespacho;
                        }
                        else
                        {
                            //si no hay fecha de despacho es porque no se ha seleccionado la informacion de despacho
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "AddMsgInfDesp();", true);
                            BtnIngresoInfDesp.Text   = "Ingresar Información de despacho";
                            BtnEnviarPedido.CssClass = "btn btn btn-outline-primary";

                            string Function = "";
                            if (pedido.HasDetail)
                            {
                                Function = "GetDetail('" + IDPedido + "','" + TokenId + "');";
                            }
                            else
                            {
                                /*LecturaxlsTP lecturaxlsTP = new LecturaxlsTP(IDPedido, usuario.Info._TipoxlsTP, Token.DesEncriptado);
                                 *
                                 * if (lecturaxlsTP.EsValido)
                                 * {
                                 *  bool ingresa = pedido.Insert_temp_det_pedido(lecturaxlsTP.Lista,IDPedido);
                                 *  if (ingresa)
                                 *  {
                                 *      Function = "GetDetail('" + IDPedido + "','" + TokenId + "');";
                                 *  }
                                 *
                                 *
                                 * }
                                 * else
                                 * {
                                 *
                                 *  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "none", "<script> $(document).ready(alert(' ERROR(ES):" + string.Join(", ", lecturaxlsTP.ErrorString) + "'));</script>", false);
                                 *
                                 * }
                                 */
                            }

                            ScriptManager.RegisterStartupScript(this, typeof(Page), "CallMySecondFunction", Function, true);
                            ChargeGridPedido(pedido.Detalle);
                        }
                        LblNombrePedido.Text  = pedido.Datos._OrderName;
                        LblObservaciones.Text = pedido.Datos._Observacion;
                    }
                }
            }
        }
    }