Ejemplo n.º 1
0
 public IActionResult OnGet()
 {
     UserNew     = new ApplicationUser();
     Memberships = membershipData.GetMemberships().Select(x => new SelectListItem
     {
         Value = x.Id.ToString(),
         Text  = x.Type
     }).ToList();
     return(Page());
 }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
 public void OnGet()
 {
     NewProducts        = productData.GetFirtsFiveNewProducts();
     DiscountedProducts = productData.GetFirstFiveDiscountedProducts();
     ProgressBarMetod   = new ProgressBar();
     Memberships        = membershipData.GetMemberships();
 }
Ejemplo n.º 5
0
        public IActionResult List()
        {
            var model = new MembershipsListViewModel();

            model.Memberships = membershipData.GetMemberships();
            model.Customers   = customerData.GetCustomers();
            return(View(model));
        }
Ejemplo n.º 6
0
 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();
 }
Ejemplo n.º 7
0
 public IActionResult OnGet()
 {
     Memberships = membershipData.GetMemberships(Search);
     if (Memberships == null)
     {
         return(RedirectToPage("/NotFound"));
     }
     return(Page());
 }
Ejemplo n.º 8
0
        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());
        }
Ejemplo n.º 9
0
        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());
        }
Ejemplo n.º 10
0
        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));
        }
Ejemplo n.º 11
0
        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());
        }
Ejemplo n.º 12
0
 public void OnGet()
 {
     Memberships = membershipData.GetMemberships();
     Customers   = customerData.GetCustomers();
 }
Ejemplo n.º 13
0
 public void OnGet()
 {
     Memberships = membershipData.GetMemberships();
 }
 public IActionResult GetAll()
 {
     return(Ok(membershipData.GetMemberships()));
 }
Ejemplo n.º 15
0
 private bool MembershipExists(int id)
 {
     return(membershipData.GetMemberships().Any(e => e.Id == id));
 }