Ejemplo n.º 1
0
        public async Task <IActionResult> MyCard()
        {
            var userId = this.userManager.GetUserId(this.User);

            var model = new MyCardViewModel()
            {
                UserCard            = await this.usersService.GetUserCardAsync <UserCardViewModel>(userId),
                SkinCareCategoryId  = await this.categoriesService.GetIdByNameAsync(GlobalConstants.CategorySkinName),
                NailsCategoryId     = await this.categoriesService.GetIdByNameAsync(GlobalConstants.CategoryNailsName),
                HaircutsProcedureId = await this.proceduresService.GetIdByNameAsync(GlobalConstants.ProcedureHairCutName),
            };

            return(this.View(model));
        }
Ejemplo n.º 2
0
        public IActionResult BuyCard(MyCardViewModel inputModel)
        {
            if (inputModel.Visits != 12 &&
                inputModel.Visits != 16 &&
                inputModel.Visits != 20 &&
                inputModel.Visits != 30)
            {
                return(this.Redirect("/Users/MyCard"));
            }

            if (this.cardsService.HasCardVisits(inputModel.Id))
            {
                return(this.Redirect("/Users/MyCard?hasVisits=true"));
            }

            return(this.Redirect($"/Paypal/CreatePayment?visits={inputModel.Visits}"));
        }
Ejemplo n.º 3
0
 public MyCardPage()
 {
     InitializeComponent();
     BindingContext = new MyCardViewModel();
 }