Exemple #1
0
 public async Task <IActionResult> AddToPlaylist(HybridModel song)
 {
     if (ModelState.IsValid)
     {
         _Context.Add(song.songModel);
         await _Context.SaveChangesAsync();
     }
     return(RedirectToAction(nameof(MySongs)));
 }
Exemple #2
0
        public async Task <IActionResult> Index()
        {
            HybridModel SongModel = new HybridModel();

            SongModel.songModel = new Song();
            SongModel.songs     = await _Context.Song.ToListAsync();

            return(View(SongModel));
        }
Exemple #3
0
 public async Task <IActionResult> AddSong(HybridModel song)
 {
     song.songModel.Adds = 0;
     if (ModelState.IsValid)
     {
         _Context.Add(song.songModel);
         await _Context.SaveChangesAsync();
     }
     return(RedirectToAction(nameof(Index)));
 }
Exemple #4
0
        public ActionResult HybridForm(int id, string publicRequestKey)
        {
            ActionResult result;
            var          model = new HybridModel();
            var          order = _orderService.GetOrderById(id);
            string       storeLocation;

            model.ID = id;
            model.PUBLICREQUESTKEY = publicRequestKey;
            model.EMAIL            = order.BillingAddress.Email;
            model.NOMBRECOMPLETO   = order.BillingAddress.FirstName + " " + order.BillingAddress.LastName;

            if (_todoPagoPaymentSettings.Ambiente == Ambiente.Production)
            {
                model.URL_HYBRIDFORM = "https://forms.todopago.com.ar/resources/v2/TPBSAForm.min.js";
            }
            else
            {
                model.URL_HYBRIDFORM = "https://developers.todopago.com.ar/resources/v2/TPBSAForm.min.js";
            }

            if (_webHelper.IsCurrentConnectionSecured())
            {
                storeLocation = _webHelper.GetStoreLocation(true);
            }
            else
            {
                storeLocation = _webHelper.GetStoreLocation(false);
            }

            model.URL_OK    = storeLocation + "Plugins/PaymentTodoPago/OrderReturn?ordenId=" + id;
            model.URL_ERROR = storeLocation + "Plugins/PaymentTodoPago/OrderStatusTP/" + id;

            model.Amount = order.OrderTotal;

            if (_httpContext.Session["BilleteraHíbrido"] != null)
            {
                model.Billetera = (string)_httpContext.Session["BilleteraHíbrido"];
            }
            else
            {
                model.Billetera = "F";
            }

            result = View("~/Plugins/Payments.TodoPago/Views/PaymentTodoPago/HybridForm.cshtml", model);

            return(result);
        }
Exemple #5
0
        public async Task <IActionResult> ToPlaylist(HybridModel song)
        {
            var CurrentUser = await _user.GetUserAsync(User);

            MySongs playlistSong = new MySongs();

            playlistSong.SongID    = song.songModel.ID;
            playlistSong.UserEmail = CurrentUser.Email;

            if (ModelState.IsValid)
            {
                _MySongsContext.Add(song.songModel);
                await _MySongsContext.SaveChangesAsync();
            }
            return(RedirectToAction(nameof(Index)));
        }
Exemple #6
0
    public void SpawnHybridModel()
    {
        if (!Player || !HybridModelParent)
        {
            return;
        }
        if (!Player.HasHybridModel) //If none, save the one in controller
        {
            GameObject hybrid = HybridModelParent.GetComponentInChildren <HybridModel>().gameObject;
            hybrid.GetComponentInChildren <Renderer>().material.SetColor("_BaseColor", Player.color);
            Player.SaveHybridModel(hybrid);
        }

        foreach (Transform child in HybridModelParent) //Clear controller of meshes
        {
            Destroy(child.gameObject);
        }
        HybridModel = Player.GetHybridModelCopy(HybridModelParent); //Spawn hybrid model
        HybridModel.gameObject.SetActive(true);
    }