public ActionResult <List <AppointmentStatus> > AppointmentStatus(bool?isActive = true)
        {
            List <AppointmentStatus> Result = new List <AppointmentStatus>();
            var predicate = PredicateBuilder.New <SY_GENERAL_STATUS>(true);

            predicate = predicate.And(E => E.ENTITY_TYPE_CODE == "AP");
            if (isActive.HasValue)
            {
                if (isActive.Value)
                {
                    predicate = predicate.And(E => (E.DT_START == null || E.DT_START <= DateTime.Today) && ((E.DT_END == null) || E.DT_END >= DateTime.Today));
                }
                else
                {
                    predicate = predicate.And(E => !((E.DT_START == null || E.DT_START <= DateTime.Today) && ((E.DT_END == null) || E.DT_END >= DateTime.Today)));
                }
            }

            foreach (SY_GENERAL_STATUS item in DBContext.SY_GENERAL_STATUS.Where(predicate))
            {
                AppointmentStatus model = EntityMapper.Map <AppointmentStatus, SY_GENERAL_STATUS>(DBContext, item);
                Result.Add(model);
            }

            return(Result);
        }
Beispiel #2
0
        Appointment IAppointmentService.Save(AppointmentViewModel model)
        {
            List <AppointmentStatus> statues = new List <AppointmentStatus>();
            AppointmentStatus        status  = new AppointmentStatus
            {
                Id           = Guid.NewGuid(),
                Comments     = model.Comments,
                AssignedToId = model.AssignedToId,
                DueDate      = model.DueDate,
                Created      = DateTime.Now,
                Modified     = DateTime.Now,
                StatusId     = model.StatusId,
                UpdatedById  = model.UpdatedById,
                UpdatedDate  = DateTime.Now,
                Order        = 0
            };

            statues.Add(status);
            Appointment appointment = new Appointment
            {
                Id = Guid.NewGuid(),
                AppointmentDate     = model.AppointmentDate,
                LeadId              = model.LeadId,
                Lead                = null,
                Created             = DateTime.Now,
                AppointmentStatuses = statues,
            };

            Repository.Add(appointment);
            UnitOfWork.SaveChanges();
            return(Find(appointment.Id));
        }
Beispiel #3
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null && value.GetType().IsEnum)
            {
                AppointmentStatus appStatus = (AppointmentStatus)value;
                if (appStatus == AppointmentStatus.scheduled)
                {
                    return("Zakazan");
                }
                else if (appStatus == AppointmentStatus.missed)
                {
                    return("Propušten");
                }
                else if (appStatus == AppointmentStatus.finished)
                {
                    return("Završen");
                }
                else
                {
                    return("Otkazan");
                }
            }

            return(null);
        }
