private void autoCompleteUC1_SelectedValueChanged(object sender, object e) { try { trn_abi_hdr abi = bsPatientABI.OfType <trn_abi_hdr>().FirstOrDefault(); if (abi != null) { if (e == null) { abi.tah_doctor_code = null; abi.tah_doctor_license = null; abi.tah_doctor_name_en = null; abi.tah_doctor_name_th = null; } else { abi.tah_doctor_code = ((DoctorProfile)e).SSUSR_Initials; abi.tah_doctor_license = ((DoctorProfile)e).CTPCP_SMCNo; DoctorName dn = obj.GetDoctorName(((DoctorProfile)e).CTPCP_Desc); abi.tah_doctor_name_en = dn.NameEN; abi.tah_doctor_name_th = dn.NameTH; } } } catch (Exception ex) { Program.MessageError(this.Name, "autoCompleteUC1_SelectedValueChanged", ex, false); } }
public void EndEdit() { DateTime dateNow = Program.GetServerDateTime(); string user_name = Program.CurrentUser == null ? null : Program.CurrentUser.mut_username; trn_abi_hdr patientAbi = bsPatientABI.OfType <trn_abi_hdr>().FirstOrDefault(); if (patientAbi.tah_create_by == null) { patientAbi.tah_create_by = user_name; patientAbi.tah_create_date = dateNow; } patientAbi.tah_update_by = user_name; patientAbi.tah_update_date = dateNow; patientAbi.tah_doc_result_thai = favoriteTextBox1.Text; patientAbi.tah_doc_result_eng = favoriteTextBox1.Text; }
private void LoadData(int tprID) { trn_abi_hdr obj = dbc.trn_abi_hdrs.Where(c => c.tpr_id == tprID).FirstOrDefault(); if (obj != null) { ABIbindingSource.DataSource = obj; if (TprID == 0) { ABIbindingSource.DataSource = (from t1 in dbc.trn_abi_hdrs select t1); ABIbindingSource.AddNew(); } else { ABIbindingSource.DataSource = obj; trn_abi_hdr trnabi = (trn_abi_hdr)ABIbindingSource.Current; Program.SetValueRadioGroup(pnlHearth, trnabi.tah_hearth_rhy_flag.ToString()); Program.SetValueRadioGroup(pnlBmi, trnabi.tah_the_bmi_flag.ToString()); Program.SetValueRadioGroup(pnlPressure, trnabi.tah_blood_pressure.ToString()); Program.SetValueRadioGroup(pnlRightCAVI, trnabi.tah_right_cavi_flag.ToString()); Program.SetValueRadioGroup(pnlLeftCAVI, trnabi.tah_left_cavi_flag.ToString()); Program.SetValueRadioGroup(pnlRightABI, trnabi.tah_right_abi_flag.ToString()); Program.SetValueRadioGroup(pnlLeftABI, trnabi.tah_left_abi_flag.ToString()); Program.SetValueRadioGroup(pnlCarotid, trnabi.tah_carotid_contour.ToString()); Program.SetValueRadioGroup(pnlFermoral, trnabi.tah_femoral_contour.ToString()); if (trnabi.tah_impress_normal == 'Y') { checkBox1.Checked = true; } if (trnabi.tah_impress_no_evidence == 'Y') { checkBox4.Checked = true; } if (trnabi.tah_impress_mild_periphera == 'Y') { checkBox8.Checked = true; } if (trnabi.tah_impress_mode_peripheral == 'Y') { checkBox3.Checked = true; } if (trnabi.tah_impress_serv_peripheal == 'Y') { checkBox7.Checked = true; } if (trnabi.tah_impress_non_compress == 'Y') { checkBox2.Checked = true; } if (trnabi.tah_impress_early_ather == 'Y') { checkBox6.Checked = true; } if (trnabi.tah_impress_others == 'Y') { checkBox5.Checked = true; } if (trnabi.mdr_id != null) { cmbSuggestion.SelectedValue = trnabi.mdr_id; } double thebmi = string.IsNullOrEmpty(txtTheBMI.Text) ? 0.0 : Convert.ToSingle(txtTheBMI.Text); if (thebmi < 18.50) { rdUnder.Checked = true; } else if (thebmi <= 18.50 && thebmi >= 24.99) { radioNormal.Checked = true; } else if (thebmi >= 25 && thebmi <= 29.99) { radioOverWeight.Checked = true; } else if (thebmi > 30) { radioObesity.Checked = true; } } } else { ABIbindingSource.DataSource = (from t1 in dbc.trn_abi_hdrs select t1); ABIbindingSource.AddNew(); } }