public ActionResult SuccessView(string MerchantTradeNo)
        {
            Order        order = _checkoutService.GetOrder(MerchantTradeNo);
            OrderDetail  od    = _checkoutService.GetOrderDetail(order);
            UserFavorite userF = _checkoutService.GetFavorite(od);

            SuccessViewModel viewModel = new SuccessViewModel
            {
                FavoriteId      = userF.FavoriteId,
                IsPackage       = userF.IsPackage,
                Package         = null,
                UserDefinedList = null,
                RoomTypeList    = _checkoutService.GetRoomTypeList(),
                SquareFeetList  = _checkoutService.GetSquareFeetList(),
                DateService     = order.DateService,
                Address         = order.Address,
                DiscountAmount  = _checkoutService.GetCouponAmount(order.CouponDetailId),
                FinalPrice      = od.FinalPrice,
            };

            if (userF.IsPackage)
            {
                viewModel.Package = _checkoutService.GetPackage(userF);
            }
            else
            {
                viewModel.UserDefinedList = _checkoutService.GetUserDefinedList(userF);
            }

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public ActionResult UserActivate(Guid id)
        {
            if (ModelState.IsValid)
            {
                Result <EvernoteUser> res = eum.ActivateUser(id);
                if (res.Errors.Count > 0)
                {
                    ErrorViewModel err = new ErrorViewModel()
                    {
                        Title = "Geçersiz İşlem",
                        Items = res.Errors
                    };
                    return(View("Error", err));
                }

                SuccessViewModel succ = new SuccessViewModel()
                {
                    Title          = "Hesap Aktifleştirildi",
                    RedirectingUrl = "/Login/Login",
                };
                succ.Items.Add("Hesabınınz aktifleştirildi. Artık siteme giriş yapabilir,not yazabilir ve beğenip yorum yapabilirsiniz");
                return(View("Success", succ));
            }

            return(View());
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Add(AddEntryOrExitPointViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (!await mediator.SendAsync(new CheckEntryOrExitPointUnique(model.CountryId.Value, model.Name)))
            {
                ModelState.AddModelError("Name", EntryOrExitPointControllerResources.NameNotUniqueMessage);

                return(View(model));
            }

            await mediator.SendAsync(new AddEntryOrExitPoint(model.CountryId.Value, model.Name));

            var countryName = model.Countries.SingleOrDefault(c => c.Id == model.CountryId.Value).Name;

            var successModel = new SuccessViewModel
            {
                PortName    = model.Name,
                CountryName = countryName
            };

            return(View("Success", successModel));
        }
        public async Task<ActionResult> Add(AddEntryOrExitPointViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            if (!await mediator.SendAsync(new CheckEntryOrExitPointUnique(model.CountryId.Value, model.Name)))
            {
                ModelState.AddModelError("Name", EntryOrExitPointControllerResources.NameNotUniqueMessage);

                return View(model);
            }

            await mediator.SendAsync(new AddEntryOrExitPoint(model.CountryId.Value, model.Name));

            var countryName = model.Countries.SingleOrDefault(c => c.Id == model.CountryId.Value).Name;

            var successModel = new SuccessViewModel
            {
                PortName = model.Name,
                CountryName = countryName
            };

            return View("Success", successModel);
        }
Exemplo n.º 5
0
        public IActionResult Summary(Guid id)
        {
            Booking          booking          = context.Bookings.Find(id);
            SuccessViewModel successViewModel = new SuccessViewModel();

            successViewModel.First_Name    = booking.First_Name;
            successViewModel.Last_Name     = booking.Last_Name;
            successViewModel.PhoneNumber   = booking.PhoneNumber;
            successViewModel.Email         = booking.Email;
            successViewModel.Address       = booking.Address;
            successViewModel.Age           = booking.Age;
            successViewModel.Age           = booking.Depature_Time;
            successViewModel.Fare          = booking.Fare;
            successViewModel.From          = booking.From;
            successViewModel.To            = booking.To;
            successViewModel.Motor_park    = booking.Motor_park;
            successViewModel.Prefered_Seat = booking.Prefered_Seat;
            successViewModel.Travel_Date   = booking.Travel_Date;
            successViewModel.Depature_Time = booking.Depature_Time;
            successViewModel.Vehicle       = booking.Vehicle;



            return(View(successViewModel));
        }
Exemplo n.º 6
0
        public ActionResult Success(Guid id)
        {
            var model = new SuccessViewModel();

            model.NotificationId = id;
            return(View(model));
        }
Exemplo n.º 7
0
        public async Task <ActionResult> Success(SuccessViewModel model)
        {
            var param       = HttpUtility.ParseQueryString(model.custom);
            var ticketsId   = param["ticketsId"].Split(',').Select(x => Int32.Parse(x)).ToList();
            var transaction = await repository.GetTransactionByIdAsync(model.transaction_id);

            if (transaction != null)
            {
                var tickets = await repository.GetTicketsByIdsAsync(ticketsId);

                if (ticketsId.Count > 0)
                {
                    transaction.Confirmed   = true;
                    transaction.PaymentDate = DateTime.Now;

                    tickets.ForEach(x =>
                    {
                        x.TransactionId = transaction.Id;
                        x.DrawingId     = transaction.DrawingId;
                    });
                    await repository.SaveChangesAsync();
                }
            }
            return(RedirectToAction("Index"));
        }
Exemplo n.º 8
0
        public ActionResult Register(RegisterDTO model)
        {
            // Modelin annotation kurallarana uygunğu kontrol ediliyor
            if (ModelState.IsValid)
            {
                BusinessLayerResult <User> registerResult = userManager.RegisterUser(model);

                if (registerResult.Errors.Count > 0)
                {
                    registerResult.Errors.ForEach(q => ModelState.AddModelError("", q.Message));                     // BLL'den gelen hatalar ModelState'e ekleniyor
                    return(View(model));
                }

                SuccessViewModel successViewModel = new SuccessViewModel()
                {
                    Title          = "Kayıt Başarılı",
                    RedirectingUrl = "/User/Login",
                };
                successViewModel.Items.Add("Mail adresinize yollana aktivasyon mail'ini kontrol edip hesabınızı doğrulayınız!");

                return(View("Success", successViewModel));                // Shared altındaki 'Success' view'ına gider
            }

            return(View(model));
        }
        public IActionResult Register(
            [FromBody] RegisterUserBindingModel model
            )
        {
            // get the user to verifty
            var userToVerify = _userManager.FindByNameAsync(model.UserName);

            if (userToVerify.Result != null)
            {
                throw new Exception(AlreadyexistUser);
            }

            App.DataAccess.Identity.AspNetUsers user = new App.DataAccess.Identity.AspNetUsers
            {
                FirstName = "Ali",
                UserName  = "******"
            };
            //// App.DataAccess.Identity.AspNetUsers userIdentity = _mapper.Map<App.DataAccess.Identity.AspNetUsers>(model);
            IdentityResult result = _userManager.CreateAsync(user, model.Password).Result;

            if (result.Succeeded == false)
            {
                throw new Exception(AlreadyexistUserName);
            }
            var rModel = new SuccessViewModel
            {
                Detail = RegisterSuccessDetail
            };

            return(Success(rModel));
        }
Exemplo n.º 10
0
        // Kullanıcının kendini aktif etmesini sağlayan action
        public ActionResult UserActivate(Guid id)
        {
            // Todo: Kullanıcı aktivasyonu sağlanacak
            BusinessLayerResult <User> resultUser = userManager.ActivateUser(id);

            if (resultUser.Errors.Count > 0)
            {
                TempData["Errors"] = resultUser.Errors;

                ErrorViewModel errorViewModel = new ErrorViewModel
                {
                    Title = "Geçersiz İşlem",
                    RedirectingTimeout = 4000,
                    Items = resultUser.Errors
                };
                return(View("Error", errorViewModel));                // Shared altındaki 'Error' view'ına gider
            }

            SuccessViewModel successViewModel = new SuccessViewModel()
            {
                Title          = "Hesap Aktiflerştirildi!",
                RedirectingUrl = "/User/Login"
            };

            successViewModel.Items.Add("Hesabınız Doğrulandı. Not paylaşabilirsiniz!");

            return(View("Success", successViewModel));            // Shared altındaki 'Success' view'ına gider
        }
Exemplo n.º 11
0
        public void MoreShipments_CorrectHeading()
        {
            var viewModel = new SuccessViewModel(AnyGuid, new List <int> {
                1, 5, 9, 21
            });

            Assert.Equal("You've successfully cancelled shipments 1, 5, 9 and 21", viewModel.HeadingText);
        }
Exemplo n.º 12
0
        public async Task IndexWithVMActionIsSuccessfulAndCallsLogic()
        {
            SuccessViewModel successViewModel = DataGenerator.GetViewModel <SuccessViewModel>
                                                    (await _pokemonFormController.Index(new PokemonFormViewModel()));

            Assert.AreEqual("addition", successViewModel.ActionName);

            _pokedexAppLogicMock.Verify(plm => plm.AddPokemon(It.IsAny <PokemonFormViewModel>()), Times.Once);
        }
Exemplo n.º 13
0
        public async Task <ActionResult> Success(Guid notificationId, Guid[] movementIds)
        {
            ViewBag.NotificationId = notificationId;
            var movements = await mediator.SendAsync(new GetMovementsByIds(notificationId, movementIds));

            var model = new SuccessViewModel(movements);

            return(View(model));
        }
Exemplo n.º 14
0
        public IActionResult Success()
        {
            SuccessViewModel vm = new SuccessViewModel
            {
                Contacts = GetContacts()
            };

            return(View(vm));
        }
Exemplo n.º 15
0
        public IActionResult Success(string id)
        {
            var model = new SuccessViewModel()
            {
                MaskedPageUrl = $"{_settings.Value.Hostname}{id}"
            };

            return(View(model));
        }
Exemplo n.º 16
0
        public async Task EditIsSuccessfulAndCallsLogic()
        {
            IActionResult result = await _pokedexController.Edit(new PokemonDetailViewModel());

            SuccessViewModel successViewModel = DataGenerator.GetViewModel <SuccessViewModel>(result);

            Assert.AreEqual("edit", successViewModel.ActionName);

            _pokedexAppLogicMock.Verify(plm => plm.EditPokemon(It.IsAny <PokemonDetailViewModel>()), Times.Once);
        }
Exemplo n.º 17
0
        public ActionResult Success(Guid id, int numberOfAnnexes)
        {
            var model = new SuccessViewModel
            {
                NotificationId  = id,
                AnnexesUploaded = numberOfAnnexes
            };

            return(View(model));
        }
Exemplo n.º 18
0
        public async Task DeleteActionIsSuccessfulAndCallsLogic()
        {
            IActionResult result = await _pokedexController.Delete(DataGenerator.DefaultGuid);

            SuccessViewModel successViewModel = DataGenerator.GetViewModel <SuccessViewModel>(result);

            Assert.AreEqual("release", successViewModel.ActionName);

            _pokedexAppLogicMock.Verify(plm => plm.DeletePokemonById(DataGenerator.DefaultGuid), Times.Once);
        }
        public ActionResult Buy(BuyTicketModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    Guest  guest    = new Guest();
                    string email    = User.Identity.Name;
                    int    memberId = _memberManager.RetrieveMemberByEmail(email);
                    guest = _guestManager.RetrieveGuestByEmail(email);
                    MemberTab memberTab = _memberTabManager.RetrieveActiveMemberTabByMemberID(memberId);
                    Offering  offering  = _offeringManager.RetrieveOfferingByID(model.OfferingID);

                    MemberTabLine tab = new MemberTabLine()
                    {
                        MemberTabID   = memberTab.MemberTabID,
                        OfferingID    = model.OfferingID,
                        Quantity      = model.Quantity,
                        Price         = model.Price,
                        EmployeeID    = offering.EmployeeID,
                        Discount      = 0,
                        GuestID       = guest.GuestID,
                        DatePurchased = DateTime.Now
                    };
                    if (_memberTabManager.CreateMemberTabLine(tab) != 0)
                    {
                        TempData["success"] = new SuccessViewModel(
                            Title: "an Event!",
                            dateTime: model.Date.ToShortDateString(),
                            type: model.EventTitle,
                            time: " the greatest time of your life",
                            ButtonMessage: "Go to Account",
                            ReturnController: "MyAccount",
                            ReturnAction: "Index"
                            );

                        return(RedirectToAction("Index", "Success"));
                    }
                }
                catch (Exception ex)
                {
                    TempData["error"] = new ErrorViewModel(
                        Title: "Events",
                        Message: "We could not purhcase your ticket at this time ",
                        ExceptionMessage: ex.Message,
                        ButtonMessage: "Try again",
                        ReturnController: "Event",
                        ReturnAction: "Index"
                        );

                    return(RedirectToAction("Index", "Error"));
                }
            }
            return(View(model));
        }
        public ActionResult SuccessView()
        {
            string MerchantTradeNo = Request.Form["MerchantTradeNo"] ?? "";
            string TradeNo         = Request.Form["TradeNo"] ?? "";
            string RtnCode         = Request.Form["RtnCode"];

            //string PaymentType = Request.Form["PaymentType"];
            //string SimulatePaid = Request.Form["SimulatePaid"];
            //string CheckMacValue = Request.Form["CheckMacValue"];
            //string MerchantID = Request.Form["MerchantID"];
            //string StoreID = Request.Form["StoreID"];
            //string RtnMsg = Request.Form["RtnMsg"];
            //string TradeAmt = Request.Form["TradeAmt"];
            //string PaymentDate = Request.Form["PaymentDate"];
            //string PaymentTypeChargeFee = Request.Form["PaymentTypeChargeFee"];
            //string TradeDate = Request.Form["TradeDate"];

            foreach (var key in Request.Form.AllKeys)
            {
                Debug.WriteLine($"success: {key}, {Request.Form[key]}");
            }
            if (RtnCode != "1")
            {
                ViewData["Title"]   = "付款失敗";
                ViewData["Content"] = "付款失敗,請前往會員中心,並重新付款";
                return(View("Message"));
            }
            Order        order = _checkoutService.GetOrder(MerchantTradeNo, TradeNo);
            OrderDetail  od    = _checkoutService.GetOrderDetail(order);
            UserFavorite userF = _checkoutService.GetFavorite(od);

            SuccessViewModel viewModel = new SuccessViewModel {
                FavoriteId      = userF.FavoriteId,
                IsPackage       = userF.IsPackage,
                Package         = null,
                UserDefinedList = null,
                RoomTypeList    = _checkoutService.GetRoomTypeList(),
                SquareFeetList  = _checkoutService.GetSquareFeetList(),
                DateService     = order.DateService,
                Address         = order.Address,
                DiscountAmount  = _checkoutService.GetCouponAmount(order.CouponDetailId),
                FinalPrice      = od.FinalPrice,
            };

            if (userF.IsPackage)
            {
                viewModel.Package = _checkoutService.GetPackage(userF);
            }
            else
            {
                viewModel.UserDefinedList = _checkoutService.GetUserDefinedList(userF);
            }

            return(View(viewModel));
        }
