Beispiel #1
0
    public string oldPersonPicture;        //用于在无法获得人物图片路径时的旧的人物图片路径


    private void Awake()
    {
        _instance = this;

        LeftName    = GameObject.Find("LeftName").GetComponent <Text>();
        voiceSource = GetComponent <AudioSource>();
    }
        public IzdajRecept()
        {
            InitializeComponent();
            var app = Application.Current as App;

            medicationController         = app.medicationController;
            treatmentController          = app.treatmentController;
            examinationSurgeryController = app.examinationSurgeryController;

            List <String> usage = new List <String>();

            MyEvents.DemoEvents.PropagateCancellation.CustomEvent += cancelDemo;
            usage.Add("Svejedno");
            usage.Add("3");
            usage.Add("6");
            usage.Add("8");
            usage.Add("12");
            usage.Add("24");

            HourlyUsage.ItemsSource = usage;

            if (Menu.demoOn)
            {
                continuDemoAsync(cts.Token);
            }
        }
Beispiel #3
0
 public void SetUp()
 {
     _treatmentCtrl = new TreatmentController();
     _watch         = new Stopwatch();
     _treatment     = new Treatment_DTO(1, "Dameklip, lang hår", "Vi klipper langt hår på damer", 30, 499.95m, _categories);
     _categories    = new List <int>()
     {
         1
     };
 }
        private static void _insertTreatment()
        {
            TreatmentController treatmentCtrl = new TreatmentController();
            Treatment_DTO       treatment     = new Treatment_DTO(1, "Stor fed klip, lang hår", "Vi klipper langt hår på damer", 30, 499.95m, new List <int> {
                1
            });


            treatmentCtrl.Post(treatment);
        }
        public void DeleteTreatment()
        {
            // Arrange
            TreatmentController controller = new TreatmentController();

            var actResult = controller.Delete(1);
            // Act
            var result = actResult as OkNegotiatedContentResult <bool>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content == true);
        }
        public void getTreatment()
        {
            // Arrange
            TreatmentController controller = new TreatmentController();

            var actResult = controller.Get(1);
            // Act
            var result = actResult as OkNegotiatedContentResult <Treatment>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.ID == 1);
        }
        public void PostTreatment()
        {
            // Arrange
            TreatmentController controller = new TreatmentController();

            Treatment TreatmentObj = new Treatment
            {
                TreatmentName = "Third",
            };
            var actResult = controller.Post(TreatmentObj);
            // Act
            var result = actResult as OkNegotiatedContentResult <Treatment>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.ID > 0);
        }
        public void SetUp()
        {
            _reservationCtrl = new ReservationController();
            _treatmentCtrl   = new TreatmentController();
            _employeeCtrl    = new EmployeeController();
            _watch           = new Stopwatch();
            DbCleanUp.CleanDB();
            InsertTestData.InsertData();

            _categories = new List <int>()
            {
                1
            };

            Treatment_DTO treatment = new Treatment_DTO(1, "Voks af ryg", "Vi benytter enten almindelig varm voks eller sugaring", 60, 699.95m, _categories);

            _treatmentCtrl.Post(treatment);
        }
        public void PutTreatment()
        {
            // Arrange
            TreatmentController controller = new TreatmentController();

            Treatment TreatmentObj = new Treatment
            {
                TreatmentName = "Put request sucessfull",
                ID            = 2
            };
            var actResult = controller.Put(2, TreatmentObj);
            // Act
            var result = actResult as OkNegotiatedContentResult <Treatment>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.TreatmentName.Equals("Put request sucessfull"));
        }
        public HospitalTreatment()
        {
            MyEvents.DemoEvents.PropagateCancellation.CustomEvent += cancelDemo;
            InitializeComponent();

            var app = Application.Current as App;

            departmentController         = app.departmentController;
            examinationSurgeryController = app.examinationSurgeryController;
            treatmentController          = app.treatmentController;

            foreach (Department deparment in departmentController.GetAllDepartments())
            {
                Department.Items.Add(deparment.Name);
            }

            startDate = DateTime.Today.AddDays(-1);

            if (Menu.demoOn)
            {
                continueDemoAsync(cts.Token);
            }
        }
        private static void _insertReservation()
        {
            ReservationController reservationCtrl = new ReservationController();
            TreatmentController   treatmentCtrl   = new TreatmentController();

            IHttpActionResult treatmentResult = treatmentCtrl.Get(1);
            Treatment         treatment       = ((OkNegotiatedContentResult <Treatment>)treatmentResult).Content;
            Reservation_DTO   reservation1    = new Reservation_DTO(
                startTime: DateTime.Parse("31-12-2025 23:59"),
                employeeID: 1,
                customerID: 1,
                treatmentID: treatment.ID
                );

            Reservation_DTO reservation2 = new Reservation_DTO(
                startTime: DateTime.Parse("25-10-2026 17:30"),
                employeeID: 1,
                customerID: 1,
                treatmentID: treatment.ID
                );

            reservationCtrl.Post(reservation1);
            reservationCtrl.Post(reservation2);
        }
        public App()
        {
            var medicationRepository           = new MedicationRepository(new Stream <Medication>(MEDICATION_FILE));
            var diagnosisRepository            = new DiagnosisRepository(new Stream <Diagnosis>(DIAGNOSIS_FILE));
            var allergenRepository             = new AllergensRepository(new Stream <Allergens>(ALLERGEN_FILE));
            var categoryRepository             = new MedicationCategoryRepository(new Stream <MedicationCategory>(CATEGORY_FILE));
            var symptomsRepository             = new SymptomsRepository(new Stream <Symptoms>(SYMPTOMS_FILE));
            var ingredientsRepository          = new MedicationIngredientRepository(new Stream <MedicationIngredient>(INGREDIENTS_FILE));
            var specializationRepository       = new SpecializationRepository(new Stream <Specialization>(SPECIALIZATION_FILE));
            var cityRepository                 = new CityRepository(new Stream <City>(CITY_FILE));
            var addressRepository              = new AddressRepository(new Stream <Address>(ADDRESS_FILE), cityRepository);
            var stateRepository                = new StateRepository(new Stream <State>(STATE_FILE));
            var hospitalRepository             = new HospitalRepository(new Stream <Hospital>(HOSPITAL_FILE));
            var departmentRepository           = new DepartmentRepository(hospitalRepository, new Stream <Department>(DEPARTMENT_FILE));
            var roomRepository                 = new RoomRepository(departmentRepository, new Stream <Room>(ROOM_FILE));
            var userRepository                 = new UserRepository(new Stream <RegisteredUser>(USER_FILE), cityRepository, addressRepository, departmentRepository, roomRepository);
            var renovationRepository           = new RenovationRepository(roomRepository, new Stream <Renovation>(RENOVATION_FILE));
            var medicalRecordRepository        = new MedicalRecordRepository(new Stream <MedicalRecord>(RECORD_FILE), diagnosisRepository, medicationRepository, userRepository);
            var bedRepository                  = new BedRepository(roomRepository, medicalRecordRepository, new Stream <Bed>(BED_FILE));
            var equipmentTypeRepository        = new EquipmentTypeRepository(new Stream <EquipmentType>(EQUIPMENT_TYPE_FILE));
            var equipmentRepository            = new HospitalEquipmentRepository(new Stream <HospitalEquipment>(EQUIPMENT_FILE));
            var treatmentsRepository           = new TreatmentRepository(medicationRepository, departmentRepository, new Stream <Treatment>(TREATMENTS_FILE));
            var examinationSurgeryRepository   = new ExaminationSurgeryRepository(treatmentsRepository, medicalRecordRepository, userRepository, new Stream <ExaminationSurgery>(EXAMINATION_SURGERY_FILE));
            var emergencyRequestRepository     = new EmergencyRequestRepository(medicalRecordRepository, new Stream <EmergencyRequest>(EMERGENCY_REQUEST_FILE));
            var vaccinesRepository             = new VaccinesRepository(new Stream <Vaccines>(VACCINES_FILE));
            var notificationRepository         = new NotificationRepository(userRepository, new Stream <Notification>(NOTIFICATION_FILE));
            var articleRepository              = new ArticleRepository(userRepository, new Stream <Article>(ARTICLE_FILE));
            var questionRepository             = new QuestionRepository(userRepository, new Stream <Question>(QUESTIONS_FILE));
            var doctorReviewsRepository        = new DoctorReviewRepository(userRepository, new Stream <DoctorReview>(DOCTOR_REVIEWS_FILE));
            var feedbackRepository             = new FeedbackRepository(userRepository, new Stream <Feedback>(FEEDBACK_FILE));
            var surveyRepository               = new SurveyRepository(userRepository, new Stream <Survey>(SURVEY_FILE));
            var appointmentsRepository         = new AppointmentRepository(userRepository, medicalRecordRepository, roomRepository, new Stream <Appointment>(APPOINTMENTS_FILE));
            var workDayRepository              = new WorkDayRepository(userRepository, new Stream <WorkDay>(WORK_DAY_FILE));
            var vacationRequestRepository      = new VacationRequestRepository(userRepository, new Stream <VacationRequest>(VACATION_REQUEST_FILE));
            var reportsRepository              = new ReportRepository(new Stream <Report>(REPORTS_FILE));
            var labTestTypeRepository          = new LabTestTypeRepository(new Stream <LabTestType>(LAB_TEST_TYPE_FILE));
            var validationMedicationRepository = new ValidationMedicationRepository(new Stream <ValidationMed>(VALIDATION_FILE), userRepository, medicationRepository);

            var equipmentTypeService        = new EquipmentTypeService(equipmentTypeRepository);
            var medicationService           = new MedicationService(medicationRepository, validationMedicationRepository);
            var diagnosisService            = new DiagnosisService(diagnosisRepository);
            var allergenService             = new AllergensService(allergenRepository);
            var categoryService             = new MedicationCategoryService(categoryRepository);
            var symptomsService             = new SymptomsService(symptomsRepository);
            var ingredientsService          = new MedicationIngredientService(ingredientsRepository);
            var specializationService       = new SpecializationService(specializationRepository);
            var cityService                 = new CityService(cityRepository);
            var stateService                = new StateService(stateRepository);
            var addressService              = new AddressService(addressRepository);
            var notificationService         = new NotificationService(notificationRepository, userRepository, medicalRecordRepository);
            var validationMedicationService = new ValidationMedicationService(validationMedicationRepository, notificationService);
            var hospitalService             = new HospitalService(hospitalRepository);
            var departmentService           = new DepartmentService(departmentRepository);
            var bedService                = new BedService(bedRepository);
            var medicalRecordService      = new MedicalRecordService(medicalRecordRepository);
            var treatmentService          = new TreatmentService(treatmentsRepository, notificationService);
            var examiantionSurgeryService = new ExaminationSurgeryService(examinationSurgeryRepository);
            var emergencyRequestService   = new EmergencyRequestService(emergencyRequestRepository, notificationService);
            var vaccinesService           = new VaccinesService(vaccinesRepository);
            var articleService            = new ArticleService(articleRepository);
            var questionService           = new QuestionService(questionRepository, notificationService);
            var doctorsReviewService      = new DoctorReviewService(doctorReviewsRepository);
            var feedbackService           = new FeedbackService(feedbackRepository);
            var surveyService             = new SurveyService(surveyRepository);
            var userService               = new UserService(userRepository, medicalRecordService);
            var workDayService            = new WorkDayService(workDayRepository, MAX_HOURS_PER_WEEK);
            var appointmentService        = new AppointmentService(appointmentsRepository, workDayService, notificationService, VALID_HOURS_FOR_SCHEDULING, APPOINTMENT_LENGTH_IN_MINUTES,
                                                                   SURGERY_LENGTH_IN_MINUTES, START_WORKING_HOURS, END_WORKING_HOURS);
            var vacationRequestService      = new VacationRequestService(vacationRequestRepository, notificationService, NUMBER_OF_ALLOWED_VACAY_REQUESTS);
            var reportsService              = new ReportService(reportsRepository, treatmentsRepository, medicationRepository, examinationSurgeryRepository, roomRepository);
            var labTestTypeService          = new LabTestTypeService(labTestTypeRepository);
            var roomService                 = new RoomService(roomRepository, appointmentsRepository);
            var hospitalEquipmentService    = new HospitalEquipmentService(equipmentRepository);
            var renovationService           = new RenovationService(renovationRepository, roomService, appointmentsRepository, hospitalEquipmentService, notificationService, RENOVATION_DAYS_RESTRICTION, RENOVATION_DAYS_RESTRICTION);
            var availableAppointmentService = new AvailableAppointmentService(appointmentsRepository, workDayService, VALID_HOURS_FOR_SCHEDULING,
                                                                              APPOINTMENT_LENGTH_IN_MINUTES, SURGERY_LENGTH_IN_MINUTES, START_WORKING_HOURS, END_WORKING_HOURS);

            equipmentTypeController        = new EquipmentTypeController(equipmentTypeService);
            medicationController           = new MedicationController(medicationService);
            userController                 = new UserController(userService);
            diagnosisController            = new DiagnosisController(diagnosisService);
            symptomsController             = new SymptomsController(symptomsService);
            categoryController             = new MedicationCategoryController(categoryService);
            allergensController            = new AllergensController(allergenService);
            vaccinesController             = new VaccinesController(vaccinesService);
            labTestTypeController          = new LabTestTypeController(labTestTypeService);
            medicationIngredientController = new MedicationIngredientController(ingredientsService);
            cityController                 = new CityController(cityService);
            specializationController       = new SpecializationController(specializationService);
            addressController              = new AddressController(addressService);
            stateController                = new StateController(stateService);
            departmentController           = new DepartmentController(departmentService);
            hospitalController             = new HospitalController(hospitalService);
            roomController                 = new RoomController(roomService);
            renovationController           = new RenovationController(renovationService);
            hospitalEquipmentController    = new HospitalEquipmentController(hospitalEquipmentService);
            medicalRecordController        = new MedicalRecordController(medicalRecordService);
            treatmentController            = new TreatmentController(treatmentService);
            examinationSurgeryController   = new ExaminationSurgeryController(examiantionSurgeryService);
            articleController              = new ArticleController(articleService);
            questionController             = new QuestionController(questionService);
            doctorReviewController         = new DoctorReviewController(doctorsReviewService);
            surveyController               = new SurveyController(surveyService);
            feedbackController             = new FeedbackController(feedbackService);
            workDayController              = new WorkDayController(workDayService);
            reportController               = new ReportController(reportsService);
            validationMedicationController = new ValidationMedicationController(validationMedicationService);
            vacationRequestController      = new VacationRequestController(vacationRequestService);
            bedController = new BedController(bedService);
            emergencyRequestController     = new EmergencyRequestController(emergencyRequestService);
            appointmentController          = new AppointmentController(appointmentService);
            notificationController         = new NotificationController(notificationService);
            availableAppointmentController = new AvailableAppointmentController(availableAppointmentService);

            validations = new Validations(UNDERAGE_RESTRICTION);
        }
