Beispiel #1
0
        public VisitInfoViewForm(int idVisit)
        {
            InitializeComponent();
            Visit   visit   = DoctorFacade.GetVisitById(idVisit);
            Patient patient = DoctorFacade.GetPatientByVisit(idVisit);

            DataLayer.Doctor doctor = DoctorFacade.GetDoctorByVisit(idVisit);
            VisitViewPatientFirstNameTextBox.Text = patient.fname;
            VisitViewPatientLastNameTextBox.Text  = patient.lname;
            VisitViewPatientPeselTextBox.Text     = patient.PESEL;
            VisitViewDocorFirstNameTextBox.Text   = doctor.User.fname;
            VisitViewDoctorLastNameTextBox.Text   = doctor.User.lname;
            VisitViewVisitStateComboBox.Text      = visit.state;
            VisitViewRegisterDateTimePicker.Value = visit.registration_date;
            //tu wywala jak nie ma
            if (visit.execution_cancel_datetime == null)
            {
                VisitViewExecCancelDateTimePicker.CustomFormat = " ";
                VisitViewExecCancelDateTimePicker.Format       = DateTimePickerFormat.Custom;
            }
            else
            {
                VisitViewExecCancelDateTimePicker.CustomFormat = "dd/MM/yyyy hh:mm:ss";
                VisitViewExecCancelDateTimePicker.Value        = visit.execution_cancel_datetime.Value;
            }
            VisitViewDescriptionTextBox.Text = visit.description;
            VisitViewDiagnosisTextBox.Text   = visit.diagnosis;

            //to do :
            //w zaleznosci od stanu zmien VisitViewExecCancelDateLabel.Text w na "Execution date" lub na "Cancel date" albo (...)Label.Visible=false
        }
Beispiel #2
0
        private void registrarSelectDoctorButton_Click(object sender, EventArgs e)
        {
            DataLayer.Doctor d = new DataLayer.Doctor();
            SelectPersonForm registrarSelectDoctor = new SelectPersonForm(d);

            registrarSelectDoctor.setRegistrarAddButtonEnableDisable(false);
            registrarSelectDoctor.ShowDialog(this);
            this.idDoctor = -1;
            this.idDoctor = registrarSelectDoctor.getID();
            registrarTextBoxDoctor.Text = registrarSelectDoctor.getLname();
        }
Beispiel #3
0
        private void Initialize()
        {
            if (id_exam != 0)
            {
                Laboratory_examination labExam = CommonFacade.GetLabExam(id_exam);
                Patient patient = CommonFacade.GetPatientByVisit(labExam.id_visit);
                LabExaminationPatientFirstNameTextBox.Text = patient.fname;
                LabExaminationPatientLastNameTextBox.Text  = patient.lname;
                LabExaminationPatientPeselTextBox.Text     = patient.PESEL;
                LabExaminationExamTypeComboBox.Items.Add(CommonFacade.GetExamCodeName(labExam.code));
                LabExaminationExamTypeComboBox.SelectedIndex = 0;
                string state;
                switch (labExam.state)
                {
                case ("ORD"):
                    state = "Ordered";
                    break;

                case ("DONE"):
                    state = "Waiting for approval";
                    break;

                case ("APP"):
                    state = "Approved";
                    break;

                case ("CANC_LABW"):
                    state = "Canceled by laboratory worker";
                    break;

                case ("CANC_LABM"):
                    state = "Canceled by laboratory manager";
                    break;

                default:
                    state = "";
                    break;
                }
                LabExaminationExamStateComboBox.Items.Add(state);
                LabExaminationExamStateComboBox.SelectedIndex = 0;
                DataLayer.Doctor doctor = CommonFacade.GetDoctorByVisit(labExam.id_visit);
                LabExaminationDoctorFirstNameTextBox.Text   = doctor.User.fname;
                LabExaminationDoctorLastNameTextBox.Text    = doctor.User.lname;
                LabExaminationExamOrderDateTimePicker.Value = labExam.order_date;
                LabExaminationDoctorCommentsTextBox.Text    = labExam.doctor_comments;
                if (labExam.id_laboratory_woker != null)
                {
                    Laboratory_worker labw = CommonFacade.GetLabW(labExam.id_laboratory_woker.Value);
                    LabExaminationLabWorkerFirstNameTextBox.Text = labw.User.fname;
                    LabExaminationLabWorkerLastNameTextBox.Text  = labw.User.lname;
                }
                if (labExam.examination_execution_date == null)
                {
                    LabExaminationExamExaminationDateTimePicker.CustomFormat = " ";
                    LabExaminationExamExaminationDateTimePicker.Format       = DateTimePickerFormat.Custom;
                }
                else
                {
                    LabExaminationExamExaminationDateTimePicker.CustomFormat = "dd/MM/yyyy hh:mm:ss";
                    LabExaminationExamExaminationDateTimePicker.Value        = labExam.examination_execution_date.Value;
                }
                LabExaminationExamResultTextBox.Text = labExam.result;

                if (labExam.id_laboratory_manager != null)
                {
                    Laboratory_manager labm = CommonFacade.GetLabM(labExam.id_laboratory_manager.Value);
                    LabExaminationLabManagerFirstNameTextBox.Text = labm.User.fname;
                    LabExaminationLabManagerLastNameTextBox.Text  = labm.User.lname;
                }
                if (labExam.examination_approval_date == null)
                {
                    LabExaminationExamApprovalDateTimePicker.CustomFormat = " ";
                    LabExaminationExamApprovalDateTimePicker.Format       = DateTimePickerFormat.Custom;
                }
                else
                {
                    LabExaminationExamApprovalDateTimePicker.CustomFormat = "dd/MM/yyyy hh:mm:ss";
                    LabExaminationExamApprovalDateTimePicker.Value        = labExam.examination_approval_date.Value;
                }
                LabExaminationLabManagerCommentsTextBox.Text = labExam.lab_manager_comments;
            }
        }
