Ejemplo n.º 1
0
        private async void SaveConsultation(object consultationObject)
        {
            Consultation consultation = consultationObject as Consultation;

            if (consultation != null)
            {
                IsBusy = true;
                // редактирование
                if (consultation.Id > 0)
                {
                    Consultation updatedConsultation = await consultationsService.Update(consultation);

                    // заменяем объект в списке на новый
                    if (updatedConsultation != null)
                    {
                        int pos = Consultations.IndexOf(updatedConsultation);
                        Consultations.RemoveAt(pos);
                        Consultations.Insert(pos, updatedConsultation);
                    }
                }
                // добавление
                else
                {
                    Consultation addedConsultation = await consultationsService.Add(consultation);

                    if (addedConsultation != null)
                    {
                        Consultations.Add(addedConsultation);
                    }
                }
                IsBusy = false;
            }
            Back();
        }
Ejemplo n.º 2
0
        public ActionResult AddConsultation(Consultations newconsultation)
        {
            consultation.Addconsultation(newconsultation);
            string message = "SUCCESS";

            return(Json(new { Message = message, JsonRequestBehavior.AllowGet }));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Register a patient and schedule a consulation
        /// </summary>
        /// <param name="patient"></param>
        /// <returns></returns>
        public static HttpStatusCode RegisterPatient(Patient patient)
        {
            if (Patients == null)
            {
                Patients = new List <Patient>();
            }

            Patients.Add(patient);

            if (Consultations == null)
            {
                Consultations = new List <Consultation>();
            }

            var scheduler    = new ConsultationScheduler();
            var consultation = scheduler.ScheduleConsultation(patient);

            if (consultation == null)
            {
                return(HttpStatusCode.BadRequest);
            }

            Consultations.Add(consultation);

            return(HttpStatusCode.Created);
        }
Ejemplo n.º 4
0
 protected bool Equals(Load load)
 {
     return(Id == load.Id && Lectures.Equals(load.Lectures) && Laboratory.Equals(load.Laboratory) &&
            Practical.Equals(load.Practical) && Test.Equals(load.Test) &&
            Consultations.Equals(load.Consultations) && Exams.Equals(load.Exams) &&
            Nir.Equals(load.Nir) && CourseDesigning.Equals(load.CourseDesigning) &&
            Vkr.Equals(load.Vkr) && Gek.Equals(load.Gek) && Gak.Equals(load.Gak) &&
            Rma.Equals(load.Rma) && Rmp.Equals(load.Rmp));
 }
Ejemplo n.º 5
0
        public void Save()
        {
            jsonZipFile.Data = new MedicXData
            {
                Medics                    = Medics.Translate(),
                Clinics                   = Clinics.Translate(),
                Consultations             = Consultations.Translate(),
                Investigations            = Investigations.Translate(),
                InvestigationDescriptions = null
            };

            jsonZipFile.Save();
        }
Ejemplo n.º 6
0
        private async void DeleteConsultation(object consultationObject)
        {
            Consultation consultation = consultationObject as Consultation;

            if (consultation != null)
            {
                IsBusy = true;
                Consultation deletedConsultation = await consultationsService.Delete(consultation.Id);

                if (deletedConsultation != null)
                {
                    Consultations.Remove(deletedConsultation);
                }
                IsBusy = false;
            }
            Back();
        }
Ejemplo n.º 7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ Lectures.GetHashCode();
         hashCode = (hashCode * 397) ^ Laboratory.GetHashCode();
         hashCode = (hashCode * 397) ^ Practical.GetHashCode();
         hashCode = (hashCode * 397) ^ Test.GetHashCode();
         hashCode = (hashCode * 397) ^ Consultations.GetHashCode();
         hashCode = (hashCode * 397) ^ Exams.GetHashCode();
         hashCode = (hashCode * 397) ^ Nir.GetHashCode();
         hashCode = (hashCode * 397) ^ CourseDesigning.GetHashCode();
         hashCode = (hashCode * 397) ^ Vkr.GetHashCode();
         hashCode = (hashCode * 397) ^ Gek.GetHashCode();
         hashCode = (hashCode * 397) ^ Gak.GetHashCode();
         hashCode = (hashCode * 397) ^ Rma.GetHashCode();
         hashCode = (hashCode * 397) ^ Rmp.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 8
0
        public async Task GetConsultations()
        {
            if (initialized == true)
            {
                return;
            }
            IsBusy = true;
            IEnumerable <Consultation> consultations = await consultationsService.Get();

            // очищаем список
            //Consultations.Clear();
            while (Consultations.Any())
            {
                Consultations.RemoveAt(Consultations.Count - 1);
            }

            // добавляем загруженные данные
            foreach (Consultation c in consultations)
            {
                Consultations.Add(c);
            }
            IsBusy      = false;
            initialized = true;
        }
Ejemplo n.º 9
0
 public JsonResult UpdateFC(int id, Consultations updateconsult)
 {
     consultation.Updateconsultations(id, updateconsult);
     return(Json(JsonRequestBehavior.AllowGet));
 }
Ejemplo n.º 10
0
        public JsonResult GetFC(int id)
        {
            Consultations consutget = consultation.GetConsultation(id);

            return(Json(new { data = consutget }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Метод выполняющий фильтрацию коллекций по параметрам.
        /// </summary>
        /// <param name="lecturer">Имя преподавателя.</param>
        /// <param name="subject">Название предмета.</param>
        /// <param name="group">Номер группы.</param>
        /// <returns></returns>
        public List <Consultation> FilterRecords(string lecturer, string subject, string group)
        {
            List <Consultation> selectedCons = new List <Consultation>();

            if (lecturer == "All" && subject == "All" && group == "All")
            {
                selectedCons = Consultations.ToList();
            }

            if (lecturer != "All" && subject != "All" && group != "All")
            {
                selectedCons = Consultations.Where(c => (c.Lecturer == lecturer))
                               .Where(c => (c.Subject == subject))
                               .Where(c => (c.Group == group)).ToList();
            }

            if (lecturer == "All" || subject == "All" || group == "All")
            {
                if (lecturer == "All")
                {
                    if (subject == "All" && group != "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Group == group)).ToList();
                    }
                    else if (subject != "All" && group == "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Subject == subject)).ToList();
                    }
                    else if (subject != "All" && group != "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Subject == subject))
                                       .Where(c => (c.Group == group)).ToList();
                    }
                }
                if (subject == "All")
                {
                    if (lecturer == "All" && group != "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Group == group)).ToList();
                    }
                    else if (lecturer == "All" && group != "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Lecturer == lecturer)).ToList();
                    }
                    else if (lecturer != "All" && group != "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Lecturer == lecturer))
                                       .Where(c => (c.Group == group)).ToList();
                    }
                }
                if (group == "All")
                {
                    if (lecturer == "All" && subject != "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Subject == subject)).ToList();
                    }
                    else if (lecturer != "All" && subject == "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Lecturer == lecturer)).ToList();
                    }
                    else if (lecturer != "All" && subject != "All")
                    {
                        selectedCons = Consultations.Where(c => (c.Lecturer == lecturer))
                                       .Where(c => (c.Subject == subject)).ToList();
                    }
                }
                if (subject == "All" && group == "All" && lecturer != "All")
                {
                    selectedCons = Consultations.Where(c => (c.Lecturer == lecturer)).ToList();
                }
            }

            return(selectedCons);
        }