public IActionResult OnGet() { UserNew = new ApplicationUser(); Memberships = membershipData.GetMemberships().Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.Type }).ToList(); return(Page()); }
public async Task <IActionResult> OnGet() { Selected = string.Empty; Memberships = membershipData.GetMemberships(); Order = new Order(); Order.OrderTotal = Convert.ToDouble(HttpContext.Session.GetString("TotalPrice")); ApplicationUser = await userManager.GetUserAsync(User); return(Page()); }
public IActionResult OnGet(string EmployeeId) { if (EmployeeId == null) { Employee = new Employee(); } else { Employee = employeeRepository.GetEmployeeById(EmployeeId); } var list = membershipData.GetMemberships().ToList().Select(x => new { Id = x.Id, MembershipName = $"{x.MemberhipTypeName}" }); Memberships = new SelectList(list, "Id", "MembershipName"); return(Page()); }
public void OnGet() { NewProducts = productData.GetFirtsFiveNewProducts(); DiscountedProducts = productData.GetFirstFiveDiscountedProducts(); ProgressBarMetod = new ProgressBar(); Memberships = membershipData.GetMemberships(); }
public IActionResult List() { var model = new MembershipsListViewModel(); model.Memberships = membershipData.GetMemberships(); model.Customers = customerData.GetCustomers(); return(View(model)); }
public IActionResult OnGet(int? Id) { if (Id.HasValue) { Customer = customerData.GetCustomerById(Id.Value); if(Customer == null) { return RedirectToPage("./NotFound"); } } else { Customer = new Customer(); } var memberships = membershipData.GetMemberships().ToList().Select(p => new { Id = p.Id, Display = p.MembershipType }); Memberships = new SelectList(memberships, "Id", "Display"); return Page(); }
public IActionResult OnGet() { Memberships = membershipData.GetMemberships(Search); if (Memberships == null) { return(RedirectToPage("/NotFound")); } return(Page()); }
public IActionResult OnGet(int?id) { if (id.HasValue) { Customer = customerData.GetCustomerById(id.Value); if (Customer == null) { return(RedirectToPage("./NotFound")); } } else { Customer = new Core.Customer(); } var memberships = membershipData.GetMemberships().ToList().Select(p => new { Id = p.Id, Display = p.MembershipType }); Memberships = new SelectList(memberships, "Id", "Display"); Gender = htmlHelper.GetEnumSelectList <Gender>(); City = htmlHelper.GetEnumSelectList <City>(); return(Page()); }
public async Task <IActionResult> OnGet(string id) { if (id == null) { return(RedirectToPage("NotFound")); } if (User.Id != null) { User = await userManager.FindByIdAsync(id); } if (User == null) { return(RedirectToPage("/NotFound")); } var list = membershipData.GetMemberships().ToList().Select(x => new { Id = x.Id, MembershipName = $"{x.MemberhipTypeName}" }); Memberships = new SelectList(list, "Id", "MembershipName"); return(Page()); }
public IActionResult Edit(int?id) { var model = new CustomersEditViewModel(); if (id.HasValue) { model.Customer = customerData.GetCustomerById(id.Value); if (model.Customer == null) { return(View("NotFound")); } } else { model.Customer = new Customer(); } var memberships = membershipData.GetMemberships().ToList().Select(p => new { Id = p.Id, Display = p.MembershipType }); model.Memberships = new SelectList(memberships, "Id", "Display"); model.Gender = htmlHelper.GetEnumSelectList <Gender>(); model.City = htmlHelper.GetEnumSelectList <City>(); return(View(model)); }
public async Task <IActionResult> OnGet(string id) { UserEdit = await userManager.FindByIdAsync(id); if (UserEdit == null) { return(RedirectToPage("./ListUser")); } Memberships = membershipData.GetMemberships().Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.Type }).ToList(); return(Page()); }
public void OnGet() { Memberships = membershipData.GetMemberships(); Customers = customerData.GetCustomers(); }
public void OnGet() { Memberships = membershipData.GetMemberships(); }
public IActionResult GetAll() { return(Ok(membershipData.GetMemberships())); }
private bool MembershipExists(int id) { return(membershipData.GetMemberships().Any(e => e.Id == id)); }