public async Task <IActionResult> ManualConfirmEmail(AdvancedViewModel model) { if (!ModelState.IsValid) { StatusMessage = "Error: Please select the checkbox to confirm this danger action."; return(RedirectToAction(nameof(Advanced))); } var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } var token = await _userManager.GenerateEmailConfirmationTokenAsync(user); var result = await _userManager.ConfirmEmailAsync(user, token); if (!result.Succeeded) { AddErrors(result); return(View("Advanced", model)); } StatusMessage = "Email address confirmed."; return(RedirectToAction(nameof(Index))); }
private void FormClosed(object sender, FormClosedEventArgs e) { _formCount--; if (sender is MainForm && ((Form)sender).DialogResult == DialogResult.OK) { _formCount++; _advViewModel = new AdvancedViewModel(_mainViewModel.DocumentaryType?.elements, _mainViewModel.FileName); var advForm = new AdvancedForm(_advViewModel); advForm.FormClosed += FormClosed; advForm.Show(); } if (sender is AdvancedForm && ((Form)sender).DialogResult == DialogResult.OK) { _formCount++; _progressViewModel = new ProgressViewModel { CommunityId = _mainViewModel.UserGroup.id, FolderId = _mainViewModel.Folder.id, DocumentaryId = _mainViewModel.DocumentaryType.id, UploadList = _advViewModel.GetUploadList() }; var progressFrom = new ProgressForm(_progressViewModel); progressFrom.FormClosed += FormClosed; progressFrom.UploadFile(_mainViewModel.Token); progressFrom.Show(); } if (_formCount == 0) { _log.Info("Application exit"); ExitThread(); } }
public async Task <IActionResult> DeleteAccount(AdvancedViewModel model) { if (!ModelState.IsValid) { StatusMessage = "Error: Please select the checkbox to confirm this danger action."; return(RedirectToAction(nameof(Advanced))); } var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } var deleteUserResult = await _userManager.DeleteAsync(user); if (!deleteUserResult.Succeeded) { AddErrors(deleteUserResult); return(View("Advanced", model)); } await _signInManager.SignOutAsync(); return(RedirectToAction(nameof(Index))); }
public AdvancedForm(AdvancedViewModel viewModel) : this() { _viewModel = viewModel; InitializeControls(); }
public IActionResult Advanced() { var model = new AdvancedViewModel { StatusMessage = StatusMessage }; return(View(model)); }
public ActionResult ReportingHistory() { AdvancedViewModel vm = new AdvancedViewModel(); vm.empName = getEmployees(0); return(View(vm)); }
public ActionResult ReportingTest() { AdvancedViewModel vm = new AdvancedViewModel(); vm.DateFrom = new DateTime(2011, 01, 30); vm.DateTo = new DateTime(2011, 02, 06); return(View(vm)); }
public ActionResult Advanced(int pageId) { var model = new AdvancedViewModel { PostList = _postService.Read(UserHelper.UserId, string.Empty).ToList().Take(3).ToList() }; return(View("_AdvancedPartial", model)); }
public AddMangaViewModel(IProviderSet providerService, IDbContext dbContext) { NormalDataContext = new NormalViewModel(); NormalCommand = new ActionCommand(() => { if (TranIndex == 0) { return; } TranIndex = 0; NormalDataContext = new NormalViewModel(); }); AdvancedCommand = new ActionCommand(() => { if (TranIndex == 1) { return; } TranIndex = 1; AdvancedDataContext = new AdvancedViewModel(providerService, dbContext); }); }
public ActionResult ReportingTest(AdvancedViewModel vm) { using (HardwareDBEntities db = new HardwareDBEntities()) { db.Configuration.ProxyCreationEnabled = false; var list = db.lginvoices.Where(pp => pp.inv_DATETIME >= vm.DateFrom && pp.inv_DATETIME <= vm.DateTo).ToList().Select(xx => new ReportTest { inv_DATEIME = xx.inv_DATETIME.Value.ToString("yyyy-mm-dd"), invoiceTotal = Convert.ToDouble(xx.inv_total), custName = db.lgcustomers.Where(pp => pp.cust_code == xx.cust_code).Select(x => x.cust_fname + " " + x.cust_lname).FirstOrDefault(), EmployeeName = db.lgemployees.Where(pp => pp.emp_num == xx.employee_id).Select(x => x.emp_fname).FirstOrDefault() }); vm.pleaseWork = list.GroupBy(g => g.custName).ToList(); vm.chartData = list.GroupBy(g => g.EmployeeName).ToDictionary(g => g.Key, g => g.Sum(v => v.invoiceTotal)); TempData["chartData"] = vm.chartData; return(View(vm)); } }
public ActionResult ReportingHistory(AdvancedViewModel vm) { using (HardwareDBEntities db = new HardwareDBEntities()) { db.Configuration.ProxyCreationEnabled = false; vm.empName = getEmployees(vm.SelectedEmpID); vm.emps = db.lgemployees.Where(x => x.emp_num == vm.SelectedEmpID).FirstOrDefault(); var list = db.lginvoices.Where(pp => pp.employee_id == vm.emps.emp_num).ToList().Select(rr => new ReportRecord { empID = Convert.ToInt32(rr.employee_id), invNum = (rr.inv_num).ToString(), invTotal = Convert.ToDouble(rr.inv_total), custName = db.lgcustomers.Where(pp => pp.cust_code == rr.cust_code).Select(x => x.cust_fname + " " + x.cust_lname).FirstOrDefault() }); vm.results = list.GroupBy(g => g.empID.ToString()).ToList(); TempData["chartData"] = vm.chartData; return(View(vm)); } }
public AdvancedWindow(AdvancedViewModel viewModel) { DataContext = viewModel; InitializeComponent(); }
public ActionResult AdvancedView() { var model = new AdvancedViewModel(parkspace); return(View(model)); }
public ActionResult LevelThree(AdvancedViewModel model) { return(Content("Level 2 (Advanced) Audit Executed")); }
public void ShowAdvanced(AdvancedViewModel viewModel) => viewModel.Close(new AdvancedWindow(viewModel).ShowDialog() == true);