Beispiel #4
0
 public UpdateAppointmentCommand(long appointmentId, AppointmentViewModel viewModel)
 {
     DonorId    = viewModel.DonorId;
     LocationId = viewModel.LocationId;
     StartDate  = viewModel.StartDate;
     Status     = viewModel.Status;
 }
        public async Task <IActionResult> Edit(int id, [Bind("StatusId,Name,CreatedDateTime,LastModifiedDateTime")] AppointmentStatus appointmentStatus)
        {
            if (id != appointmentStatus.StatusId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(appointmentStatus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppointmentStatusExists(appointmentStatus.StatusId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(appointmentStatus));
        }
 public AppointmentDTO(Guid appointmentId, AppointmentStatus status, DateTime visitDate, ServiceOrderDTO serviceOrder)
 {
     AppointmentId = appointmentId;
     Status        = status;
     VisitDate     = visitDate;
     ServiceOrder  = serviceOrder;
 }
        private void CreateCustomStatus()
        {
            AppointmentStatus newCustomStatus = schedulerControl1.Storage.Appointments.Statuses.CreateNewStatus(40, "Alert", "Alert");

            newCustomStatus.Brush = new HatchBrush(HatchStyle.DottedDiamond, Color.Red, Color.Yellow);
            schedulerControl1.Storage.Appointments.Statuses.Add(newCustomStatus);
        }
Beispiel #8
0
        static void CustomLabelsAndStatusesAction(SchedulerControl scheduler)
        {
            #region #CustomLabelsAndStatuses
            scheduler.Storage.Appointments.Clear();

            string[] IssueList            = { "Consultation", "Treatment", "X-Ray" };
            Color[]  IssueColorList       = { Color.Ivory, Color.Pink, Color.Plum };
            string[] PaymentStatuses      = { "Paid", "Unpaid" };
            Color[]  PaymentColorStatuses = { Color.Green, Color.Red };


            IAppointmentLabelStorage labelStorage = scheduler.Storage.Appointments.Labels;
            labelStorage.Clear();
            int count = IssueList.Length;
            for (int i = 0; i < count; i++)
            {
                IAppointmentLabel label = labelStorage.CreateNewLabel(i, IssueList[i]);
                label.SetColor(IssueColorList[i]);
                labelStorage.Add(label);
            }
            AppointmentStatusCollection statusColl = scheduler.Storage.Appointments.Statuses;
            statusColl.Clear();
            count = PaymentStatuses.Length;
            for (int i = 0; i < count; i++)
            {
                AppointmentStatus status = statusColl.CreateNewStatus(i, PaymentStatuses[i], PaymentStatuses[i]);
                status.SetBrush(new SolidBrush(PaymentColorStatuses[i]));
                statusColl.Add(status);
            }
            #endregion #CustomLabelsAndStatuses
        }
 public CreateAppointmentCommand(AppointmentViewModel viewModel)
 {
     DonorId    = viewModel.DonorId;
     LocationId = viewModel.LocationId;
     StartDate  = viewModel.StartDate;
     Status     = AppointmentStatus.None;
 }
Beispiel #10
0
        public void Book(Slot slot)
        {
            if (slot == null)
            {
                throw new ArgumentNullException(Properties.Resource.Invalid_Slot_Message);
            }

            using (TransactionScope scope = new TransactionScope())
            {
                if (!slot.Book(_ubrn))
                {
                    throw new BookingFailedException(Properties.Resource.Appointment_Book_Failed_Message_2);
                }

                _status        = AppointmentStatus.Booked;
                _slot          = slot;
                _startDateTime = slot.StartDateTime;
                _endDateTime   = slot.EndDateTime;

                this.Save();

                scope.Complete();

                #region Uncomment this Code if Custom Performance Counters are required

                //PerformanceCounter perfCounter = new PerformanceCounter("EAppointments Counters", "Book Appointment", false);
                //perfCounter.Increment();

                #endregion
            }
        }
 public Appointment(int iD, string patientID, DateTime date, AppointmentStatus status)
 {
     ID        = iD;
     PatientID = patientID;
     Date      = date;
     Status    = status;
 }
        //android.permission.WRITE_CALENDAR


        public void AddAppointment(DateTime startTime, DateTime endTime, String subject, String location, String details, Boolean isAllDay, AppointmentReminder reminder, AppointmentStatus status)
        {
            ContentValues eventValues = new ContentValues();

            eventValues.Put(CalendarContract.Events.InterfaceConsts.CalendarId, 1);
            //_calId);
            eventValues.Put(CalendarContract.Events.InterfaceConsts.Title, subject);
            eventValues.Put(CalendarContract.Events.InterfaceConsts.Description, details);
            eventValues.Put(CalendarContract.Events.InterfaceConsts.Dtstart, startTime.ToUniversalTime().ToString());
            // GetDateTimeMS(2011, 12, 15, 10, 0));
            eventValues.Put(CalendarContract.Events.InterfaceConsts.Dtend, endTime.ToUniversalTime().ToString());
            // GetDateTimeMS(2011, 12, 15, 11, 0));
            eventValues.Put(CalendarContract.Events.InterfaceConsts.EventTimezone, "UTC");
            eventValues.Put(CalendarContract.Events.InterfaceConsts.EventEndTimezone, "UTC");
            eventValues.Put(CalendarContract.Events.InterfaceConsts.Availability, ConvertAppointmentStatus(status));
            eventValues.Put(CalendarContract.Events.InterfaceConsts.EventLocation, location);
            eventValues.Put(CalendarContract.Events.InterfaceConsts.AllDay, (isAllDay) ? "1" : "0");
            eventValues.Put(CalendarContract.Events.InterfaceConsts.HasAlarm, "1");

            var eventUri = CalendarConnector.Activity.ContentResolver.Insert(CalendarContract.Events.ContentUri, eventValues);
            long eventID = long.Parse(eventUri.LastPathSegment);
            ContentValues remindervalues = new ContentValues();
            remindervalues.Put(CalendarContract.Reminders.InterfaceConsts.Minutes, ConvertReminder(reminder));
            remindervalues.Put(CalendarContract.Reminders.InterfaceConsts.EventId, eventID);
            remindervalues.Put(CalendarContract.Reminders.InterfaceConsts.Method, (int)RemindersMethod.Alert);
            var reminderURI = CalendarConnector.Activity.ContentResolver.Insert(CalendarContract.Reminders.ContentUri, remindervalues);

        }
        public async void EndAppointmentShouldChangeTheStatusToProcessed(AppointmentStatus status)
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString());
            var appointmentsRepository  = new EfDeletableEntityRepository <Appointment>(new ApplicationDbContext(options.Options));
            var notificationsRepository = new EfDeletableEntityRepository <Notification>(new ApplicationDbContext(options.Options));

            var appointmentsService = new AppointmentsService(notificationsRepository, appointmentsRepository);

            var appointment = new Appointment
            {
                Status    = status,
                Date      = DateTime.UtcNow,
                StartTime = DateTime.UtcNow,
                EndTime   = DateTime.UtcNow.AddMinutes(5),
                Dogsitter = new Dogsitter
                {
                    WageRate = 10,
                },
                Owner = new Owner(),
            };

            await appointmentsService.CreateNewAppointment(appointment);

            await appointmentsService.EndAppointment(appointment.Id);

            Assert.Equal(AppointmentStatus.Processed.ToString(), appointmentsService.GetAppointment(appointment.Id).Status.ToString());
        }
        // POST: Appointments/ChangeStatus/5/Accepted
        public ActionResult ChangeStatus(int id, AppointmentStatus status)
        {
            string url = "AppointmentsData/GetAppointment/" + id;
            //sends http request and retrieves the response
            HttpResponseMessage response = client.GetAsync(url).Result;

            if (response.IsSuccessStatusCode)
            {
                Appointment appt = response.Content.ReadAsAsync <Appointment>().Result;
                appt.Status         = status;
                appt.DecisionMadeOn = DateTime.Now.ToString("yyyy/MM/dd hh:mm tt");
                //pass along authentication credential in http request
                GetApplicationCookie();

                //update the appointment
                url = "AppointmentsData/UpdateAppointment/" + id;

                HttpContent content = new StringContent(jss.Serialize(appt));
                content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                response = client.PostAsync(url, content).Result;
                if (response.IsSuccessStatusCode)
                {
                    return(RedirectToAction("Details", new { id = id }));
                }
                else
                {
                    return(RedirectToAction("Error"));
                }
            }
            else
            {
                // If we reach here something went wrong with our list algorithm
                return(RedirectToAction("Error"));
            }
        }
 public JsonResult ChangeAppointmentStatus(AppointmentStatus newStatus, int appointmentId)
 {
     var result = _appointmentViewRepository.ChangeStatus(appointmentId, newStatus);
     return Json(new
                 {
                     status = Enum.GetName(typeof (AppointmentStatus), result)
                 });
 }
