Esempio n. 1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Date,KidId,Id")] Invoice invoice)
        {
            if (id != invoice.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(invoice);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InvoiceExists(invoice.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KidId"] = new SelectList(_context.Kid, "Id", "Id", invoice.KidId);
            return(View(invoice));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Name,Address,PhoneNumber,Id")] Pediatrician pediatrician)
        {
            if (id != pediatrician.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pediatrician);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PediatricianExists(pediatrician.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pediatrician));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Sequence,Document,GeneratedDate,DueDate,ProviderID,Amount,Id")] Purchase purchase)
        {
            if (id != purchase.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(purchase);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PurchaseExists(purchase.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProviderID"] = new SelectList(_context.Providers, "Id", "Id", purchase.ProviderID);
            return(View(purchase));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(Guid id, [Bind("StaringSequence,CurrentSequence,Prefix,DocumentType,Id")] Sequence sequence)
        {
            if (id != sequence.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sequence);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SequenceExists(sequence.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sequence));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Description,KindergarterId,Id")] ActivityTemplate activityTemplate)
        {
            if (id != activityTemplate.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(activityTemplate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ActivityTemplateExists(activityTemplate.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KindergarterId"] = new SelectList(_context.Kindergarters, "Id", "Id", activityTemplate.KindergarterId);
            return(View(activityTemplate));
        }
Esempio n. 6
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ActivityId,EnrollmentId,Id")] EnrollActivity enrollActivity)
        {
            if (id != enrollActivity.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(enrollActivity);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnrollActivityExists(enrollActivity.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActivityId"]   = new SelectList(_context.Activity, "Id", "Description", enrollActivity.ActivityId);
            ViewData["EnrollmentId"] = new SelectList(_context.Enrollments.Include(e => e.Kid), "Id", "Kid.FullName");
            return(View(enrollActivity));
        }
Esempio n. 7
0
        public async Task <IActionResult> Edit(Guid id, [Bind("EnrollDay,KidId,Comment,Id")] Enrollment enrollment)
        {
            if (id != enrollment.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(enrollment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnrollmentExists(enrollment.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KidId"] = new SelectList(_context.Kid, "Id", "FullName", enrollment.KidId);
            return(View(enrollment));
        }
Esempio n. 8
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Reference,Id")] Item item)
        {
            if (id != item.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(item);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ItemExists(item.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(item));
        }
Esempio n. 9
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Description,ActivityId,ServicePeriod,Reference,Price,Id")] Service service)
        {
            if (id != service.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(service);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ServiceExists(service.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActivityId"] = new SelectList(_context.Activity, "Id", "Description", service.ActivityId);
            return(View(service));
        }
Esempio n. 10
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Sequence,Document,GeneratedDate,Amount,AffectedDocument,Id")] Receipt receipt)
        {
            if (id != receipt.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(receipt);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReceiptExists(receipt.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(receipt));
        }
Esempio n. 11
0
        public async Task <IActionResult> Edit(Guid id, [Bind("FirstName,SecondName,FatherName,MotherName,Diseases,TShirtSize,SiblingCount,FavoriteActivities," +
                                                              "Address,Sex,Grade,KindergarterId,TutorPrincipalId,TutorSecundaryId,TutorAutorizedId,PediatricianId,BirthDate,Id")] Kid kid)
        {
            if (id != kid.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(kid);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KidExists(kid.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KindergarterId"] = new SelectList(_context.Kindergarters, "Id", "Description", kid.KindergarterId);
            return(View(kid));
        }
Esempio n. 12
0
        public async Task <IActionResult> Edit(Guid id, [Bind("FirstName,LastName,Mail,MovilNumber,PhoneNumber,WorkPlace,JobNumber,Address,Id")] Tutor tutor)
        {
            if (id != tutor.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tutor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TutorExists(tutor.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tutor));
        }
Esempio n. 13
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Description,Address,Mail,Instagram,Facebook,Phone,InvoiceMessage,Id")] Kindergarter kindergarter)
        {
            if (id != kindergarter.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(kindergarter);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KindergarterExists(kindergarter.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(kindergarter));
        }
Esempio n. 14
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Reference,Id,Description,Price")] Product product)
        {
            if (id != product.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductExists(product.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }