Exemplo n.º 1
0
        public AddLeaguePopupPage(OrganizerViewModel organizerViewModel)
        {
            ViewModel = organizerViewModel;
            InitializeComponent();

            BindingContext = ViewModel;
        }
Exemplo n.º 2
0
        public AddLeaguePage(OrganizerViewModel viewModel)
        {
            InitializeComponent();
            organizerViewModel = viewModel;

            Title = "Add League";

            BindingContext = organizerViewModel;
        }
Exemplo n.º 3
0
 private Organizer ConvertToBusinessModel(OrganizerViewModel model)
 {
     return(new Organizer
     {
         Id = model.Id,
         Name = model.Name,
         Email = model.Email,
         Phones = model.Phones
     });
 }
Exemplo n.º 4
0
        public ActionResult PublicProfile(string OrgID)
        {
            Organizer organizer = new Organizer();

            organizer.organizerID   = OrgID;
            organizer.organizerName = db.AspNetUsers.Find(OrgID).UserName;

            OrganizerViewModel organizerViewModel = new OrganizerViewModel(organizer);

            return(View(organizerViewModel));
        }
Exemplo n.º 5
0
        public ActionResult Edit(int Id)
        {
            var categoryBussiness = _provider.GetById(Id);
            var category          = new OrganizerViewModel()
            {
                Id     = categoryBussiness.Id,
                Name   = categoryBussiness.Name,
                Email  = categoryBussiness.Email,
                Phones = categoryBussiness.Phones
            };

            return(View(category));
        }
Exemplo n.º 6
0
        public ActionResult Edit(OrganizerViewModel viewModel)
        {
            var category = ConvertToBusinessModel(viewModel);

            try
            {
                _service.Update(category);
                return(RedirectToAction("Index"));
            }
            catch (Exception)
            {
                this.ModelState.AddModelError("", "Hello from organizer Controller!");
            }
            return(View(viewModel));
        }
Exemplo n.º 7
0
        public ActionResult Create(OrganizerViewModel model)
        {
            if (ModelState.IsValid)
            {
                var organizer = ConvertToBusinessModel(model);
                _service.Create(organizer);
                return(RedirectToAction("Index"));
            }
            else
            {
                this.ModelState.AddModelError("", "Hello from Controller!");
            }

            return(View(model));
        }
Exemplo n.º 8
0
        public async Task <IActionResult> Register(RegisterViewModel model, string returnUrl = null)
        {
            ViewData["ReturnUrl"] = returnUrl;
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser {
                    UserName = model.Email, Email = model.Email
                };
                var result = await _userManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    var organizer = new OrganizerViewModel
                    {
                        Id    = Guid.Parse(user.Id),
                        SIN   = model.SIN,
                        Name  = model.Name,
                        Email = user.Email
                    };

                    _organizerAppService.Register(organizer);

                    if (!ValidOperation())
                    {
                        await _userManager.DeleteAsync(user);

                        return(View(model));
                    }

                    _logger.LogInformation("User created a new account with password.");

                    var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);

                    var callbackUrl = Url.EmailConfirmationLink(user.Id, code, Request.Scheme);
                    await _emailSender.SendEmailConfirmationAsync(model.Email, callbackUrl);

                    await _signInManager.SignInAsync(user, isPersistent : false);

                    _logger.LogInformation("User created a new account with password.");
                    return(RedirectToLocal(returnUrl));
                }
                AddErrors(result);
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 9
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new OrganizerViewModel();
 }
Exemplo n.º 10
0
        public OrganizerPage()
        {
            InitializeComponent();

            BindingContext = new OrganizerViewModel(Navigation);
        }
Exemplo n.º 11
0
        public void Register(OrganizerViewModel organizerViewModel)
        {
            var registerCommand = _mapper.Map <OrganizerRegistrationCommand>(organizerViewModel);

            _bus.SendCommand(registerCommand);
        }