Beispiel #16
0
 public Appointment(DateTime date, AppointmentStatus status, User customer, Address address, User siteManager)
 {
     Date        = date;
     Status      = status;
     Customer    = customer;
     Address     = address;
     SiteManager = siteManager;
 }
 public async Task <ICollection <Appointment> > GetAllByStatus(AppointmentStatus status)
 {
     await using var context = ContextFactory.CreateDbContext();
     return(await context.Appointments
            .Where(a => a.IsActive)
            .Where(a => a.Status == status)
            .ToListAsync());
 }
Beispiel #18
0
 public AppointmentUserEmail(int iD, string patientID, DateTime date, AppointmentStatus status, string email)
 {
     ID         = iD;
     PatientID  = patientID;
     Date       = date.ToString("yyyy-MM-ddTHH:mm:ssZ");
     Status     = status;
     this.email = email;
 }
Beispiel #19
0
        public ActionResult DeleteConfirmed(int id)
        {
            AppointmentStatus appointmentstatus = db.AppointmentStatus.Find(id);

            db.AppointmentStatus.Remove(appointmentstatus);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public void SetStatus(AppointmentStatus status)
 {
     ValidateNotCanceled();
     Status = status;
     if (Status == AppointmentStatus.CheckedIn)
     {
         ArrivalTime = DateTime.Now.TimeOfDay;
     }
 }
 void ChangeDefulatStatusesCaptions(SchedulerStorage someStorage)
 {
     for (int i = 0; i < someStorage.Appointments.Statuses.Count; i++)
     {
         AppointmentStatus currentStatus = someStorage.Appointments.Statuses[i];
         int ii = i + 1;
         currentStatus.DisplayName = "Couleur" + ii;
         currentStatus.MenuCaption = currentStatus.DisplayName;
     }
 }
Beispiel #22
0
 public ActionResult Edit(AppointmentStatus appointmentstatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(appointmentstatus).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(appointmentstatus));
 }
 public ActionResult Create(AppointmentStatus appointmentStatus)
 {
     if (ModelState.IsValid)
     {
         db.AppointmentStatus.Add(appointmentStatus);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Beispiel #24
0
        void UpdateAppointmentStatus()
        {
            AppointmentStatus currentStatus = edStatus.Status;
            AppointmentStatus newStatus     = controller.UpdateAppointmentStatus(currentStatus);

            if (newStatus != currentStatus)
            {
                edStatus.Status = newStatus;
            }
        }
        protected internal virtual void UpdateAppointmentStatus()
        {
            AppointmentStatus currentStatus = (AppointmentStatus)barEditShowTimeAs.EditValue;
            AppointmentStatus newStatus     = Controller.UpdateAppointmentStatus(currentStatus);

            if (newStatus != currentStatus)
            {
                barEditShowTimeAs.EditValue = newStatus;
            }
        }
Beispiel #26
0
        public async Task <IActionResult> SetTurnStatus(int turnId, AppointmentStatus newStatus)
        {
            if (string.IsNullOrEmpty(CurrentUserName))
            {
                return(Unauthorized());
            }

            await _turnsService.SetTurnStatusAsync(turnId, newStatus, CurrentUserName);

            return(Ok());
        }
Beispiel #27
0
        //
        // GET: /AppointmentStatus/Edit/5

        public ActionResult Edit(int id = 0)
        {
            AppointmentStatus appointmentstatus = db.AppointmentStatus.Find(id);

            if (appointmentstatus == null)
            {
                Session["FlashMessage"] = "Appointment Status not found.";
                return(RedirectToAction("Index"));
            }
            return(View(appointmentstatus));
        }
Beispiel #28
0
        public virtual async Task <int> GetAllAppointmentsCountByStatusAsync(AppointmentStatus status)
        {
            var query = _appointmentRepository.Table.Where(x => x.Status == status && x.Paymentstatus != PaymentStatus.NotPayed);

            if (status != AppointmentStatus.Canceled)
            {
                query = query.Where(x => !x.IsDeleted);
            }

            return(await query.CountAsync());
        }
        public async Task <IActionResult> Create([Bind("StatusId,Name,CreatedDateTime,LastModifiedDateTime")] AppointmentStatus appointmentStatus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appointmentStatus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(appointmentStatus));
        }
Beispiel #30
0
        public async Task <IActionResult> Index(AppointmentStatus status = AppointmentStatus.Unconfirmed)
        {
            var apps = await this.appointments.All(status);

            var model = new AppointmentsListingViewModel
            {
                Appointments      = apps,
                AppointmentStatus = status
            };

            return(View(model));
        }
Beispiel #31
0
 internal Appointment(Application parent, Patient patient, Referrer referrer, Provider provider, ClinicType clinicType)
 {
     _parent          = parent;
     _dbLib           = _parent.DbLib;
     _ubrn            = _parent.GetMaxUBRN();
     _patient         = patient;
     _referrer        = referrer;
     _provider        = provider;
     _clinicType      = clinicType;
     _createdDateTime = DateTime.Now;
     _status          = AppointmentStatus.Pending;
 }
 public async Task ChangeStatus(IOperation operation, int appointmentId, AppointmentStatus status)
 {
     await operation.ExecuteAsync(new
     {
         Id     = appointmentId,
         Status = status
     }, @"
         UPDATE [appointment].[Appointment]
         SET [StatusId] = @Status
         WHERE [Id] = @Id;
     ");
 }
 private string ConvertAppointmentStatus(AppointmentStatus status)
 {
     switch (status)
     {
         case AppointmentStatus.busy:
             return "Busy";
         case AppointmentStatus.free:
             return "Free";
         case AppointmentStatus.tentative:
             return "Tentative";
         case AppointmentStatus.outofoffice:
             return "Unavailable";
     }
     return "";
 }
        public void AddAppointment(DateTime startTime, DateTime endTime, String subject, String location, String details, Boolean isAllDay, AppointmentReminder reminder, AppointmentStatus status)
        {
            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

            saveAppointmentTask.StartTime = startTime;
            saveAppointmentTask.EndTime = endTime;
            saveAppointmentTask.Subject = subject;
            saveAppointmentTask.Location = location;
            saveAppointmentTask.Details = details;
            saveAppointmentTask.IsAllDayEvent = isAllDay;
            saveAppointmentTask.Reminder = ConvertReminder(reminder);
            saveAppointmentTask.AppointmentStatus = ConvertAppointmentStatus(status);

            saveAppointmentTask.Show();
        }
 private Microsoft.Phone.UserData.AppointmentStatus ConvertAppointmentStatus(AppointmentStatus status)
 {
     switch (status)
     {
         case AppointmentStatus.busy:
             return Microsoft.Phone.UserData.AppointmentStatus.Busy;
         case AppointmentStatus.free:
             return Microsoft.Phone.UserData.AppointmentStatus.Free;
         case AppointmentStatus.tentative:
             return Microsoft.Phone.UserData.AppointmentStatus.Tentative;
         case AppointmentStatus.outofoffice:
             return Microsoft.Phone.UserData.AppointmentStatus.OutOfOffice;
     }
     return Microsoft.Phone.UserData.AppointmentStatus.Busy;
 }
        public async void AddAppointment(DateTime startTime, DateTime endTime, String subject, String location, String details, Boolean isAllDay, AppointmentReminder reminder, AppointmentStatus status)
        {
            var granted = await RequestAccessAsync();

            if (granted)
            {
                EKEvent newEvent = EKEvent.FromStore(this.EventStore);
                newEvent.StartDate = (NSDate)DateTime.SpecifyKind(startTime, DateTimeKind.Utc);
                newEvent.EndDate = (NSDate)DateTime.SpecifyKind(endTime, DateTimeKind.Utc);
                newEvent.Title = subject;
                newEvent.Location = location;
                newEvent.Notes = details;
                newEvent.AllDay = isAllDay;
                newEvent.AddAlarm(ConvertReminder(reminder, startTime));
                newEvent.Availability = ConvertAppointmentStatus(status);

                NSError error;
                this.EventStore.SaveEvent(newEvent, EKSpan.ThisEvent, out error);

                Console.WriteLine("Event Saved, ID: " + newEvent.CalendarItemIdentifier);
            }
        }
 public JsonResult SaveStatus(AppointmentStatus newStatus, int id)
 {
     var status = _viewRepository.ChangeStatus(id, newStatus);
     return Json(new { newStatus = status }, JsonRequestBehavior.AllowGet);
 }
 private EKEventAvailability ConvertAppointmentStatus(AppointmentStatus status)
 {
     switch (status)
     {
         case AppointmentStatus.busy:
             return EKEventAvailability.Busy;
         case AppointmentStatus.free:
             return EKEventAvailability.Free;
         case AppointmentStatus.tentative:
             return EKEventAvailability.Tentative;
         case AppointmentStatus.outofoffice:
             return EKEventAvailability.Unavailable;
     }
     return EKEventAvailability.NotSupported;
 }