public static void AddLabExam(Laboratory_examination lab) { DataClasses1DataContext dc = new DataClasses1DataContext(); dc.Laboratory_examinations.InsertOnSubmit(lab); dc.SubmitChanges(); }
private void LabExaminationLabWorkerCancelButton_Click(object sender, EventArgs e) { DateTime time = DateTime.Now; Laboratory_examination labEx = new Laboratory_examination(); labEx.id_laboratory_examination = id_exam; labEx.examination_execution_date = time; labEx.state = "CANC_LABW"; labEx.result = LabExaminationExamResultTextBox.Text; labEx.id_laboratory_woker = id_user; LaboratoryFacade.UpdateExamination(labEx); this.Close(); }
private void LabExaminationLabManagerApproveButton_Click(object sender, EventArgs e) { DateTime time = DateTime.Now; Laboratory_examination labEx = new Laboratory_examination(); labEx.id_laboratory_examination = id_exam; labEx.examination_approval_date = time; labEx.state = "APP"; labEx.lab_manager_comments = LabExaminationLabManagerCommentsTextBox.Text; labEx.id_laboratory_manager = id_user; LaboratoryFacade.UpdateExaminationM(labEx); this.Close(); }
private void LabExaminationLabWorkerSubmitButton_Click(object sender, EventArgs e) { DateTime time = DateTime.Now; Laboratory_examination labEx = new Laboratory_examination(); labEx.id_laboratory_examination = id_exam; labEx.examination_execution_date = time; labEx.state = "DONE"; labEx.result = LabExaminationExamResultTextBox.Text; labEx.id_laboratory_woker = id_user; LaboratoryFacade.UpdateExamination(labEx); this.Close(); //trzeba odswiezyc grid nizej }
public static void UpdateExamination(Laboratory_examination labEx) { DataClasses1DataContext dc = new DataClasses1DataContext(); var result = from ex in dc.Laboratory_examinations where ex.id_laboratory_examination == labEx.id_laboratory_examination select ex; var examination = result.FirstOrDefault(); examination.examination_execution_date = labEx.examination_execution_date; examination.state = labEx.state; examination.result = labEx.result; examination.id_laboratory_woker = labEx.id_laboratory_woker; dc.SubmitChanges(); }
public static void UpdateExaminationM(Laboratory_examination labEx) { DataClasses1DataContext dc = new DataClasses1DataContext(); var result = from ex in dc.Laboratory_examinations where ex.id_laboratory_examination == labEx.id_laboratory_examination select ex; var examination = result.FirstOrDefault(); examination.examination_approval_date = labEx.examination_approval_date; examination.state = labEx.state; examination.lab_manager_comments = labEx.lab_manager_comments; examination.id_laboratory_manager = labEx.id_laboratory_manager; dc.SubmitChanges(); }
private void doctorExaminationViewOrderButton_Click(object sender, EventArgs e) { DateTime time = DateTime.Now; if (doctorExaminationViewExamTypeComboBox.SelectedIndex != -1) { Laboratory_examination labExam = new Laboratory_examination(); labExam.doctor_comments = doctorExaminationViewCommentsResultTextBox.Text; labExam.state = "ORD"; labExam.id_visit = id_visit; labExam.order_date = time; labExam.code = doctorExaminationViewExamTypeComboBox.SelectedValue.ToString(); DoctorFacade.AddLabExam(labExam); this.Close(); } else { MessageBox.Show("No selected examination type", "Error"); } }
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; } }