Beispiel #4
0
 public SelectPersonForm(DataLayer.Doctor d)
 {
     InitializeComponent();
     doctor = true;
 }
Beispiel #5
0
        private void modifyData()
        {
            dataFromGrid.Clear();

            try
            {
                if (doctor == false)
                {
                    int     curRowIndex           = dataGridView1.CurrentCell.RowIndex;
                    string  tmpID                 = null;
                    Patient patientSearchCriteria = new Patient();
                    Address addressSearchCriteria = new Address();

                    if (dataGridView1.Rows[curRowIndex].Cells[0].Value == null)
                    {
                        throw new Exception();
                    }

                    tmpID = dataGridView1.Rows[curRowIndex].Cells[0].Value.ToString();
                    int id = Int32.Parse(tmpID);

                    patientSearchCriteria.id_patient = id;
                    addressSearchCriteria.id_patient = id;


                    Patient patient = RegistrationFacade.GetPatientByID(patientSearchCriteria);
                    Address address = RegistrationFacade.GetAdressByID(addressSearchCriteria);
                    if (patient == null)
                    {
                        throw new Exception();
                    }


                    dataFromGrid.Add(tmpID);
                    dataFromGrid.Add(patient.fname.ToString());
                    dataFromGrid.Add(patient.lname.ToString());
                    dataFromGrid.Add(patient.PESEL.ToString());

                    if (address != null)
                    {
                        dataFromGrid.Add(address.place.ToString());
                        dataFromGrid.Add(address.street.ToString());
                        dataFromGrid.Add(address.zip_code.ToString());
                        dataFromGrid.Add(address.house.ToString());
                        dataFromGrid.Add(address.flat.ToString());
                    }
                }
                else
                {
                    int              curRowIndex          = dataGridView1.CurrentCell.RowIndex;
                    string           tmpID                = null;
                    DataLayer.Doctor doctorSearchCriteria = new DataLayer.Doctor();


                    if (dataGridView1.Rows[curRowIndex].Cells[0].Value == null)
                    {
                        throw new Exception();
                    }

                    tmpID = dataGridView1.Rows[curRowIndex].Cells[0].Value.ToString();
                    int id = Int32.Parse(tmpID);



                    dataFromGrid.Add(tmpID);
                    dataFromGrid.Add(dataGridView1.Rows[curRowIndex].Cells[1].Value.ToString());
                    dataFromGrid.Add(dataGridView1.Rows[curRowIndex].Cells[2].Value.ToString());
                }
            }
            catch
            {
                //MessageBox.Show("No data !", "ERROR!");
                MessageBox.Show("No data !", "ERROR !", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.Close();
        }
 partial void DeleteDoctor(Doctor instance);
 partial void UpdateDoctor(Doctor instance);
 partial void InsertDoctor(Doctor instance);