Ejemplo n.º 1
0
 private void ExaminationSave()
 {
     examinationController = new ExaminationController();
     Entities.Examination examination = new Entities.Examination();
     examination.AppointmentId = appointmentID;
     if (radioAppointmentStatusTrue.Checked)
     {
         examination.IsValid = true;
     }
     else
     {
         examination.IsValid = false;
     }
     examination.DiagnosisId = ((Entities.Diagnosis)cmbDiagnosis.SelectedItem).DiagnosisId;
     if (radioButtonNeedTestTrue.Checked)
     {
         examination.IsNeedTest = true;
     }
     else
     {
         examination.IsNeedTest = false;
     }
     examinationController.Add(examination);
     examinationID = examination.ExaminationId;
 }
Ejemplo n.º 2
0
        private void Examination_Load(object sender, EventArgs e)
        {
            btnAddPrescription.Enabled = false;
            dtpAppointmentDate.MinDate = DateTime.Today;

            grpAddAppointment.Visible = false;
            doctorID = Homepage.userID;

            examinationController = new ExaminationController();
            var doctorList = examinationController.Examination(doctorID);

            cmbDiagnosis.DataSource    = doctorList;
            cmbDiagnosis.DisplayMember = "DiagnosisName";
            cmbDiagnosis.ValueMember   = "DiagnosisId";
            cmbDiagnosis.Text          = string.Empty;
            cmbDiagnosis.SelectedIndex = -1;

            hospitalController = new HospitalController();
            hospitals          = hospitalController.GetAll();

            cmbHospital.DataSource    = hospitals;
            cmbHospital.DisplayMember = "HospitalName";
            cmbHospital.ValueMember   = "HospitalId";

            cmbHospital.Text = string.Empty;

            cmbDoctor.SelectedIndex = -1;
            cmbPolyclinic.Items.Clear();
        }
Ejemplo n.º 3
0
        private void buttonObrisiZaposlenog_Click(object sender, RoutedEventArgs e)
        {
            if (SelektovaniZaposleni == null || string.IsNullOrWhiteSpace(SelektovaniZaposleni.Jmbg))
            {
                return;
            }
            foreach (Zaposleni z in TempZaposlenici)
            {
                if (z.Jmbg == SelektovaniZaposleni.Jmbg)
                {
                    DoctorController    doctorController    = new DoctorController();
                    SecretaryController secretaryController = new SecretaryController();
                    UserController      userController1     = new UserController(doctorController);
                    UserController      userController2     = new UserController(secretaryController);
                    if (!userController2.DeleteProfile(z.Jmbg))
                    {
                        userController1.DeleteProfile(z.Jmbg);
                        ExaminationController ec = new ExaminationController();
                        ec.DeleteDoctorExaminations(z.Jmbg);
                        WorkingTimeController wtc = new WorkingTimeController();
                        wtc.DeleteWorkingTime(z.Jmbg);
                    }

                    TempZaposlenici.Remove(z);
                    Zaposlenici.Remove(z);
                    SelektovaniZaposleni = null;

                    break;
                }
            }
        }
Ejemplo n.º 4
0
        private void RadioButtonNeedTestFalse_CheckedChanged(object sender, EventArgs e)
        {
            btnSave.Enabled            = true;
            grpAddAppointment.Visible  = false;
            btnAddPrescription.Enabled = false;
            grpAddAppointment.Visible  = false;
            examinationController      = new ExaminationController();
            var doctorList = examinationController.Examination(doctorID);

            cmbDiagnosis.DataSource    = doctorList;
            cmbDiagnosis.DisplayMember = "DiagnosisName";
            cmbDiagnosis.ValueMember   = "DiagnosisId";
            cmbDiagnosis.Text          = string.Empty;
            cmbDiagnosis.SelectedIndex = -1;
        }
        private void buttonObrisiSalu_Click(object sender, RoutedEventArgs e)
        {
            if (SelektovanaSoba == null || string.IsNullOrWhiteSpace(SelektovanaSoba.Sifra.ToString()))
            {
                return;
            }
            foreach (Soba soba in TempSobe)
            {
                if (soba.Sifra == SelektovanaSoba.Sifra)
                {
                    RoomController             roomController             = new RoomController();
                    RenovationPeriodController renovationPeriodController = new RenovationPeriodController();
                    renovationPeriodController.CancelRenovation(soba.Sifra);
                    roomController.DeleteRoom(soba.Sifra);
                    //EquipmentInRoomsController ec = new EquipmentInRoomsController();
                    //ec.deleteLeftEquipmentInRooms(soba.Sifra);
                    ExaminationController exc = new ExaminationController();
                    exc.DeleteRoomExaminations(soba.Sifra);
                    PlacementInSickRoomController pc = new PlacementInSickRoomController();
                    pc.DeleteRoomPlacements(soba.Sifra);
                    DoctorController dc    = new DoctorController();
                    UserController   uc    = new UserController(dc);
                    List <User>      lista = uc.ViewAllUsers();
                    foreach (Doctor d in lista)
                    {
                        Doctor n = (Doctor)d;
                        n.DoctorsOffice = new Room();
                        List <Room> rooms = roomController.ViewRooms();
                        n.DoctorsOffice = rooms.First();
                    }
                    SelektovanaSoba = null;
                    ClearFields();
                    UpdateTempSoba();

                    break;
                }
            }
        }
