public async Task <IActionResult> Edit(int id, [Bind("AppointmentId,AppointmentDate,Notes,RealEndTime,AppointmentTime,WorkerId,PatientId,StatusId,CreatedDateTime,LastModifiedDateTime,TotalSum")] Appointment appointment)
        {
            if (id != appointment.AppointmentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(appointment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppointmentExists(appointment.AppointmentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PatientId"] = new SelectList(_context.Patients, "PatientId", "Address", appointment.PatientId);
            ViewData["StatusId"]  = new SelectList(_context.AppointmentStatuses, "StatusId", "Name", appointment.StatusId);
            ViewData["WorkerId"]  = new SelectList(_context.Workers, "WorkerId", "Address", appointment.WorkerId);
            return(View(appointment));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("DayId,Name,CreatedDateTime,LastModifiedDateTime")] Day day)
        {
            if (id != day.DayId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(day);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DayExists(day.DayId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(day));
        }
        public async Task <IActionResult> Edit(int id, [Bind("OfficeId,Address,CityId,CreatedDateTime,LastModifiedDateTime")] Office office)
        {
            if (id != office.OfficeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(office);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OfficeExists(office.OfficeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CityId"] = new SelectList(_context.Cities, "CityId", "Name", office.CityId);
            return(View(office));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ScheduleId,DayId,TimeSegmentId,CreatedDateTime,LastModifiedDateTime")] Schedule schedule)
        {
            if (id != schedule.ScheduleId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(schedule);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ScheduleExists(schedule.ScheduleId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DayId"]         = new SelectList(_context.Days, "DayId", "Name", schedule.DayId);
            ViewData["TimeSegmentId"] = new SelectList(_context.TimeSegments, "TimeSegmentId", "TimeSegmentId", schedule.TimeSegmentId);
            return(View(schedule));
        }
Beispiel #5
0
        public async Task <IActionResult> Edit(int id, [Bind("TimeSegmentId,TimeStart,TimeEnd,CreatedDateTime,LastModifiedDateTime")] TimeSegment timeSegment)
        {
            if (id != timeSegment.TimeSegmentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(timeSegment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TimeSegmentExists(timeSegment.TimeSegmentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(timeSegment));
        }
Beispiel #6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ServiceId,AppointmentId,Amount,CreatedDateTime,LastModifiedDateTime")] AppointmentService appointmentService)
        {
            if (id != appointmentService.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(appointmentService);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppointmentServiceExists(appointmentService.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AppointmentId"] = new SelectList(_context.Appointments, "AppointmentId", "Notes", appointmentService.AppointmentId);
            ViewData["ServiceId"]     = new SelectList(_context.Services, "ServiceId", "Description", appointmentService.ServiceId);
            return(View(appointmentService));
        }
Beispiel #7
0
        public async Task <IActionResult> Edit(int id, [Bind("AppointmentPaymentId,TransactionNumber,AppointmentId,Total,CreatedDateTime,LastModifiedDateTime")] AppointmentPayment appointmentPayment)
        {
            if (id != appointmentPayment.AppointmentPaymentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(appointmentPayment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppointmentPaymentExists(appointmentPayment.AppointmentPaymentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AppointmentId"] = new SelectList(_context.Appointments, "AppointmentId", "Notes", appointmentPayment.AppointmentId);
            return(View(appointmentPayment));
        }
Beispiel #8
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,WorkerId,ScheduleId,CreatedDateTime,LastModifiedDateTime")] WorkerSchedule workerSchedule)
        {
            if (id != workerSchedule.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(workerSchedule);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WorkerScheduleExists(workerSchedule.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ScheduleId"] = new SelectList(_context.Schedules, "ScheduleId", "ScheduleId", workerSchedule.ScheduleId);
            ViewData["WorkerId"]   = new SelectList(_context.Workers, "WorkerId", "Address", workerSchedule.WorkerId);
            return(View(workerSchedule));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ServiceId,Price,Name,Description,ServiceTypeId,CreatedDateTime,LastModifiedDateTime")] Service service)
        {
            if (id != service.ServiceId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(service);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ServiceExists(service.ServiceId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceTypeId"] = new SelectList(_context.ServiceTypes, "ServiceTypeId", "Name", service.ServiceTypeId);
            return(View(service));
        }
Beispiel #10
0
        public async Task <IActionResult> Edit(int id, [Bind("SalaryPaymentId,MonthNumber,Year,TransactionNumber,Amount,WorkerId,CreatedDateTime,LastModifiedDateTime")] SalaryPayment salaryPayment)
        {
            if (id != salaryPayment.SalaryPaymentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(salaryPayment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SalaryPaymentExists(salaryPayment.SalaryPaymentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["WorkerId"] = new SelectList(_context.Workers, "WorkerId", "Address", salaryPayment.WorkerId);
            return(View(salaryPayment));
        }
Beispiel #11
0
        public async Task <IActionResult> Edit(int id, [Bind("PatientId,FirstName,LastName,Address,DateOfBirth,PhoneNumber,CreatedDateTime,LastModifiedDateTime")] Patient patient)
        {
            if (id != patient.PatientId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(patient);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PatientExists(patient.PatientId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(patient));
        }
Beispiel #12
0
        public async Task <IActionResult> Edit(int id, [Bind("WorkerId,FirstName,LastName,PhoneNumber,Email,Password,Address,PositionId,OfficeId,CreatedDateTime,LastModifiedDateTime")] Worker worker)
        {
            if (id != worker.WorkerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(worker);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WorkerExists(worker.WorkerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OfficeId"]   = new SelectList(_context.Offices, "OfficeId", "Address", worker.OfficeId);
            ViewData["PositionId"] = new SelectList(_context.Positions, "PositionId", "PositionName", worker.PositionId);
            return(View(worker));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PositionId,AppointmentPercentage,BaseRate,PositionName,CreatedDateTime,LastModifiedDateTime")] Position position)
        {
            if (id != position.PositionId)
            {
                return(NotFound());
            }

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