static void FillStorageCollection(AppointmentCollection c, string resourceName)
 {
     using (Stream stream = GetResourceStream(resourceName)) {
         c.ReadXml(stream);
         stream.Close();
     }
 }
        public ActionResult EditAppointment(int id, AppointmentCollection model)
        {
            try
            {
                var collection = new AppointmentCollection
                {
                    Appointment   = model.Appointment,
                    Psychologists = db.Psychologists.ToList()
                };

                if (model.Appointment.AppointmentDate <= DateTime.Now.Date)
                {
                    ViewBag.Messege = "Please Enter the Date greater than today or equal!!";
                    return(View(collection));
                }

                var appointment = db.Appointments.Single(c => c.Id == id);
                appointment.Schedule.PsychologistId = model.Appointment.Schedule.PsychologistId;
                appointment.AppointmentDate         = model.Appointment.AppointmentDate;
                appointment.Problem = model.Appointment.Problem;
                db.SaveChanges();
                string audiuserName = User.Identity.GetUserName();
                AuditExtension.AddAudit(audiuserName, "Updated Appointemnt(s)", "Appointments");
                return(RedirectToAction("ListOfAppointments"));
            }
            catch (Exception error)
            {
                Console.WriteLine(error.Message);
            }
            //if we get here something is wrong
            return(View());
        }
        public ActionResult AddAppointment(AppointmentCollection model)
        {
            var collection = new AppointmentCollection
            {
                Appointment   = model.Appointment,
                Patients      = db.Patients.ToList(),
                Psychologists = db.Psychologists.ToList(),
                Schedules     = db.Schedules.ToList()
            };
            var appointment = new Appointment();

            appointment.PatientId       = model.Appointment.PatientId;
            appointment.AppointmentDate = model.Appointment.AppointmentDate;

            appointment.Problem = model.Appointment.Problem;
            appointment.Status  = model.Appointment.Status;
            db.Appointments.Add(appointment);

            string audiuserName = User.Identity.GetUserName();

            AuditExtension.AddAudit(audiuserName, "Added Appointment", "Appointments");

            db.SaveChanges();

            if (model.Appointment.Status == true)
            {
                return(RedirectToAction("ListOfAppointments"));
            }
            else
            {
                return(RedirectToAction("PendingAppointments"));
            }
        }
Ejemplo n.º 4
0
        public ActionResult EditAppointment(int id, AppointmentCollection model)
        {
            var collection = new AppointmentCollection
            {
                Appointment   = model.Appointment,
                Psychologists = db.Psychologists.ToList()
            };

            if (model.Appointment.AppointmentDate <= DateTime.Now.Date)
            {
                ViewBag.Messege = "Please Enter the Date greater than today or equal!!";
                return(View(collection));
            }

            var appointment = db.Appointments.Single(c => c.Id == id);

            appointment.Schedule.PsychologistId = model.Appointment.Schedule.PsychologistId;
            appointment.AppointmentDate         = model.Appointment.AppointmentDate;
            appointment.Problem = model.Appointment.Problem;
            db.SaveChanges();
            string audiuserName = User.Identity.GetUserName();

            AuditExtension.AddAudit(audiuserName, "Updated Appointment Details", "Appointments");
            return(RedirectToAction("ListOfAppointments"));
        }
