public string GetPurchase(int i) { if (Items.Count > 0) { SimpleVItem item = Items[i]; return(item.Quantity + " x " + item.Name); } else { return(""); } }
public IParseble Parse(JSONNode rootNode) { TotalWithoutDiscount = rootNode["finance"]["total_without_discount"]["vc_amount"].AsInt; Total = rootNode["finance"]["total"]["vc_amount"].AsInt; IsSkipConfirmation = rootNode["skip_confirmation"].AsBool; JSONArray jarrItems = rootNode["purchase"]["virtual_items"].AsArray; IEnumerator<JSONNode> iEnumerator = jarrItems.Childs.GetEnumerator(); while (iEnumerator.MoveNext()) { JSONNode itemNode = iEnumerator.Current; SimpleVItem newItem = new SimpleVItem(itemNode["name"].Value, itemNode["image_url"].Value, itemNode["quantity"].AsInt); Items.Add(newItem); } return this; }
public IParseble Parse(JSONNode rootNode) { OperationId = rootNode["operation_id"].Value; OperationType = rootNode["operation_type"].Value; OperationCreated = rootNode["operation_created"].Value; VcAmount = rootNode["finance"]["total"]["vc_amount"].Value; BackUrl = rootNode["back_url"].Value; ReturnTegion = rootNode["return_region"].Value; BackUrlCaption = rootNode["back_url_caption"].Value; JSONNode statusNode = rootNode["status"]; if (statusNode != null) { Status = new XStatus(statusNode["code"].Value, statusNode["description"].Value, statusNode["header"].Value, statusNode["header_description"].Value); } IEnumerator <JSONNode> iEnumerator; JSONArray jarrItems = rootNode["purchase"]["virtual_items"].AsArray; iEnumerator = jarrItems.Childs.GetEnumerator(); while (iEnumerator.MoveNext()) { JSONNode itemNode = iEnumerator.Current; SimpleVItem newItem = new SimpleVItem(itemNode["name"].Value, itemNode["description"].Value, itemNode["image_url"].Value, itemNode["quantity"].AsInt); Items.Add(newItem); } JSONArray jarrVC = rootNode["purchase"]["virtual_currency"].AsArray; iEnumerator = jarrVC.Childs.GetEnumerator(); while (iEnumerator.MoveNext()) { JSONNode itemNode = iEnumerator.Current; SimpleVCur newItem = new SimpleVCur(itemNode["vc_amount"].Value); vCurr.Add(newItem); } return(this); }
public IParseble Parse(JSONNode rootNode) { TotalWithoutDiscount = rootNode["finance"]["total_without_discount"]["vc_amount"].AsInt; Total = rootNode["finance"]["total"]["vc_amount"].AsInt; IsSkipConfirmation = rootNode["skip_confirmation"].AsBool; JSONArray jarrItems = rootNode["purchase"]["virtual_items"].AsArray; IEnumerator <JSONNode> iEnumerator = jarrItems.Childs.GetEnumerator(); while (iEnumerator.MoveNext()) { JSONNode itemNode = iEnumerator.Current; SimpleVItem newItem = new SimpleVItem(itemNode["name"].Value, itemNode["image_url"].Value, itemNode["quantity"].AsInt); Items.Add(newItem); } return(this); }