public VerificationView() { InitializeComponent(); DataContext = new VerificationViewModel(); #if SPEECHRECOGNITION if (App.IsSpeechAvailable) { SpeechActivator.Instance.OnRecognisedDatabase += (sender, args) => { switch (args.Command) { case "искать человека": UpdateRecognition(); break; case "сброс": UpdateRecognition(); break; case "фамилия": break; case "имя": break; case "отчество": break; } } } ; #endif }
public VerificationUserControl(VerificationViewModel VerificationViewModel) { InitializeComponent(); this.VerificationViewModel = VerificationViewModel; this.VerificationViewModel.MyGrid = VerificationGrid; DataContext = VerificationViewModel; }
public async Task <ApiResult <VerificationViewModel> > Register(RegisterRequest request) { if (await _userManager.FindByNameAsync(request.UserName) != null) { return(new ApiResultErrors <VerificationViewModel>("UserName is already")); } if (await _userManager.FindByEmailAsync(request.Email) != null) { return(new ApiResultErrors <VerificationViewModel>("Email is already")); } var roleDefault = await _roleManager.FindByNameAsync("client"); if (request.RoleId == new Guid("00000000-0000-0000-0000-000000000000")) { request.RoleId = roleDefault.Id; } var user = new UserApp() { Dob = request.Dob, Email = request.Email, PhoneNumber = request.Phone, Address = request.Address, UserName = request.UserName, FullName = request.FullName, RoleID = request.RoleId }; //Save Image if (request.ThumbnailImage != null) { user.ImagePath = await this.SaveFile(request.ThumbnailImage); } var result = await _userManager.CreateAsync(user, request.Passwork); if (result.Succeeded) { var token = await _userManager.GenerateEmailConfirmationTokenAsync(user); VerificationViewModel model = new VerificationViewModel { Token = token, UserId = user.Id, }; var cart = new Cart { Created_At = DateTime.Now, UserId = user.Id, Price = 0, CartProducts = new List <CartProduct>(), }; _context.Carts.Add(cart); await _context.SaveChangesAsync(); return(new ApiResultSuccess <VerificationViewModel>(model)); } return(new ApiResultErrors <VerificationViewModel>("Register failed")); }
public MainWindow(VerificationViewModel viewModel) : this() { LoadSettings(viewModel); ValidationGrid.DataContext = viewModel; CreateCobieGrid.DataContext = viewModel; ReportGrid.DataContext = viewModel; ComplianceGrid.DataContext = viewModel; }
public Verification() { InitializeComponent(); using (var scope = Dependencies.container.BeginLifetimeScope()) { RPVM = Dependencies.container.Resolve <VerificationViewModel>(); } // RPVM = new RegistrationDataPageViewModel(new NavigationService(),new LocationServices()) BindingContext = RPVM; }
private static void LoadSettings(VerificationViewModel vm) { if (File.Exists(Settings.Default.LastOpenedRequirement)) { vm.RequirementFileSource = Settings.Default.LastOpenedRequirement; } if (File.Exists(Settings.Default.LastOpenedSubmission)) { vm.SubmissionFileSource = Settings.Default.LastOpenedSubmission; } }
/// <summary> /// Constructor /// </summary> /// <param name="verificationViewModel"></param> /// <param name="serviceKey"></param> public VerificationModel(VerificationViewModel verificationViewModel, string serviceKey) { objVerificationViewModel = verificationViewModel; if (serviceKey.Equals("Resend")) { VerificationWebService(); } else { GetUserDetailsWebService(); } }
public ActionResult Index(VerificationViewModel viewModel) { if (!viewModel.Verify()) { return(View("Index", viewModel)); } else { ViewData["IPAddress"] = viewModel.IPAddress; return(RedirectToAction("Events", new { ipaddress = viewModel.IPAddress.ToString() })); } }
/// <summary> /// Constructor /// </summary> /// <param name="verificationViewModel"></param> /// <param name="serviceKey"></param> public VerificationModel(VerificationViewModel verificationViewModel, string serviceKey) { objVerificationViewModel = verificationViewModel; if (serviceKey.Equals("Resend")) { VerificationWebService(); } else { GetUserDetailsWebService(); } }
public async Task <IActionResult> ConfirmEmail(VerificationViewModel request) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _userService.ConfirmEmail(request); if (result.IsSuccessed == false) { return(BadRequest(result)); } return(Ok(result)); }
public async Task <ApiResult <string> > ConfirmEmail(VerificationViewModel request) { var json = JsonConvert.SerializeObject(request); var httpContent = new StringContent(json, Encoding.UTF8, "application/json"); var response = await _client.PostAsync($"/api/users/confirmEmail", httpContent); var result = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { return(JsonConvert.DeserializeObject <ApiResultSuccess <string> >(result)); } return(JsonConvert.DeserializeObject <ApiResultErrors <string> >(result)); }
public async Task <ApiResult <bool> > ConfirmEmail(VerificationViewModel request) { var user = await _userManager.FindByIdAsync(request.UserId.ToString()); if (user == null) { return(new ApiResultErrors <bool>($"Can not find user with id: {request.UserId}")); } var result = await _userManager.ConfirmEmailAsync(user, request.Token); if (result.Succeeded) { return(new ApiResultSuccess <bool>()); } return(new ApiResultErrors <bool>("Confirm email faild")); }
public async Task <IActionResult> PullNames() { var pairs = santaHat.PullNames(); var body = GetMessageBody(); var model = new VerificationViewModel(); foreach (var pair in pairs) { var message = new SantaMessage(pair.Key, pair.Value, body, "25", "2 Dec"); await mailer.SendEmailAsync(message); //TODO: Add email sending verification model.AddStatus(pair.Key, true); } return(View(model)); //return RedirectToAction("Index", "Home"); }
public async Task <IActionResult> ConfirmEmail(VerificationViewModel verificationViewModel) { var veritifiCode = HttpContext.Session.GetObjectFromJson <string>("verifycatioCode"); if (verificationViewModel.VerificationCode != veritifiCode) { ModelState.AddModelError(string.Empty, "Verificate code is invalid "); return(RedirectToAction("register", "login")); } if (verificationViewModel.UserId == null && verificationViewModel.Token == null) { return(RedirectToAction("register", "login")); } var result = await _userAPIClient.ConfirmEmail(verificationViewModel); if (result.IsSuccessed) { return(RedirectToAction("index", "login")); } ModelState.AddModelError(string.Empty, result.Message); return(View()); }
public VerifyCommand(VerificationViewModel verificationViewModel) { VerificationViewModel = verificationViewModel; }
public ConvertoCobieCommand(VerificationViewModel viewModel) { _vm = viewModel; }
public ActionResult Index() { VerificationViewModel viewModel = new VerificationViewModel(); return(View("Index", viewModel)); }
public FacilitySaveCommand(VerificationViewModel viewModel) { _vm = viewModel; }
public SelectOutputFileCommand(SourceFile linkedFile, VerificationViewModel model) { FileSelector = ContainerBootstrapper.Instance.Container.Resolve <ISaveFileSelector>(); _linkedFile = linkedFile; _vm = model; }
public SelectInputFileCommand(SourceFile linkedFile, VerificationViewModel viewModel) { _linkedFile = linkedFile; _vm = viewModel; }
public ValidateAndSaveCommand(VerificationViewModel validationViewModel) { _vm = validationViewModel; }
public SourceFile(VerificationViewModel viewmodel, params string[] properties) { _vm = viewmodel; _props = properties; }