Ejemplo n.º 5
0
        public ActionResult EditAppointment(int id, AppointmentCollection model)
        {
            var collection = new AppointmentCollection
            {
                Appointment = model.Appointment,
                Patients    = db.Patients.ToList(),
                Doctors     = db.Doctors.ToList()
            };

            if (model.Appointment.AppointmentDate >= DateTime.Now.Date)
            {
                var appointment = db.Appointments.Single(c => c.Id == id);
                appointment.PatientId       = model.Appointment.PatientId;
                appointment.DoctorId        = model.Appointment.DoctorId;
                appointment.AppointmentDate = model.Appointment.AppointmentDate;
                appointment.Problem         = model.Appointment.Problem;
                appointment.Status          = model.Appointment.Status;
                db.SaveChanges();
                if (model.Appointment.Status == true)
                {
                    return(RedirectToAction("ListOfAppointments"));
                }
                else
                {
                    return(RedirectToAction("PendingAppointments"));
                }
            }
            ViewBag.Messege = "Please Enter the Date greater than today or equal!!";

            return(View(collection));
        }
        public ActionResult AddAppointment(AppointmentCollection model)
        {
            var collection = new AppointmentCollection
            {
                Appointment   = model.Appointment,
                Patients      = db.Patients.ToList(),
                Psychologists = db.Psychologists.ToList(),
                Schedules     = db.Schedules.ToList()
            };
            var appointment = new Appointment();

            appointment.PatientId       = model.Appointment.PatientId;
            appointment.AppointmentDate = model.Appointment.AppointmentDate;

            appointment.Problem = model.Appointment.Problem;
            appointment.Status  = model.Appointment.Status;
            db.Appointments.Add(appointment);
            db.SaveChanges();

            if (model.Appointment.Status == true)
            {
                return(RedirectToAction("ListOfAppointments"));
            }
            else
            {
                return(RedirectToAction("PendingAppointments"));
            }
        }
        public ActionResult AddAppointment(AppointmentCollection model)
        {
            string user       = User.Identity.GetUserId();
            var    collection = new AppointmentCollection
            {
                Appointment = model.Appointment,
                Patients    = db.Patients.ToList()
            };

            if (model.Appointment.AppointmentDate >= DateTime.Now.Date)
            {
                var doctor      = db.Doctors.Single(c => c.ApplicationUserId == user);
                var appointment = new Appointment();
                appointment.PatientId       = model.Appointment.PatientId;
                appointment.DoctorId        = doctor.Id;
                appointment.AppointmentDate = model.Appointment.AppointmentDate;
                appointment.Problem         = model.Appointment.Problem;
                appointment.Status          = model.Appointment.Status;

                db.Appointments.Add(appointment);
                db.SaveChanges();

                if (model.Appointment.Status == true)
                {
                    return(RedirectToAction("ActiveAppointments"));
                }
                else
                {
                    return(RedirectToAction("PendingAppointments"));
                }
            }
            ViewBag.Messege = "Please Enter the Date greater than today or equal!!";

            return(View(collection));
        }
Ejemplo n.º 8
0
        public ActionResult AddAppointment(AppointmentCollection model)
        {
            string user       = User.Identity.GetUserId();
            var    collection = new AppointmentCollection
            {
                Appointment = model.Appointment,
                Patients    = db.Patients.ToList()
            };



            var doctor      = db.Psychologists.Single(c => c.ApplicationUserId == user);
            var appointment = new Appointment();

            appointment.PatientId = model.Appointment.PatientId;
            appointment.Schedule.PsychologistId = doctor.Id;
            appointment.AppointmentDate         = model.Appointment.AppointmentDate;

            appointment.Problem = model.Appointment.Problem;
            appointment.Status  = model.Appointment.Status;

            db.Appointments.Add(appointment);
            db.SaveChanges();

            if (model.Appointment.Status == true)
            {
                return(RedirectToAction("ActiveAppointments"));
            }
            else
            {
                return(RedirectToAction("PendingAppointments"));
            }
        }
