public UserAccountLogged() { _userController = (Application.Current as App).UserController; _doctorController = (Application.Current as App).DoctorController; _drugController = (Application.Current as App).DrugController; _notificationController = (Application.Current as App).NotificationController; InitializeComponent(); User user = _userController.GetLoggedUser(); nameTextBox.Text = user.Name; surnameTextBox.Text = user.Surname; emailTextBox.Text = user.Email; idLabel.Content = user.Id.ToString(); userTypeLabel.Content = user.GetType().Name; Doctor doctor = _doctorController.Get(user.Id); if (doctor != null) { notificationDataGrid.Visibility = Visibility.Visible; List <Notification> notifications = new List <Notification>(); foreach (var notificationId in doctor.Notification) { notifications.Add(_notificationController.Get(notificationId)); } notificationDataGrid.ItemsSource = notifications; } }
public DrugProfilePage(DrugView drug) { _drugController = (Application.Current as App).DrugController; InitializeComponent(); nameTextBox.Text = drug.Name; quantityTextBox.Text = drug.Count.ToString(); List <DrugView> alternativeDrugs = new List <DrugView>(); foreach (var altDrug in DrugPage.DrugList) { if (drug.alternativeDrug.Contains((int)altDrug.Id)) { alternativeDrugs.Add(altDrug); } } alternativeListBox.ItemsSource = alternativeDrugs; List <DoctorView> approvedDoctors = new List <DoctorView>(); foreach (var doctor in EmployeesPage.DoctorList) { if (drug.alternativeDrug.Contains((int)doctor.Id)) { approvedDoctors.Add(doctor); } } approvedListBox.ItemsSource = approvedDoctors; idLabel.Content = drug.Id; }
public DrugPage() { _drugController = (Application.Current as App).DrugController; InitializeComponent(); DrugList = new ObservableCollection <DrugView>(); DrugListUnapproved = new ObservableCollection <DrugView>(); List <Drug> drugs = new List <Drug>(); drugs = _drugController.GetAll(); for (int i = 0; i < drugs.Count; i++) { if (drugs[i].Approved) { DrugList.Add(new DrugView(drugs[i])); } else { DrugListUnapproved.Add(new DrugView(drugs[i])); } } dataGrid.ItemsSource = DrugList; dataGridAlternativeDrug.ItemsSource = DrugListUnapproved; }
public AddDrug() { _drugController = (Application.Current as App).DrugController; _doctorController = (Application.Current as App).DoctorController; InitializeComponent(); doctorDataGrid.ItemsSource = EmployeesPage.DoctorList; dataGrid.ItemsSource = DrugPage.DrugList; dataGridAlternativeDrug.ItemsSource = new ObservableCollection <DrugView>(); //idLabel.Content = id; }
public App() { var doctorRepository = new DoctorRepository(); var drugRepository = new DrugRepository(); var managerRepository = new ManagerRepository(); var medicalExamRepository = new MedicalExamRepository(); var medicalRecordRepository = new MedicalRecordRepository(); var medicalSupplyRepository = new MedicalSupplyRepository(); var notificationRepository = new NotificationRepository(); var patientRepository = new PatientRepository(); var reportRepository = new ReportRepository(); var resourceRepository = new ResourceRepository(); var roomRepository = new RoomRepository(); var secretaryRepository = new SecretaryRepository(); var textContentRepository = new TextContentRepository(); var renovationRepository = new RenovationRepository(); var guestUserRepository = new GuestUserRepository(); var notificationService = new NotificationService(notificationRepository); var doctorService = new DoctorService(doctorRepository, notificationService); var doctorReviewService = new DoctorReviewService(medicalExamRepository); var drugService = new DrugService(drugRepository, doctorService); var employeeService = new EmployeeService(managerRepository, doctorService, secretaryRepository); var guestUserService = new GuestUserService(guestUserRepository); var medicalExamService = new MedicalExamService(medicalExamRepository); var medicalSupplyService = new MedicalSupplyService(medicalSupplyRepository); var patientService = new PatientService(patientRepository); var reportService = new ReportService(reportRepository, managerRepository); var resourceService = new ResourceService(resourceRepository); var roomService = new RoomService(roomRepository, renovationRepository, medicalExamService, patientService, resourceService); var userService = new UserService(employeeService, patientService); var textContentService = new TextContentService(textContentRepository); TextContentController = new TextContentController(textContentService); NotificationController = new NotificationController(notificationService); DoctorController = new DoctorController(doctorService); DoctorReviewController = new DoctorReviewController(doctorReviewService); DrugController = new DrugController(drugService); EmployeeController = new EmployeeController(employeeService); GuestUserController = new GuestUserController(guestUserService); MedicalExamController = new MedicalExamController(medicalExamService); MedicalSupplyController = new MedicalSupplyController(medicalSupplyService); PatientController = new PatientController(patientService); ReportController = new ReportController(reportService); ResourceController = new ResourceController(resourceService); RoomController = new RoomController(roomService); UserController = new UserController(userService); }
static void Main(string[] args) { stopWatch.Start(); if (args.Length == 0) { logger.EscribirLog("Por favor indique los parametros a utilizar", Logger.Tipo.Error, false); logger.EscribirLog("", Logger.Tipo.Nada, false); logger.EscribirLog("-vf\t(Requerido)\tparametro que indica el archivo que necesitamos usar", Logger.Tipo.Error, false); logger.EscribirLog("-v\t(Opcional)\tparametro que indica si se desean mas datos", Logger.Tipo.Error, false); System.Environment.Exit(ERROR_INVALID_COMMAND_LINE); } if (chequeoArgunto("-log", false, args)) { logger.NombreLog = traerArgumento("-log", args); } logger.EscribirLog("Vamos a utilizrar el archivo " + logger.NombreLog + " como log.", Logger.Tipo.Informativo, false); if (chequeoArgunto("-vcf", false, args)) { vcfFile = traerArgumento("-vcf", args); logger.EscribirLog("Vamos a empezar a trabajar en el archivo " + vcfFile, Logger.Tipo.Informativo, false); } else { Console.WriteLine("Falta ingresar el -vcf"); logger.EscribirLog("Falta ingresar el parametro de vcf", Logger.Tipo.Error, false); System.Environment.Exit(ERROR_INVALID_COMMAND_LINE); } if (vcfFile != null) { if (!File.Exists(vcfFile)) { logger.EscribirLog("No exizte el archivo " + vcfFile, Logger.Tipo.Alerta, false); System.Environment.Exit(ERROR_FILE_NOT_FOUND); } } logger.Verbose = chequeoArgunto("-v", true, args); if (verbose) { logger.EscribirLog("Verbose activado se escribira mas detalle", Logger.Tipo.Informativo, false); } GenController genController = GenController.Instance; if (!genController.cargarArchivos()) { System.Environment.Exit(ERROR_FILE_NOT_FOUND); } VariantController variantController = VariantController.Instance; if (!variantController.cargarArchivo()) { System.Environment.Exit(ERROR_FILE_NOT_FOUND); } DrugController drugController = DrugController.Instance; if (!drugController.cargarArchivo()) { System.Environment.Exit(ERROR_FILE_NOT_FOUND); } ChemicalsController chemicalsController = ChemicalsController.Instance; if (!chemicalsController.cargarArchivo()) { System.Environment.Exit(ERROR_FILE_NOT_FOUND); } PhenotypesController phenotypesController = PhenotypesController.Instance; if (!phenotypesController.cargarArchivo()) { System.Environment.Exit(ERROR_FILE_NOT_FOUND); } GenotipoController genotipoController = GenotipoController.Instance; if (!genotipoController.cargarArchivo()) { System.Environment.Exit(ERROR_FILE_NOT_FOUND); } CAMetadaDataController cAMetadaDataController = CAMetadaDataController.Instance; if (!cAMetadaDataController.cargarArchivo()) { System.Environment.Exit(ERROR_FILE_NOT_FOUND); } IEnumerable <Gen> Guideline = LGenes.Where(s => s.HasCPICDosingGuideline == true); int cantidadHAV = Guideline.Count(); aTimer = new System.Timers.Timer(6000); // Hook up the Elapsed event for the timer. aTimer.Elapsed += OnTimedEvent; aTimer.AutoReset = true; aTimer.Enabled = true; logger.EscribirLog("Finalizamos el proceso", Logger.Tipo.Informativo, false); logger.EscribirLog("Demoramos " + stopWatch.Elapsed, Logger.Tipo.Informativo, true); stopWatch.Stop(); Console.Read(); }