Ejemplo n.º 6
0
        private void ButtonSacuvajLekara_Click(object sender, RoutedEventArgs e)
        {
            Doctor doctor = new Doctor();

            doctor.Jmbg             = JmbgTb.Text as string;
            doctor.Name             = ImeTb.Text as string;
            doctor.DateOfBirth      = (DateTime)DatumRTb.SelectedDate;
            doctor.DateOfEmployment = (DateTime)DatumZTb.SelectedDate;
            doctor.Email            = EmailTb.Text as string;
            doctor.Phone            = TelTb.Text as string;
            doctor.HomeAddress      = AdresaTb.Text as string;
            doctor.Surname          = PrezimeTb.Text as string;
            doctor.Username         = KorisnikTb.Text as string;
            doctor.Password         = SifraTb.Text as string;
            doctor.NumberOfLicence  = LicencaTb.Text as string;
            doctor.Type             = (TypeOfDoctor)TipTb.SelectedItem;
            doctor.Gender           = (GenderType)PolCb.SelectedItem;
            int            soba           = Convert.ToInt32(SobaTb.Text);
            int            grad           = Convert.ToInt32(GradTb.Text);
            RoomController roomController = new RoomController();
            Room           room           = roomController.ViewRoomByNumber(soba);

            doctor.DoctorsOffice = room;

            CityController cityController = new CityController();
            City           city           = cityController.getCityByZipCode(grad);

            doctor.City = city;

            Doctor s = new Doctor();

            s = (Doctor)uc.ViewProfile(doctor.Jmbg);
            if (s == null)
            {
                uc.Register(doctor);
                Poruka.Text = "Uspesno ste sacuvali doktora!";
            }
            else
            {
                uc.EditProfile(doctor);
                ExaminationController ec = new ExaminationController();
                ec.DeleteDoctorExaminations(doctor.Jmbg);
                WorkingTimeController wtc  = new WorkingTimeController();
                WorkingTime           novo = new WorkingTime();
                novo = wtc.viewWorkingTimeDoctor(doctor.Jmbg);
                wtc.EditWorkingTime(novo);
                Poruka.Text = "Uspesno ste izmenili doktora!";
            }


            /* VALIDACIJA
             * // 1. Resetovati sve validacione poruke
             * ResetAllErrors();
             *
             * // 2. Izvrsiti validaciju
             * bool isValid = true;
             *
             * if (String.IsNullOrWhiteSpace(ImeTb.Text))
             * {
             *      ErrorImeTb.Text = "Morate uneti ime";
             *      ImeTb.BorderBrush = Brushes.Red;
             *      isValid = false;
             * }
             * //
             * // Ostatak validacije
             * //
             * Poruka.Text = "Uspesno ste sacuvali lekara!";
             *
             *
             * // 3. Reagovati na rezultat validacije
             * if (isValid)
             * {
             *      // Dodaj lekara
             *      // SuccessMessageTb.Text = "Uspesno ste dodali lekara.";
             *      // Resetovati sve textboxove, comboboxove, datepickere.
             *      // Za sve TB stavis .Text = ""
             *      // Za DatePicker.SelectedDate stavis DateTime.Now
             *      // Za CB stavis .SelectedItem = ListZaCB[0]
             * }*/
        }