Exemplo n.º 21
0
        public SuccessViewModel CalculateSuccess(SongViewModel song)
        {
            try
            {
                SongBE entity;
                entity = Mapper.Map <SongViewModel, SongBE>(song);
                SongDAL          songDAL          = new SongDAL();
                SuccessViewModel successViewModel = new SuccessViewModel();


                var listSongs = songDAL.GetSongsToCalculate(entity.Category);


                (int sampleRate, double[] audio) = WavFile.ReadMono(FileUtils.GetRepoMusicPath(song.SongKey));


                var spec = new Spectrogram.Spectrogram(sampleRate / 2, fftSize: (16384 / 8), stepSize: (2500 * 5), maxFreq: 2200);
                spec.Add(audio);
                var tempPath = Path.GetTempPath();
                spec.SaveImage(tempPath + "/" + song.SongKey + ".jpg", intensity: 5, dB: true);

                var file = FileUtils.GetImageBytes(tempPath + "/" + song.SongKey + ".jpg");
                successViewModel.ImageBase64 = "data:image/jpg;base64," + Convert.ToBase64String(file);

                var bmHash = this.GetHash(spec.GetBitmap());



                List <Spectrogram.Spectrogram> spectrograms = new List <Spectrogram.Spectrogram>();

                foreach (var son in listSongs)
                {
                    (int sampleRateSong, double[] audioSong) = WavFile.ReadMono(FileUtils.GetRepoMusicPath(son.SongKey));
                    var specSong = new Spectrogram.Spectrogram(sampleRateSong / 2, fftSize: (16384 / 8), stepSize: (2500 * 5), maxFreq: 2200);
                    specSong.Add(audioSong);
                    spectrograms.Add(specSong);
                }

                int equalElements = 0;

                foreach (var sp in spectrograms)
                {
                    equalElements += bmHash.Zip(this.GetHash(sp.GetBitmap()), (i, j) => i == j).Count(eq => eq);
                }

                var con = Convert.ToInt32(equalElements / spectrograms.Count);
                successViewModel.Percentage = Convert.ToInt32((con * 100) / bmHash.Count);
                return(successViewModel);
            }
            catch (Exception ex)
            {
                throw new Exception(Messages.Generic_Error);
            }
        }
