Exemple #1
0
        /// <summary>
        ///  This action rejects the appointment which is made by the patient.
        /// </summary>
        /// <remarks>
        /// This controller action rejects the appointment of patient and make the status to rejected from pending.
        /// </remarks>
        /// <param name="id"></param>
        /// <returns>Rejects the appointment of a patient</returns>

        public ActionResult RejectAppointmentStatus(int id)
        {
            if (Session["userId"] == null)
            {
                return(Redirect("~"));
            }
            AppointmentEdit Approve = new AppointmentEdit();

            Approve.EditAppointment(id, (int)ClinicManagementSystemDOL.Enums.AppointmentStatus.Rejected);
            return(RedirectToAction("Appointments"));
        }
        public bool UpdateAppointment(AppointmentEdit model)
        {
            var entity = _dbContext.Appointments.Single(e => e.AppointmentId == model.AppoinmentId && e.Pet.PetOwnerId == _userId);

            entity.Pet               = model.Pet;
            entity.DateTime          = model.DateTime;
            entity.ServiceProviderId = model.ServiceProviderId;
            entity.ServiceType       = model.ServiceType;

            return(_dbContext.SaveChanges() == 1);
        }
        public void Put([FromBody] AppointmentEdit dto)
        {
            var oentity = context.Appointments.Find(dto.Id);

            oentity.Name    = dto.Name;
            oentity.Message = dto.Message;
            oentity.Email   = dto.Email;
            //oentity.DoctorId = dto.DoctorId;

            context.SaveChanges();
        }
Exemple #4
0
        public void EditAppointmentTest()
        {
            // Arrange
            AppointmentEdit editAppointment = new AppointmentEdit();

            // Act
            var result = editAppointment.EditAppointment(1002, 4);

            // Assert
            Assert.IsTrue(result);
        }
Exemple #5
0
        public async Task <int> Transaction(AppointmentEdit data, char action)
        {
            try
            {
                var val = await _adapterPattern.SingleTransaction <AppointmentEdit, int>(data, "usp_Appointment_Transaction", action, DataConfiguration.instanceCore);

                return(val);
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
                return(0);
            }
        }
        public ActionResult Edit(int id)
        {
            var service = CreateAppointmentService();
            var detail  = service.GetAppointmentById(id);
            var model   = new AppointmentEdit
            {
                AppointmentId  = detail.AppointmentId,
                ScheduledStart = detail.ScheduledStart,
                Length         = detail.Length,
                PatientId      = detail.PatientId,
                ProviderId     = detail.ProviderId
            };

            return(View(model));
        }
Exemple #7
0
        public bool UpdateAppointment(AppointmentEdit model)
        {
            using (var ctx = new ApplicationDbContext())
            {
                var entity = ctx.Appointments.Single(e => e.AppointmentId == model.AppointmentId);
                entity.ScheduledStart = model.ScheduledStart;
                entity.Length         = model.Length;
                entity.PatientId      = model.PatientId;
                entity.ProviderId     = model.ProviderId;
                entity.Modified       = DateTimeOffset.Now;
                entity.ModifiedBy     = _userId;

                return(ctx.SaveChanges() == 1);
            }
        }
        public ActionResult Edit(int id)
        {
            var service = CreateAppointmentService();
            var detail  = service.GetAppointmentByID(id);
            var model   =
                new AppointmentEdit
            {
                AppointmentID   = detail.AppointmentID,
                AppointmentDate = detail.AppointmentDate,
                AppointmentTime = detail.AppointmentTime,
                Address         = detail.Address,
                HairServiceID   = detail.HairServiceID
            };

            return(View(model));
        }
Exemple #9
0
        public bool UpdateAppointment(AppointmentEdit model)
        {
            using (var apt = new ApplicationDbContext())
            {
                var entity =
                    apt
                    .Appointments
                    .Single(e => e.AppointmentID == model.AppointmentID && e.UserID == _userID);

                entity.AppointmentDate = model.AppointmentDate;
                entity.AppointmentTime = model.AppointmentTime;
                entity.Address         = model.Address;
                entity.HairServiceID   = model.HairServiceID;

                return(apt.SaveChanges() == 1);
            }
        }
