private void load_aircrew_thai(ref trn_eye_aircrew_thai patient_aircrew_thai) { foreach (PropertyDescriptor prop in TypeDescriptor.GetProperties(patient_aircrew_thai)) { eye_thai_PropertyChanged(patient_aircrew_thai, new PropertyChangedEventArgs(prop.Name)); } patient_aircrew_thai.PropertyChanged += new PropertyChangedEventHandler(eye_thai_PropertyChanged); }
public void EndEdit() { DateTime dateNow = Program.GetServerDateTime(); string user_name = Program.CurrentUser == null ? null : Program.CurrentUser.mut_username; trn_eye_aircrew_thai eyes_thai = bsEyeAircrewThai.OfType <trn_eye_aircrew_thai>().FirstOrDefault(); if (eyes_thai.tea_create_by == null) { eyes_thai.tea_create_by = user_name; eyes_thai.tea_create_date = dateNow; } eyes_thai.tea_update_by = user_name; eyes_thai.tea_update_date = dateNow; }
private void LoadTransaction() { var objeye_exam = (from teh in dbc.trn_eye_exam_hdrs where teh.tpr_id == TprID select teh).FirstOrDefault(); if (objeye_exam != null) { //Tab 1 bindingSourcetrn_eye_exam_hdr.DataSource = objeye_exam; trn_eye_exam_hdr objCurrentEyeExam = (trn_eye_exam_hdr)bindingSourcetrn_eye_exam_hdr.Current; trn_eye_aircrew_thai objthai = dbc.trn_eye_aircrew_thais.Where(c => c.teh_id == objCurrentEyeExam.teh_id).FirstOrDefault(); trn_eye_aircrew_faa objfa = dbc.trn_eye_aircrew_faas.Where(c => c.teh_id == objCurrentEyeExam.teh_id).FirstOrDefault(); trn_eye_aircrew_can objcan = dbc.trn_eye_aircrew_cans.Where(c => c.teh_id == objCurrentEyeExam.teh_id).FirstOrDefault(); trn_eye_aircrew_aus objaus = dbc.trn_eye_aircrew_aus.Where(c => c.teh_id == objCurrentEyeExam.teh_id).FirstOrDefault(); trn_eye_diagnosi objdiagnosis = dbc.trn_eye_diagnosis.Where(c => c.teh_id == objCurrentEyeExam.teh_id).FirstOrDefault(); Program.SetValueRadioGroup(pnlcolor, objCurrentEyeExam.teh_color_vision); Program.SetValueRadioGroup(pnlEyeHidRE, objCurrentEyeExam.teh_eyehid_le); Program.SetValueRadioGroup(pnlEyeHidLE, objCurrentEyeExam.teh_eyehid_re); cmbHidSpecifyRE.SelectedText = objCurrentEyeExam.teh_eyehid_rspecify; cmbHidSpecifyRE.SelectedText = objCurrentEyeExam.teh_eyehid_lspecify; Program.SetValueRadioGroup(pnlOrbitRE, objCurrentEyeExam.teh_orbit_re); Program.SetValueRadioGroup(pnlOrbitLE, objCurrentEyeExam.teh_orbit_le); Program.SetValueRadioGroup(pnlConjRE, objCurrentEyeExam.teh_conj_re); Program.SetValueRadioGroup(pnlConjLE, objCurrentEyeExam.teh_conj_le); Program.SetValueRadioGroup(pnlCornRE, objCurrentEyeExam.teh_corn_re); Program.SetValueRadioGroup(pnlCornRE, objCurrentEyeExam.teh_corn_le); Program.SetValueRadioGroup(pnlIrisLE, objCurrentEyeExam.teh_iris_re); Program.SetValueRadioGroup(pnlIrisRE, objCurrentEyeExam.teh_iris_le); Program.SetValueRadioGroup(pnlAC_depth, objCurrentEyeExam.teh_acdep); Program.SetValueRadioGroup(pnlLensRE, objCurrentEyeExam.teh_lens_re); Program.SetValueRadioGroup(pnllensLE, objCurrentEyeExam.teh_lens_le); Program.SetValueRadioGroup(pnlRetinaRE, objCurrentEyeExam.teh_retina_re); Program.SetValueRadioGroup(pnlRetinaLE, objCurrentEyeExam.teh_retina_le); Program.SetValueRadioGroup(pnlCularRE, objCurrentEyeExam.teh_cular_re); Program.SetValueRadioGroup(pnlCularLE, objCurrentEyeExam.teh_cular_le); Program.SetValueRadioGroup(pnlFundusMacRE, objCurrentEyeExam.teh_fund_rmacula); Program.SetValueRadioGroup(pnlFundusMacLE, objCurrentEyeExam.teh_fund_lmacula); Program.SetValueRadioGroup(pnlNormalcupdiscRE, objCurrentEyeExam.teh_fund_rcup); Program.SetValueRadioGroup(pnlNormalcupdiscLE, objCurrentEyeExam.teh_fund_lcup); if (objCurrentEyeExam.teh_advp_disease == 'Y') { chk_adpDisease.Checked = true; } if (objCurrentEyeExam.teh_advp_med == 'Y') { chk_adpMed.Checked = true; } if (objCurrentEyeExam.teh_advp_care == 'Y') { chk_adpCare.Checked = true; } if (objCurrentEyeExam.teh_advp_fu == 'Y') { chk_adpFU.Checked = true; } if (objCurrentEyeExam.teh_advp_medical == 'Y') { chk_adpMedical.Checked = true; } var master = (from a in dbc.trn_eye_diagnosis join b in dbc.trn_eye_exam_hdrs on a.teh_id equals b.teh_id where a.teh_id == b.teh_id && b.tpr_id == TprID && a.ted_main == "Refractive Error" || a.ted_main == "Visual Disturbance" select new { main = a.ted_main, detail = a.ted_detail }).Count(); if (master != 0) { btnAddDiagnosis_Click(null, null); } //tab 2 if (objthai != null) { bindingSourcetrn_eye_aircrew_thai.DataSource = objthai; if (TprID == 0) { bindingSourcetrn_eye_aircrew_thai.DataSource = dbc.trn_eye_aircrew_thais; bindingSourcetrn_eye_aircrew_thai.AddNew(); } else { trn_eye_aircrew_thai trneyethai = (trn_eye_aircrew_thai)bindingSourcetrn_eye_aircrew_thai.Current; Program.SetValueRadioGroup(pnlcolorvision, trneyethai.tea_color_vis.ToString()); Program.SetValueRadioGroup(pnlvisionfailed, trneyethai.tea_vis_field.ToString()); } } else if (objthai == null) { bindingSourcetrn_eye_aircrew_thai.DataSource = dbc.trn_eye_aircrew_thais; bindingSourcetrn_eye_aircrew_thai.AddNew(); } //tab 3 if (objfa != null) { bindingSourcetrn_eye_aircrew_faa.DataSource = objfa; if (TprID == 0) { bindingSourcetrn_eye_aircrew_faa.DataSource = dbc.trn_eye_aircrew_faas; bindingSourcetrn_eye_aircrew_faa.AddNew(); } else { trn_eye_aircrew_faa trneyefa = (trn_eye_aircrew_faa)bindingSourcetrn_eye_aircrew_faa.Current; Program.SetValueRadioGroup(pnlcolorvisionFa, trneyefa.taf_color_vis.ToString()); Program.SetValueRadioGroup(pnlvisionfailedFa, trneyefa.taf_vis_field.ToString()); } } else if (objfa == null) { bindingSourcetrn_eye_aircrew_faa.DataSource = dbc.trn_eye_aircrew_faas; bindingSourcetrn_eye_aircrew_faa.AddNew(); } //tab 4 if (objcan != null) { bindingSourcetrn_eye_aircrew_can.DataSource = objcan; if (TprID == 0) { bindingSourcetrn_eye_aircrew_can.DataSource = dbc.trn_eye_aircrew_cans; bindingSourcetrn_eye_aircrew_can.AddNew(); } else { trn_eye_aircrew_can trneyecan = (trn_eye_aircrew_can)bindingSourcetrn_eye_aircrew_can.Current; Program.SetValueRadioGroup(pnlcolorcan, trneyecan.tac_color_vis.ToString()); Program.SetValueRadioGroup(pnlvisionfailedcan, trneyecan.tac_vis_field.ToString()); } } else if (objcan == null) { bindingSourcetrn_eye_aircrew_can.DataSource = dbc.trn_eye_aircrew_cans; bindingSourcetrn_eye_aircrew_can.AddNew(); } //tab 5 if (objaus != null) { bindingSourcetrn_eye_aircrew_aus.DataSource = objaus; if (TprID == 0) { bindingSourcetrn_eye_aircrew_aus.DataSource = dbc.trn_eye_aircrew_aus; bindingSourcetrn_eye_aircrew_aus.AddNew(); } else { trn_eye_aircrew_aus trneyeaus = (trn_eye_aircrew_aus)bindingSourcetrn_eye_aircrew_aus.Current; Program.SetValueRadioGroup(pnlcolorAus, trneyeaus.taa_color_vis.ToString()); Program.SetValueRadioGroup(pnlvisionfailedAus, trneyeaus.taa_vis_field.ToString()); } } else if (objaus == null) { bindingSourcetrn_eye_aircrew_aus.DataSource = dbc.trn_eye_aircrew_aus; bindingSourcetrn_eye_aircrew_aus.AddNew(); } trn_patient_regi objcurrentRegis = (from t1 in dbc.trn_patient_regis where t1.tpr_id == TprID select t1).FirstOrDefault(); if (objcurrentRegis != null) { string strHn = objcurrentRegis.trn_patient.tpt_hn_no; string strEN = objcurrentRegis.tpr_en_no; string strUser = Program.CurrentUser.mut_username; Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls(); DataTable dtservice = ws.GetMedicineByDoctor(strHn, strEN, strUser); //DataTable dtservice = ws.GetMedicineByDoctor("01-92-006363", "O01-12-876565", "001915668"); DataSet ds = new DataSet("dss"); Tmptable.Columns.Add("Item"); Tmptable.Columns.Add("OrderName"); Tmptable.Columns.Add("Instruction"); Tmptable.Columns.Add("Dosage"); Tmptable.Columns.Add("UOM"); Tmptable.Columns.Add("Freg"); ds.Tables.Add(Tmptable); if (dtservice.Rows.Count > 0) { for (int i = 0; i <= dtservice.Rows.Count - 1; i++) { DataRow newRow = Tmptable.NewRow(); Tmptable.Rows.Add(newRow); newRow["Item"] = i + 1; newRow["OrderName"] = dtservice.Rows[i][2].ToString(); newRow["Instruction"] = dtservice.Rows[i][10].ToString(); newRow["Dosage"] = dtservice.Rows[i][17].ToString(); newRow["UOM"] = dtservice.Rows[i][18].ToString(); newRow["Freg"] = dtservice.Rows[i][20].ToString(); dgvMedical.DataSource = Tmptable; dgvMedical.Columns[0].Width = 50; } } } } else { bindingSourcetrn_eye_exam_hdr.DataSource = dbc.trn_eye_exam_hdrs; bindingSourcetrn_eye_exam_hdr.AddNew(); bindingSourcetrn_eye_aircrew_thai.DataSource = dbc.trn_eye_aircrew_thais; bindingSourcetrn_eye_aircrew_thai.AddNew(); bindingSourcetrn_eye_aircrew_faa.DataSource = dbc.trn_eye_aircrew_faas; bindingSourcetrn_eye_aircrew_faa.AddNew(); bindingSourcetrn_eye_aircrew_can.DataSource = dbc.trn_eye_aircrew_cans; bindingSourcetrn_eye_aircrew_can.AddNew(); bindingSourcetrn_eye_aircrew_aus.DataSource = dbc.trn_eye_aircrew_aus; bindingSourcetrn_eye_aircrew_aus.AddNew(); } }