Exemplo n.º 22
0
        public IActionResult Success(string message, double value, double balance)
        {
            var viewModel = new SuccessViewModel
            {
                Message = message,
                Value   = value,
                Balance = balance
            };

            return(View(viewModel));
        }
Exemplo n.º 23
0
        public IActionResult ShowMessage(Result result, int referringGroupId, CapturedFeedback capturedFeedback = null)
        {
            var notification = result switch
            {
                Result.Success => new NotificationModel
                {
                    Type     = NotificationType.Success,
                    Title    = "Thank you",
                    Subtitle = "Your comments have been submitted",
                    Message  = $"<p>We’ll use your feedback to make HelpMyStreet {(capturedFeedback.FeedbackRating == FeedbackRating.HappyFace ? "even better" : "as good as it can be")}.</p>{(capturedFeedback.IncludesMessage ? "<p>We’ll pass your messages on to the people involved with this request.</p>" : "")}"
                },
                Result.Failure_IncorrectJobStatus => new NotificationModel
                {
                    Type     = NotificationType.Failure_Permanent,
                    Title    = "Sorry, that didn't work",
                    Subtitle = "We couldn’t record your feedback",
                    Message  = "<p>The request is not currently marked as complete in our system.</p><p>If you’d like to get in touch, please email <a href='mailto:[email protected]'>[email protected]</a>.</p>"
                },
                Result.Failure_FeedbackAlreadyRecorded => new NotificationModel
                {
                    Type     = NotificationType.Failure_Permanent,
                    Title    = "Sorry, that didn’t work",
                    Subtitle = "We couldn’t record your feedback",
                    Message  = "<p>We may already have feedback relating to that request.</p><p>If you’d like to get in touch, please email <a href='mailto:[email protected]'>[email protected]</a>.</p>"
                },
                Result.Failure_RequestArchived => new NotificationModel
                {
                    Type     = NotificationType.Failure_Permanent,
                    Title    = "Sorry, that didn't work",
                    Subtitle = "We couldn’t record your feedback",
                    Message  = "<p>That request may have been too long ago.</p><p>If you’d like to get in touch, please email <a href='mailto:[email protected]'>[email protected]</a>.</p>"
                },
                Result.Failure_ServerError => new NotificationModel
                {
                    Type     = NotificationType.Failure_Temporary,
                    Title    = "Sorry, that didn’t work",
                    Subtitle = "We couldn’t record your feedback at this time",
                    Message  = "<p>This is usually a temporary problem; please press your browser’s back button to try again.</p><p>Alternatively, you can email us at <a href='mailto:[email protected]'>[email protected]</a>.</p>"
                },
                _ => throw new ArgumentException($"Unexpected Result value: {result}", nameof(result))
            };

            var vm = new SuccessViewModel()
            {
                //TODO: Don't assume all groups have open request forms
                RequestLink   = $"/request-help/{Base64Utils.Base64Encode(referringGroupId)}",
                Notifications = new List <NotificationModel> {
                    notification
                },
            };

            return(View("PostTaskFeedbackCaptureMessage", vm));
        }
    }