Exemple #10
0
        public ActionResult Edit(int id)
        {
            var service = CreateAppointmentService();
            var detail  = service.GetAppointmentById(id);
            var model   =
                new AppointmentEdit
            {
                AppointmentID     = detail.AppointmentID,
                AppointmentDate   = detail.AppointmentDate,
                StartTime         = detail.StartTime,
                EndTime           = detail.EndTime,
                TypeOfAppointment = detail.TypeOfAppointment,
                AppointmentReason = detail.AppointmentReason,
                ClientId          = detail.ClientId,
            };

            return(View(model));
        }
        public bool UpdateAppointment(AppointmentEdit model)
        {
            using (_context)
            {
                var entity =
                    _context
                    .Appointments
                    .Single(e => e.AppointmentID == model.AppointmentID);

                entity.AppointmentDate = model.AppointmentDate;
                entity.StartTime       = model.StartTime;
                entity.EndTime         = model.EndTime;
                entity.IsAvailable     = model.IsAvailable;
                entity.PersonID        = model.PersonID;

                return(_context.SaveChanges() == 1);
            }
        }
      public ActionResult Edit(int id)
      {
          var service = CreateAppointmentService();
          var detail  = service.GetAppointmentById(id);
          var model   =
              new AppointmentEdit
          {
              AppointmentID     = detail.AppointmentID,
              DateOfAppointment = detail.DateOfAppointment,
              CustomerFirstName = detail.CustomerFirstName,
              CustomerLastName  = detail.CustomerLastName,
              EmailAddress      = detail.EmailAddress,
              PhoneNumber       = detail.PhoneNumber,
              TypeOfAppointment = detail.TypeOfAppointment,
              Comment           = detail.Comment
          };

          return(View(model));
      }
        public bool UpdateAppointment(AppointmentEdit model)
        {
            using (var ctx = new ApplicationDbContext())
            {
                var entity =
                    ctx
                    .Appointments
                    .Single(e => e.AppointmentID == model.AppointmentID && e.OwnerID == _userId);

                entity.AppointmentID     = model.AppointmentID;
                entity.AppointmentDate   = model.AppointmentDate;
                entity.StartTime         = model.StartTime;
                entity.EndTime           = model.EndTime;
                entity.TypeOfAppointment = model.TypeOfAppointment;
                entity.AppointmentReason = model.AppointmentReason;
                entity.ClientId          = model.ClientId;

                return(ctx.SaveChanges() == 1);
            }
        }
        public ActionResult Edit(int id, AppointmentEdit model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            if (model.AppointmentId != id)
            {
                ModelState.AddModelError("", "Id Mismatch");
                return(View(model));
            }
            var service = CreateAppointmentService();

            if (service.UpdateAppointment(model))
            {
                TempData["SaveResult"] = "Your appointment was updated.";
                return(RedirectToAction("Index"));
            }
            ModelState.AddModelError("", "Your appointment could not be updated.");
            return(View(model));
        }
Exemple #15
0
        public bool UpdateAppointment(AppointmentEdit model)
        {
            using (var ctx = new ApplicationDbContext())
            {
                var entity =
                    ctx
                    .Appointments
                    .Single(e => e.AppointmentID == model.AppointmentID);

                entity.AppointmentID     = model.AppointmentID;
                entity.DateOfAppointment = model.DateOfAppointment;
                entity.CustomerFirstName = model.CustomerFirstName;
                entity.CustomerLastName  = model.CustomerLastName;
                entity.EmailAddress      = model.EmailAddress;
                entity.PhoneNumber       = model.PhoneNumber;
                entity.TypeOfAppointment = model.TypeOfAppointment;
                entity.Comment           = model.Comment;

                return(ctx.SaveChanges() == 1);
            }
        }
 public Task <int> Transaction(AppointmentEdit data, char action)
 {
     return(_appointment.Transaction(data, action));
 }