public IHttpActionResult PostActivateProduct(ActivateUserProduct data) { //Todo доабвить локаль для перевода string userId = User.Identity.GetUserId(); Store store = new Store(); StoreItem parameters = store.GetProductParametersByProductId(data.ProductId); int productType = parameters.product_typeId; Dictionary <string, dynamic> properties = System.Web.Helpers.Json.Decode(parameters.property); UserChest userChest = new UserChest(); ChestFields chestItem = userChest.GetChestData(userId, data.ProductId, false); if (MONEY_SG_TYPE == productType) { return(Json("MONEY_SG_TYPE")); } else if (PREMIUM_TYPE == productType) { Premium premium = new Premium(); premium.InitializePremium(userId, chestItem.Id, properties); } // else if (ACCOUNT_TYPE_SERVICE == productType) // { // return Json(productType); // } else if (BOOSTER_TYPE == productType) { Booster booster = new Booster(); booster.InitializeBooster(userId, chestItem, parameters, data.ProductId); } // else if (SKIN_TYPE == productType) // { // return Json(productType); // } var chestItems = userChest.GetCountProductId(userId, false); var result = new Dictionary <int, ChestFields>(); foreach (ChestFields chstItem in chestItems) { var productId = chstItem.ProductId; var productCount = chstItem.Count; ChestFields productProperties = userChest.GetProductProperties(productId, productCount, data.Lang.ToUpper()); result.Add(productId, productProperties); } return(Json(result)); }