Exemplo n.º 24
0
        public async Task<ActionResult> Success(Guid id)
        {
            var notificationId = await mediator.SendAsync(new GetNotificationIdByMovementId(id));
            var movementNumber = await mediator.SendAsync(new GetMovementNumberByMovementId(id));

            var model = new SuccessViewModel
            {
                NotificationId = notificationId,
                MovementNumber = movementNumber
            };

            return View(model);
        }
Exemplo n.º 25
0
        public static string Render(string key)
        {
            var engine = new RazorLightEngineBuilder()
                         .SetOperatingAssembly(Assembly.GetAssembly(typeof(RazorRendere)))
                         .UseEmbeddedResourcesProject(typeof(RazorRendere))
                         .UseMemoryCachingProvider()
                         .Build();

            var model = new SuccessViewModel {
                Name = "John Doe", Age = 37
            };

            return(engine.CompileRenderAsync($"Templates.{key}", model).Result);
        }
Exemplo n.º 26
0
        // TestNotification
        public ActionResult TestNotify()
        {
            SuccessViewModel model = new SuccessViewModel()
            {
                Header             = "Başarılı Mesaj denemesi",
                Title              = "Success Test",
                RedirectingTimeout = 4000,
                Items              = new List <string> {
                    "Test başarılı 1", "Test başarılı 2"
                }
            };

            return(View("Success", model));
        }