Ejemplo n.º 9
0
        public ActionResult AddAppointment(AppointmentCollection model)
        {
            var collection = new AppointmentCollection
            {
                Appointment   = model.Appointment,
                Psychologists = db.Psychologists.ToList()
            };

            if (model.Appointment.AppointmentDate <= DateTime.Now.Date)
            {
                ViewBag.Messege = "Please Enter the Date greater than today or equal!!";
                return(View(collection));
            }
            string user        = User.Identity.GetUserId();
            var    patient     = db.Patients.Single(c => c.ApplicationUserId == user);
            var    appointment = new Appointment();

            appointment.PatientId = patient.Id;
            appointment.Schedule.PsychologistId = model.Appointment.Schedule.PsychologistId;
            appointment.AppointmentDate         = model.Appointment.AppointmentDate;
            appointment.Problem = model.Appointment.Problem;
            appointment.Status  = false;
            db.Appointments.Add(appointment);
            db.SaveChanges();

            string audiuserName = User.Identity.GetUserName();

            AuditExtension.AddAudit(audiuserName, "Added Appointment", "Appointments");
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 10
0
        public ArrayList getAllNewAppointments()
        {
            ArrayList alListe = new ArrayList();

            if (Osession != null)
            {
                AppointmentCollection appointments = Osession.Appointments.Items;
                foreach (Appointment ap in appointments)
                {
                    //34-36 ok if "Locale" is properly set in device, preferably 24h
                    if (ap.Start > System.DateTime.Now)
                    {
                        alListe.Add(new Business.AppointmentVO(
                                        ap.ItemId.ToString(), ap.Subject,
                                        ap.Categories, ap.Start.ToString(), ap.Duration.ToString(),
                                        ap.Sensitivity.ToString()));
                    }
                }
                return(alListe);
            }
            else
            {
                throw new MobileException("oS does not exist");
            }
        }
Ejemplo n.º 11
0
        public async void SaveAsync()
        {
            IsBusy = true;

            for (int i = 0; i < AppointmentCollection.Count(); i++)
            {
                CheckOut checkout = await checkOutRepository.GetByAppointmentIdDateAsync(AppointmentCollection.ElementAt(i).Id, StartTime);

                if (checkout != null)
                {
                    checkout.Confirmed = AppointmentCollection.ElementAt(i).Confirmed;
                    await checkOutRepository.AddOrUpdateAsync(checkout, checkout.Id);
                }
                else
                {
                    checkout               = new CheckOut();
                    checkout.Confirmed     = true;
                    checkout.Date          = StartTime;
                    checkout.AppointmentId = AppointmentCollection.ElementAt(i).Id;
                    await checkOutRepository.AddAsync(checkout);
                }
            }
            IsBusy = false;


            GetAppointmentsAsync();
        }
Ejemplo n.º 12
0
        public static void GenerateSampleAppointments(SchedulerStorage storage)
        {
            AppointmentCollection appointments = storage.Appointments.Items;

            storage.BeginUpdate();
            try {
                for (int i = 0; i < ExampleUtils.Users.Length; i++)
                {
                    Appointment appointment = storage.CreateAppointment(AppointmentType.Normal);

                    appointment.Start       = baseTime.AddHours((i + 1) * 2);
                    appointment.Duration    = TimeSpan.FromHours(1);
                    appointment.Subject     = ExampleUtils.Users[i] + "'s Appointment";
                    appointment.Location    = "Office";
                    appointment.ResourceId  = i + 1;
                    appointment.HasReminder = true;
                    appointment.Reminder.TimeBeforeStart = TimeSpan.FromMinutes(10);

                    appointments.Add(appointment);
                }
            }
            finally {
                storage.EndUpdate();
            }
        }
 static void FillAppointmentsStorage(AppointmentCollection c, string fileName)
 {
     using (Stream stream = GetFileStream(fileName)) {
         c.ReadXml(stream);
         stream.Close();
     }
 }
        public void AppointmentOnViewChanged(Appointment appointment)
        {
            var app = AppointmentCollection.First(f => f.Id.ToString() == appointment.Id.ToString());

            appointment.ReminderInfo = app.ReminderInfo;
            appointment.Calendar     = app.Calendar;
            UpdateAppointment(appointment.Id, appointment);
        }
 public static void GenerateEventsWithSharedResource(AppointmentCollection eventList, int count, ResourceCollection collection, SchedulerStorage storage)
 {
     for (int i = 0; i < count; i++)
     {
         string subjPrefix = "Appt " + i;
         eventList.Add(AddSharedResources(subjPrefix, 1, 1, collection, storage));
     }
 }
        public void UpdateAppointment(object appointmentId, Appointment appointment)
        {
            var appointmentToUpdate = _appointments[appointmentId];

            AppointmentCollection.Remove(appointmentToUpdate);
            AppointmentCollection.Add(appointment);
            _appointments[appointmentId] = appointment;
            _calendarsCatalog.UpdateAppointment(appointment);
        }
        static void Run()
        {
            // ExStart:PagingSupportForListingAppointments
            using (IEWSClient client = EWSClient.GetEWSClient("exchange.domain.com", "username", "password"))
            {
                try
                {
                    Appointment[] appts = client.ListAppointments();
                    Console.WriteLine(appts.Length);
                    DateTime date      = DateTime.Now;
                    DateTime startTime = new DateTime(date.Year, date.Month, date.Day, date.Hour, 0, 0);
                    DateTime endTime   = startTime.AddHours(1);
                    int      appNumber = 10;
                    Dictionary <string, Appointment> appointmentsDict = new Dictionary <string, Appointment>();
                    for (int i = 0; i < appNumber; i++)
                    {
                        startTime = startTime.AddHours(1);
                        endTime   = endTime.AddHours(1);
                        string      timeZone    = "America/New_York";
                        Appointment appointment = new Appointment(
                            "Room 112",
                            startTime,
                            endTime,
                            "*****@*****.**",
                            "*****@*****.**");
                        appointment.SetTimeZone(timeZone);
                        appointment.Summary     = "NETWORKNET-35157_3 - " + Guid.NewGuid().ToString();
                        appointment.Description = "EMAILNET-35157 Move paging parameters to separate class";
                        string uid = client.CreateAppointment(appointment);
                        appointmentsDict.Add(uid, appointment);
                    }
                    AppointmentCollection totalAppointmentCol = client.ListAppointments();

                    ///// LISTING APPOINTMENTS WITH PAGING SUPPORT ///////
                    int itemsPerPage = 2;
                    List <AppointmentPageInfo> pages = new List <AppointmentPageInfo>();
                    AppointmentPageInfo        pagedAppointmentCol = client.ListAppointmentsByPage(itemsPerPage);
                    Console.WriteLine(pagedAppointmentCol.Items.Count);
                    pages.Add(pagedAppointmentCol);
                    while (!pagedAppointmentCol.LastPage)
                    {
                        pagedAppointmentCol = client.ListAppointmentsByPage(itemsPerPage, pagedAppointmentCol.PageOffset + 1);
                        pages.Add(pagedAppointmentCol);
                    }
                    int retrievedItems = 0;
                    foreach (AppointmentPageInfo folderCol in pages)
                    {
                        retrievedItems += folderCol.Items.Count;
                    }
                }
                finally
                {
                }
            }
            // ExEnd:PagingSupportForListingAppointments
        }
Ejemplo n.º 18
0
        public AppointmentForm(Patient obj) :
            base(obj, false)
        {
            this.mPatient = obj;
            this.mEntry   = new Appointment();
            this.mAppointmentCollection = new AppointmentCollection(this.mPatient.ObjectGuid);

            this.InitializeComponent();
            this.UserInitialize();
        }
        public ActionResult EditAppointment(int id)
        {
            var collection = new AppointmentCollection
            {
                Appointment = db.Appointments.Single(c => c.Id == id),
                Patients    = db.Patients.ToList()
            };

            return(View(collection));
        }
        public ActionResult AddAppointment()
        {
            var collection = new AppointmentCollection
            {
                Appointment = new Appointment(),
                Patients    = db.Patients.ToList()
            };

            return(View(collection));
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Adds CalendarView Appointments to our list
        /// </summary>
        private void AddAppointments()
        {
            // Get the current list of Appointments

            AppointmentCollection apc =
                _CalendarView.CalendarModel.Appointments;

            // Loop through each appointment

            bool itemsAdded = false;

            for (int i = 0; i < apc.Count; i++)
            {
                // Check to see if the given appointment
                // is a valid one for this Owner

                if (_CalendarView.SelectedOwner == "" ||
                    apc[i].OwnerKey.Equals(_CalendarView.SelectedOwner))
                {
                    ButtonItem bi = new ButtonItem();

                    // If we haven't already done so, add a heading

                    if (itemsAdded == false)
                    {
                        itemsAdded = true;

                        bi.Text       = "Appointments";
                        bi.ColorTable = eButtonColor.BlueOrb;
                        bi.Displayed  = true;

                        _Button.SubItems.Add(bi);

                        bi = new ButtonItem();
                    }

                    // Add the appointment to the list

                    string s = String.Format(
                        "{0}<div padding=\"8,0,0,0\"><font Color=\"darkred\" size=\"-2\">{1}</font></div>",
                        apc[i].Subject, apc[i].StartTime);

                    bi.Text       = s;
                    bi.BeginGroup = true;

                    bi.ColorTable = eButtonColor.Orange;
                    bi.Displayed  = true;
                    bi.Tag        = apc[i];

                    bi.Click += new EventHandler(App_Click);

                    _Button.SubItems.Add(bi);
                }
            }
        }
 public static void GenerateEvents(AppointmentCollection eventList, int count, ResourceCollection collection, SchedulerStorage storage)
 {
     for (int i = 0; i < count; i++)
     {
         Resource resource   = collection[i];
         string   subjPrefix = resource.Caption + "'s ";
         eventList.Add(CreateEvent(subjPrefix + "meeting", resource.Id, 2, 5, storage));
         eventList.Add(CreateEvent(subjPrefix + "travel", resource.Id, 3, 6, storage));
         eventList.Add(CreateEvent(subjPrefix + "phone call", resource.Id, 0, 10, storage));
     }
 }
Ejemplo n.º 23
0
        public ActionResult AddAppointment()
        {
            var collection = new AppointmentCollection
            {
                Appointment   = new Appointment(),
                Psychologists = db.Psychologists.ToList(),
                Schedules     = db.Schedules.Where(c => c.IsBooked == false).OrderBy(c => c.ScheduleDate).ToList()
            };

            return(View(collection));
        }
        public ActionResult AddAppointment()
        {
            var collection = new AppointmentCollection
            {
                Appointment   = new Appointment(),
                Patients      = db.Patients.ToList(),
                Psychologists = db.Psychologists.ToList(),
                Schedules     = db.Schedules.ToList()
            };

            return(View(collection));
        }
Ejemplo n.º 25
0
        private void MapearAsistentesVisita(bool formload)
        {
            var timer = System.Diagnostics.Stopwatch.StartNew();
            AppointmentCollection appointments = schedulerStorage1.Appointments.Items;
            Int64 IdVisita = 0;


            if (formload)
            {
                foreach (var appointment in appointments)
                {
                    IdVisita = Convert.ToInt64(appointment.CustomFields["IdVisita"].ToString());

                    if (IdVisita > 0)
                    {
                        clsVisita visita = new clsVisita(); // clsCalendarios.ObtenerVisitaPorId(IdVisita);

                        visita = ListaVisitas.Find(delegate(clsVisita var1) {
                            return(var1.Id == IdVisita);
                        });

                        if (visita == null)
                        {
                            break;
                        }
                        appointment.ResourceIds.Clear();
                        foreach (var asisCraft in visita.AsistentesCraft)
                        {
                            appointment.ResourceIds.Add(asisCraft.Usuario.Id);
                        }
                        appointment.ResourceIds.Add(visita.UsuarioOrganizador.Id);
                    }
                }
            }
            else
            {
                Appointment appointment = appointments[appointments.Count - 1];
                IdVisita = Convert.ToInt64(appointment.CustomFields["IdVisita"].ToString());
                if (IdVisita > 0)
                {
                    clsVisita visita = clsCalendarios.ObtenerVisitaPorId(IdVisita);

                    appointment.ResourceIds.Clear();
                    foreach (var asisCraft in visita.AsistentesCraft)
                    {
                        appointment.ResourceIds.Add(asisCraft.Usuario.Id);
                    }
                }
            }


            ClsLogPerformance.Save(new LogPerformance(Base.Usuario.UsuarioConectado.Usuario, timer.Elapsed.TotalSeconds));
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the CalendarModel class.
 /// </summary>
 public CalendarModel()
 {
     _Appointments = new AppointmentCollection(this);
     _Owners = new OwnerCollection(this);
     _WorkDays = new WorkDayCollection(this);
     _CalendarWorkDays = new CalendarWorkDayCollection(this);
     // Initialize default work-days
     _WorkDays.Add(new WorkDay(DayOfWeek.Monday));
     _WorkDays.Add(new WorkDay(DayOfWeek.Tuesday));
     _WorkDays.Add(new WorkDay(DayOfWeek.Wednesday));
     _WorkDays.Add(new WorkDay(DayOfWeek.Thursday));
     _WorkDays.Add(new WorkDay(DayOfWeek.Friday));
 }
Ejemplo n.º 27
0
        private void ClearAppointmentsByOwner(int row)
        {
            AppointmentCollection apps = calendarView1.CalendarModel.Appointments;
            string owner = calendarView1.DisplayedOwners[row];

            for (int i = apps.Count - 1; i >= 0; i--)
            {
                if (apps[i].OwnerKey == owner)
                {
                    apps.RemoveAt(i);
                }
            }
        }
 public void AddAppointment(Appointment appointment)
 {
     AppointmentCollection.Add(appointment);
     if (appointment.Id == null || _appointments.ContainsKey(appointment.Id))
     {
         appointment.Id = Guid.NewGuid();
     }
     if (appointment.Calendar == null)
     {
         appointment.Calendar = _calendarsCatalog.DefaultCalendar;
     }
     _appointments.Add(appointment.Id, appointment);
     _calendarsCatalog.InsertAppointment(appointment);
 }
        public ActionResult AddAppointment()
        {
            string user   = User.Identity.GetUserId();
            var    doctor = db.Psychologists.Single(c => c.ApplicationUserId == user);

            var collection = new AppointmentCollection
            {
                Appointment   = new Appointment(),
                Psychologists = db.Psychologists.ToList(),
                Schedules     = db.Schedules.Where(c => c.IsBooked == false && c.PsychologistId == doctor.Id).ToList()
            };

            return(View(collection));
        }
Ejemplo n.º 30
0
 public override void Dispose()
 {
     if (schedule != null)
     {
         schedule.Dispose();
         AppointmentCollection.Clear();
         AppointmentCollection = null;
         if (this.DataContext != null && this.DataContext is IDisposable)
         {
             (this.DataContext as IDisposable).Dispose();
         }
         this.DataContext = null;
     }
 }
Ejemplo n.º 31
0
 static void FillAppointmentsStorage(AppointmentCollection c)
 {
     DevExpress.XtraScheduler.Appointment wAppointment;
     using (DataClasses1DataContext dc = new DataClasses1DataContext())
     {
         foreach (Appointment a in dc.Appointments)
         {
             wAppointment          = new DevExpress.XtraScheduler.Appointment(a.Start.Value, a.End.Value);
             wAppointment.Subject  = a.Subject;
             wAppointment.StatusId = a.Status.Value;
             c.Add(wAppointment);
         }
     }
 }
Ejemplo n.º 32
0
         public amHealths()
            : base(null)
        {
            _practitioners = new PractitionerCollection(this);
            _patients = new PatientCollection(this);
            _appointments = new AppointmentCollection(this);
            _groups = new GroupCollection(this);
            _members = new MemberCollection(this);
            _queues = new QueueCollection(this);
            _messages = new MessageCollection(this);
            _familys = new FamilyCollection(this);
            _chronics = new ChronicCollection(this);
            _allergys = new AllergyCollection(this);


            _chronicMaps = new ChronicMapCollection(this);
            _allergyMaps = new AllergyMapCollection(this);


        }
Ejemplo n.º 33
0
 static void FillAppointmentsStorage(AppointmentCollection c)
 {
     DevExpress.XtraScheduler.Appointment wAppointment;
     using (DataClasses1DataContext dc = new DataClasses1DataContext())
     {
         foreach (Appointment a in dc.Appointments)
         {
             wAppointment = new DevExpress.XtraScheduler.Appointment (a.Start.Value,a.End.Value);
             wAppointment.Subject = a.Subject;
             wAppointment.StatusId = a.Status.Value;
             c.Add(wAppointment);
         }
  
     
     }
     
 }