Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var orders = new List <Product>();

        if (IsPostBack)
        {
            return;
        }
        var incrementId = Request.GetFriendlyUrlSegments()[0];

        lblNumOrdine.Text = incrementId;
        var orderDetail = _repository.GetOrderInfos(int.Parse(incrementId));
        var serializer  = new Conversive.PHPSerializationLibrary.Serializer();

        foreach (var orderProduct in orderDetail.items)
        {
            var deserializedProductOptionsBuyRequest = (Hashtable)serializer.Deserialize(orderProduct.product_options);
            var deserializedProductOptions           = (Hashtable)deserializedProductOptionsBuyRequest["info_buyRequest"];
            var p = new Product
            {
                product_id = (string)deserializedProductOptions["product_id"],
                price      = (string)deserializedProductOptions["price"],
                qty        = (string)deserializedProductOptions["qty"],
                name       = (string)deserializedProductOptions["name"],
                imageurl   = string.Empty
            };
            orders.Add(p);
        }
        BindOrderToForm(orderDetail);
        lvOrders.DataSource = orders;
        lvOrders.DataBind();
    }
    private static void phpDeserializer(string product_options)
    {
        Conversive.PHPSerializationLibrary.Serializer php = new Conversive.PHPSerializationLibrary.Serializer();
        Hashtable ht = (Hashtable)php.Deserialize(product_options);

        htDumper(ht);
        return;
    }
Example #3
0
    private static Hashtable DeserializeOrderInfos(OrderProduct orderProduct)
    {
        // deserializza le informazioni ottenute
        var serializer = new Conversive.PHPSerializationLibrary.Serializer();
        var deserializedProductOptions = serializer.Deserialize(orderProduct.product_options) as Hashtable;

        if (deserializedProductOptions == null)
        {
            return(null);
        }
        var deserializedBuyRequest = deserializedProductOptions["info_buyRequest"] as Hashtable;

        if (deserializedBuyRequest == null)
        {
            return(null);
        }
        return(deserializedBuyRequest);
    }
Example #4
0
File: NNET.cs Project: rj128x/PIMVC
        public void init(NNETMODEL name)
        {
            Serializer serializer=new Serializer();

            switch (name) {
                case NNETMODEL.vges_nb:
                    nnetObj = serializer.Deserialize(nnet.vges_nb);
                    break;
            }

            Hashtable nnetArr=nnetObj as Hashtable;
            l1c = this.readListListDouble(nnetArr["l1c"]);
            l2c = this.readListListDouble(nnetArr["l2c"]);
            l1w = this.readListListDouble(nnetArr["l1w"]);
            l2w = this.readListListDouble(nnetArr["l2w"]);
            l1b = this.readListDouble(nnetArr["l1b"]);
            l2b = this.readListDouble(nnetArr["l2b"]);
        }