Exemplo n.º 27
0
        public async Task <ActionResult> Success(Guid id)
        {
            var notificationId = await mediator.SendAsync(new GetNotificationIdByMovementId(id));

            var movementNumber = await mediator.SendAsync(new GetMovementNumberByMovementId(id));

            var model = new SuccessViewModel
            {
                MovementNumber = movementNumber,
                NotificationId = notificationId
            };

            return(View(model));
        }
Exemplo n.º 28
0
        public IViewModel Register(RegisterViewModel model)
        {
            IViewModel result;

            try
            {
                Console.WriteLine("AccountService(Register): Trying to register");
                if (string.IsNullOrEmpty(model.UserName) || string.IsNullOrEmpty(model.Password) || string.IsNullOrEmpty(model.PasswordConfirm))
                {
                    Console.WriteLine("AccountService(Register): Field empty");
                    return(new ErrorViewModel()
                    {
                        Error = "Veuillez remplir tout les champs"
                    });
                }
                else if (!model.Password.Equals(model.PasswordConfirm))
                {
                    Console.WriteLine("AccountService(Register): Wrong password");
                    return(new ErrorViewModel()
                    {
                        Error = "Les mot de passe ne sont pas les même"
                    });
                }
                else if (_context.Accounts.Any(a => a.UserName.ToLower().Equals(model.UserName.ToLower())))
                {
                    Console.WriteLine($"AccountService(Register): UserName already exist({model.UserName})");
                    return(new ErrorViewModel()
                    {
                        Error = "Nom de compte déjà existant"
                    });
                }
                var account = new Account()
                {
                    UserName = model.UserName,
                    Password = model.Password
                };
                _context.Add(account);
                _context.SaveChanges();
                result = new SuccessViewModel();
                Console.WriteLine("AccountService(Register): Registered");
            }
            catch (Exception e)
            {
                Console.Error.WriteLine($"AccountService(Login): {e.Message}\n{e.StackTrace}");
                result = new ErrorViewModel();
            }
            return(result);
        }
        public ActionResult Create(AppointmentModel appointment)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    Guest  guest = new Guest();
                    string email = User.Identity.Name;
                    guest = _guestManager.RetrieveGuestByEmail(email);
                    Appointment appt = new Appointment()
                    {
                        AppointmentType = appointment.AppointmentType,
                        Description     = appointment.Description,
                        StartDate       = appointment.StartDate,
                        EndDate         = appointment.StartDate.AddDays(1),
                        GuestID         = guest.GuestID
                    };
                    if (_apptManager.CreateAppointmentByGuest(appt))
                    {
                        TempData["success"] = new SuccessViewModel(
                            Title: "an Appointment!",
                            dateTime: appointment.StartDate.ToShortDateString(),
                            type: appointment.AppointmentType,
                            time: appointment.Time,
                            ButtonMessage: "Go to Account",
                            ReturnController: "MyAccount",
                            ReturnAction: "Index"
                            );

                        return(RedirectToAction("Index", "Success"));
                    }
                }
                catch (Exception ex)
                {
                    TempData["error"] = new ErrorViewModel(
                        Title: "Appointment",
                        Message: "We could not schedule you an appoinment for " + appointment.AppointmentType,
                        ExceptionMessage: ex.Message,
                        ButtonMessage: "Back to Amenities",
                        ReturnController: "Amenitites",
                        ReturnAction: "Index"
                        );

                    return(RedirectToAction("Index", "Error"));
                }
            }
            return(View(appointment));
        }
