private void autoCompleteUC1_SelectedValueChanged(object sender, object e) { try { trn_carotid_tech ct = bsCarotidTech.OfType <trn_carotid_tech>().FirstOrDefault(); if (ct != null) { if (e == null) { ct.tct_doctor_code = null; ct.tct_doctor_name = null; txtDocCode.Text = null; } else { ct.tct_doctor_code = ((DoctorProfile)e).SSUSR_Initials; ct.tct_doctor_name = ((DoctorProfile)e).CTPCP_Desc; txtDocCode.Text = ((DoctorProfile)e).SSUSR_Initials; } } } catch (Exception ex) { Program.MessageError(this.Name, "autoCompleteUC1_SelectedValueChanged", ex, false); } }
public void EndEdit() { trn_carotid_tech obj = _PatientRegis.trn_carotid_teches.FirstOrDefault(); if (autoCompleteUC1.SelectedItem != null) { DoctorProfile dc = (DoctorProfile)autoCompleteUC1.SelectedItem; obj.tct_doctor_code = dc.SSUSR_Initials; obj.tct_doctor_name = dc.CTPCP_Desc; } else { obj.tct_doctor_code = null; obj.tct_doctor_name = null; } }
private void GridDoctorName_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { var selectedItems = GridDoctorName.CurrentRow; trn_carotid_tech objcurrenttpr = (trn_carotid_tech)bindingSourceTrn_carotid_Tech.Current; objcurrenttpr.tct_doctor_code = selectedItems.Cells[1].Value.ToString(); objcurrenttpr.tct_doctor_name = selectedItems.Cells[0].Value.ToString(); txtDoctorName.Text = objcurrenttpr.tct_doctor_name; txtDoctorCode.Text = objcurrenttpr.tct_doctor_code; txtDoctorName.Focus(); } catch (Exception) { } GridDoctorName.Visible = false; }
private void LoadImage(ref trn_patient_regi _patient_regis) { trn_carotid_tech objCarotid = _patient_regis.trn_carotid_teches.FirstOrDefault(); if (objCarotid != null) { if (objCarotid.tct_left_result != null) { object objimg_r = objCarotid.tct_right_result.ToArray(); byte[] data1; data1 = (byte[])objimg_r; MemoryStream ms1 = new MemoryStream(data1); pictureBoxRight.Image = Image.FromStream(ms1); } else { pictureBoxRight.Image = Properties.Resources.carotid_1; } if (objCarotid.tct_right_result != null) { object objimg_l = objCarotid.tct_left_result.ToArray(); byte[] data2; data2 = (byte[])objimg_l; MemoryStream ms2 = new MemoryStream(data2); pictureBoxLeft.Image = Image.FromStream(ms2); } else { pictureBoxLeft.Image = Properties.Resources.carotid_2; } } else { pictureBoxRight.Image = Properties.Resources.carotid_1; pictureBoxLeft.Image = Properties.Resources.carotid_2; } }
private void LoadData(int tpr_id) { trn_carotid_tech obj = dbc.trn_carotid_teches.Where(c => c.tpr_id == tpr_id).FirstOrDefault(); if (obj != null) { bindingSourceTrn_carotid_Tech.DataSource = obj; trn_carotid_tech trnCarotid_tech = (trn_carotid_tech)bindingSourceTrn_carotid_Tech.Current; objimage_L = trnCarotid_tech.tct_left_result.ToArray(); objimage_R = trnCarotid_tech.tct_right_result.ToArray(); byte[] data; byte[] data2; data = (byte[])objimage_L; data2 = (byte[])objimage_R; MemoryStream ms = new MemoryStream(data); MemoryStream ms2 = new MemoryStream(data2); pictureBoxLeft.Image = Image.FromStream(ms); pictureBoxRight.Image = Image.FromStream(ms2); Program.SetValueRadioGroup(pnlDuplex, trnCarotid_tech.tct_finding_ca_duplex.ToString()); cmblist1.SelectedItem = trnCarotid_tech.tct_appoint_depart; Program.SetValueRadioGroup(pnlStatusCall, trnCarotid_tech.tct_call_status.ToString()); Program.SetValueRadioGroup(pnlsummary, trnCarotid_tech.tct_summary.ToString()); txtDoctorCode.Text = trnCarotid_tech.tct_doctor_code; txtDoctorName.Text = trnCarotid_tech.tct_doctor_name; string Str_Appoint_Date = string.IsNullOrEmpty(trnCarotid_tech.tct_appoint_doctor_date.ToString()) ? "" : Convert.ToDateTime(trnCarotid_tech.tct_appoint_doctor_date).ToString(); string Str_Followup_Date = string.IsNullOrEmpty(trnCarotid_tech.tct_follow_up.ToString()) ? "" : Convert.ToDateTime(trnCarotid_tech.tct_follow_up).ToString(); dateTimePicker1.Text = Str_Appoint_Date; dateTimeFollowup.Text = Str_Followup_Date; txtsumaryRemark.Text = trnCarotid_tech.tct_summary_remark; if (trnCarotid_tech.tct_appoint_doctor == true) { chkappoint.Checked = true; } if (trnCarotid_tech.tct_advice_med == true) { chkAdviceMec.Checked = true; txtAdviceMec.Text = trnCarotid_tech.tct_advice_med_rmk; } if (trnCarotid_tech.tct_advice_dit == true) { chkAdviceDiet.Checked = true; txtAdviceDiet.Text = trnCarotid_tech.tct_advice_dit_rmk; } if (trnCarotid_tech.tct_advice_exr == true) { chkAdviceExercise.Checked = true; txtAdviceExercise.Text = trnCarotid_tech.tct_advice_exr_rmk; } if (trnCarotid_tech.tct_consult_card == true) { chkConsult.Checked = true; txtconsult.Text = trnCarotid_tech.tct_consult_card_rmk; } if (trnCarotid_tech.tct_fu_carotid == true) { chkfu.Checked = true; txtfu.Text = trnCarotid_tech.tct_fu_carotid_rmk; } if (trnCarotid_tech.tct_prn == true) { chk_prn.Checked = true; } txtremark.Text = trnCarotid_tech.tct_other_remark; Program.SetValueRadioGroup(pnlAppointStatus, trnCarotid_tech.tct_appoint_status.ToString()); } else { bindingSourceTrn_carotid_Tech.DataSource = (from t1 in dbc.trn_carotid_teches select t1); bindingSourceTrn_carotid_Tech.AddNew(); pictureBoxLeft.Image = Properties.Resources.carotid_2; pictureBoxRight.Image = Properties.Resources.carotid_1; } }
private bool Save(char type) { trn_carotid_tech Carotid_Tech = (trn_carotid_tech)bindingSourceTrn_carotid_Tech.Current; Boolean saveIsCompleted = false; DateTime datenowvalue = Program.GetServerDateTime(); Carotid_Tech.tpr_id = TprID; Carotid_Tech.tct_type = type; Carotid_Tech.tct_result = false; PictureBox p1 = new PictureBox(); PictureBox p2 = new PictureBox(); using (Bitmap bitmap = new Bitmap(pictureBoxLeft.ClientSize.Width, pictureBoxLeft.ClientSize.Height)) { pictureBoxLeft.DrawToBitmap(bitmap, pictureBoxLeft.ClientRectangle); Bitmap bmp = new Bitmap(bitmap); p1.SizeMode = PictureBoxSizeMode.StretchImage; p1.Image = (Image)bmp; } using (Bitmap bitmap = new Bitmap(pictureBoxRight.ClientSize.Width, pictureBoxRight.ClientSize.Height)) { pictureBoxRight.DrawToBitmap(bitmap, pictureBoxRight.ClientRectangle); Bitmap bmp = new Bitmap(bitmap); p2.SizeMode = PictureBoxSizeMode.StretchImage; p2.Image = (Image)bmp; } MemoryStream stream_L = new MemoryStream(); MemoryStream stream_R = new MemoryStream(); p1.Image.Save(stream_L, System.Drawing.Imaging.ImageFormat.Jpeg); p2.Image.Save(stream_R, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] pic_L = stream_L.ToArray(); byte[] pic_R = stream_R.ToArray(); Carotid_Tech.tct_left_result = pic_L; Carotid_Tech.tct_right_result = pic_R; Carotid_Tech.tct_finding_ca_duplex = Program.GetValueRadio(pnlDuplex); if (rdresult1.Checked == true) { Carotid_Tech.tct_appoint_depart = cmblist1.SelectedItem.ToString(); } else { Carotid_Tech.tct_appoint_depart = DBNull.Value.ToString(); } Carotid_Tech.tct_call_status = Program.GetValueRadioTochar(pnlStatusCall); Carotid_Tech.tct_appoint_doctor = (chkappoint.Checked) ? true : false; Carotid_Tech.tct_appoint_doctor_date = dt_appoint; Carotid_Tech.tct_doctor_code = txtDoctorCode.Text; Carotid_Tech.tct_doctor_name = txtDoctorName.Text; Carotid_Tech.tct_appoint_status = Program.GetValueRadio(pnlAppointStatus); Carotid_Tech.tct_doctor_code = txtDoctorCode.Text; Carotid_Tech.tct_doctor_name = txtDoctorName.Text; Carotid_Tech.tct_summary = Program.GetValueRadioTochar(pnlsummary); Carotid_Tech.tct_summary_remark = txtsumaryRemark.Text; Carotid_Tech.tct_advice_med = (chkAdviceMec.Checked) ? true : false; Carotid_Tech.tct_advice_med_rmk = txtAdviceMec.Text; Carotid_Tech.tct_advice_dit = (chkAdviceDiet.Checked) ? true : false; Carotid_Tech.tct_advice_dit_rmk = txtAdviceDiet.Text; Carotid_Tech.tct_advice_exr = (chkAdviceExercise.Checked) ? true : false; Carotid_Tech.tct_advice_exr_rmk = txtAdviceExercise.Text; Carotid_Tech.tct_consult_card = (chkConsult.Checked) ? true : false; Carotid_Tech.tct_consult_card_rmk = txtconsult.Text; Carotid_Tech.tct_fu_carotid = (chkfu.Checked) ? true : false; Carotid_Tech.tct_fu_carotid_rmk = txtfu.Text; Carotid_Tech.tct_other_remark = txtremark.Text; Carotid_Tech.tct_follow_up = dt_followup; Carotid_Tech.tct_prn = (chk_prn.Checked) ? true : false; if (Carotid_Tech.tct_create_by == null) { Carotid_Tech.tct_create_by = Program.CurrentUser.mut_username; Carotid_Tech.tct_create_date = datenowvalue; } Carotid_Tech.tct_update_by = Program.CurrentUser.mut_username; Carotid_Tech.tct_update_date = Carotid_Tech.tct_create_date; bindingSourceTrn_carotid_Tech.EndEdit(); dbc.SubmitChanges(); saveIsCompleted = true; if (saveIsCompleted == true) { var tctid = (from q in dbc.trn_carotid_teches select q.tct_id).Max(); } return(saveIsCompleted); }