Пример #1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            PackageAppointment = await _context.PackageAppointment.FindAsync(id);

            PackageAppointment.AppointmentDate        = null;
            PackageAppointment.AppointmentTime        = null;
            PackageAppointment.BeauticianID           = null;
            _context.Attach(PackageAppointment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
            }
            //Old code to delete
            //if (PackageAppointment != null)
            //{
            //    _context.PackageAppointment.Remove(PackageAppointment);
            //    await _context.SaveChangesAsync();
            //}

            return(Redirect("../Customers/Details?id=" + PackageAppointment.CustomerID));
        }
Пример #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(PackageTreatment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PackageTreatmentExists(PackageTreatment.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Пример #3
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(Customer).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CustomerExists(Customer.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Redirect("../Customers/Details?id=" + Customer.ID));
        }
Пример #4
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Beautician.Add(Beautician);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Пример #5
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.PackageAppointment.Add(PackageAppointment);
            await _context.SaveChangesAsync();

            return(Redirect("../Customers/Details?id=" + PackageAppointment.CustomerID));
        }
Пример #6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Beautician = await _context.Beautician.FindAsync(id);

            if (Beautician != null)
            {
                _context.Beautician.Remove(Beautician);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Пример #7
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Customer = await _context.Customer.FindAsync(id);

            if (Customer != null)
            {
                _context.Customer.Remove(Customer);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Пример #8
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Treatment = await _context.Treatment.FindAsync(id);

            if (Treatment != null)
            {
                _context.Treatment.Remove(Treatment);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Пример #9
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PackageTreatment = await _context.PackageTreatment.FindAsync(id);

            if (PackageTreatment != null)
            {
                _context.PackageTreatment.Remove(PackageTreatment);
                await _context.SaveChangesAsync();
            }

            return(Redirect("../Packages/Details?id=" + PackageTreatment.PackageID));
        }