Exemplo n.º 30
0
        public async Task <IActionResult> PaymentSuccess(string form, [FromQuery] string reference)
        {
            var result = await _successWorkflow.Process(EBehaviourType.SubmitAndPay, form);

            var success = new SuccessViewModel
            {
                Reference        = reference,
                PageContent      = result.HtmlContent,
                FormName         = result.FormName,
                StartPageUrl     = result.StartPageUrl,
                PageTitle        = result.PageTitle,
                BannerTitle      = result.BannerTitle,
                LeadingParagraph = result.LeadingParagraph
            };

            return(View("../Home/Success", success));
        }
Exemplo n.º 31
0
        public IViewModel Logout(Account current)
        {
            IViewModel result = new SuccessViewModel();

            try
            {
                Console.WriteLine($"AccountService(Logout): Deconnection account({current.Id})");
                current.Token = null;
                _context.Update(current);
                _context.SaveChanges();
            }catch (Exception e)
            {
                Console.Error.WriteLine($"AccountService(Logout): {e.Message}\n{e.StackTrace}");
                result = new ErrorViewModel();
            }
            return(result);
        }
Exemplo n.º 32
0
        public IActionResult Success(Fulfillable fulfillable, RequestHelpFormVariant requestHelpFormVariant, string referringGroup, string source)
        {
            source = ValidateSource(source);

            string button;

            string message = requestHelpFormVariant switch
            {
                RequestHelpFormVariant.FtLOS => @"<p>Your request has been received and we are looking for a volunteer who can help. Someone should get in touch shortly.</p>
                                                    <p>For the Love of Scrubs ask for a small donation of £3 - £4 per face covering to cover the cost of materials and help support their communities. Without donations they aren’t able to continue their good work.</p>
                                                    <p>If you are able to donate, you can do so on their Go Fund Me page <a href='https://www.gofundme.com/f/for-the-love-of-scrubs-face-coverings\' target=\'_blank\'>here</a>.<p>",
                RequestHelpFormVariant.Ruddington => @"<p>Your request has been received and we're looking for a volunteer who can help, as soon as we find someone we’ll let you know by email. Please be aware that we cannot guarantee help, but we’ll do our best to find a volunteer near you.</p>",
                _ => @"<p>Your request has been received and we are looking for a volunteer who can help. Someone should get in touch shortly.</p>"
            };

            if (User.Identity.IsAuthenticated)
            {
                button = $"<a href='/account' class='btn cta large fill mt16 cta--orange'>Done</a>";
            }
            else
            {
                message += "<p><strong>Would you be happy to help a neighbour?</strong></p>";
                message += "<p>Could you help a member of your local community if they needed something? There are lots of different ways you can help, from offering a friendly chat, to picking up groceries or prescriptions, or even sewing a face covering. Please take 5 minutes to sign up now.</p>";
                button   = $"<a href='/login' class='btn cta large fill mt16 '>Sign Up or Log In</a>";
            }

            List <NotificationModel> notifications = new List <NotificationModel> {
                new NotificationModel
                {
                    Title    = "Thank you",
                    Subtitle = "Your request has been received",
                    Type     = Enums.Account.NotificationType.Success,
                    Message  = message,
                    Button   = button
                }
            };

            SuccessViewModel vm = new SuccessViewModel
            {
                Notifications = notifications,
                RequestLink   = $"/request-help/{referringGroup}/{source}"
            };

            return(View(vm));
        }
 public ActionResult Success(SuccessViewModel model)
 {
     return View(model);
 }
        public ActionResult Success(Guid id)
        {
            object newUserEmail;
            object notificationNumber;

            if (TempData.TryGetValue(NotificationNumberKey, out notificationNumber) &&
                TempData.TryGetValue(NewUserEmailKey, out newUserEmail))
            {
                var model = new SuccessViewModel
                {
                    NotificationNumber = notificationNumber.ToString(),
                    NewUserEmail = newUserEmail.ToString()
                };

                return View(model);
            }

            return View();
        }
        public void MoreShipments_CorrectHeading()
        {
            var viewModel = new SuccessViewModel(AnyGuid, new List<int> { 1, 5, 9, 21 });

            Assert.Equal("You've successfully cancelled shipments 1, 5, 9 and 21", viewModel.HeadingText);
        }
Exemplo n.º 36
0
        public ActionResult Success(Guid id, int numberOfAnnexes)
        {
            var model = new SuccessViewModel
            {
                NotificationId = id,
                AnnexesUploaded = numberOfAnnexes
            };

            return View(model);
        }