Beispiel #13
0
        public AddNewLabTesting()
        {
            var app = Application.Current as App;

            labTestTypeController        = app.labTestTypeController;
            ExaminationSurgeryController = app.examinationSurgeryController;
            treatmentController          = app.treatmentController;

            InitializeComponent();
            List <String> list1 = new List <String>();
            List <String> list2 = new List <String>();
            List <String> list3 = new List <String>();

            double   count = Math.Ceiling((double)(labTestTypeController.GetAllTestTypes().ToList().Count / 3));
            Encoding iso   = Encoding.GetEncoding("ISO-8859-1");
            Encoding utf8  = Encoding.UTF8;


            foreach (LabTestType type in labTestTypeController.GetAllTestTypes())
            {
                byte[] utfBytes = iso.GetBytes(type.TestName);
                byte[] isoBytes = Encoding.Convert(iso, utf8, utfBytes);
                string msg      = utf8.GetString(isoBytes);
                if (list1.Count <= count && list2.Count == 0 && list3.Count == 0)
                {
                    list1.Add(msg);
                }
                else if (list2.Count <= count && list1.Count >= 0 && list3.Count == 0)
                {
                    list2.Add(msg);
                }
                else if (list2.Count >= count && list1.Count >= 0)
                {
                    list3.Add(msg);
                }
            }
            foreach (string str in list1)
            {
                listTopics.Items.Add(new Show()
                {
                    Name = str, Tag = str
                });
                listTopics.SelectionChanged += selection1;
            }

            foreach (string str in list2)
            {
                listTopics2.Items.Add(new Show()
                {
                    Name = str, Tag = str
                });

                listTopics.SelectionChanged += selection2;
            }
            foreach (string str in list3)
            {
                listTopics3.Items.Add(new Show()
                {
                    Name = str, Tag = str
                });

                listTopics.SelectionChanged += selection3;
            }
        }