コード例 #1
0
 private void favoriteTextBox1_BtnFavoriteClick(object sender, EventArgs e)
 {
     Usercontrols.FavoriteTextBox txtBox = sender as Usercontrols.FavoriteTextBox;
     if (txtBox != null)
     {
         string user_name = Program.CurrentUser == null ? null : Program.CurrentUser.mut_username;
         bool   savefav   = new EmrClass.FavoriteCls().saveFavorite(txtBox.FavoriteOrder, txtBox.FavoriteType, txtBox.Text, user_name);
         if (savefav)
         {
             txtBox.AutoCompleteListThList.Add(txtBox.Text);
             MessageBox.Show("Add '" + txtBox.Text + "' to favorite Complete.");
         }
     }
 }
コード例 #2
0
        private void LoadData()
        {
            Clear();
            if (_tpr_id != null && _trxr_type != null)
            {
                try
                {
                    favoriteTextBox1.FavoriteOrder = _trxr_type;
                    if (_trxr_type == "UU")
                    {
                        ChkSummaryResult.Text    = "Abdomen Result";
                        ChkSummaryResult.Visible = true;
                    }
                    else if (_trxr_type == "DM")
                    {
                        ChkSummaryResult.Text    = "Mammogram with Ultrasound Breast Result";
                        ChkSummaryResult.Visible = true;
                    }
                    else
                    {
                        ChkSummaryResult.Text    = "";
                        ChkSummaryResult.Visible = false;
                    }
                    List <mst_conclusion_favorite_dtl> mst = new EmrClass.FavoriteCls().getFavorite(favoriteTextBox1.FavoriteOrder, favoriteTextBox1.FavoriteType);
                    favoriteTextBox1.AutoCompleteListThList = mst.Select(x => x.mcfd_description).ToList();

                    cdc = new InhCheckupDataContext();
                    trn_patient_regi reg = cdc.trn_patient_regis.Where(x => x.tpr_id == _tpr_id).FirstOrDefault();
                    if (reg != null)
                    {
                        bool retrieve = true;
                        var  ret      = reg.trn_patient_retrieves.Where(x => x.tpr_image_type == _trxr_type).FirstOrDefault();
                        if (ret != null)
                        {
                            retrieve = ret.tpr_flag_retrieve == null ? true : (bool)ret.tpr_flag_retrieve;
                        }

                        trn_doctor_hdr hdr = reg.trn_doctor_hdrs.FirstOrDefault();
                        if (hdr == null)
                        {
                            hdr = new trn_doctor_hdr();
                            reg.trn_doctor_hdrs.Add(hdr);
                        }
                        trn_doctor_xray xray = hdr.trn_doctor_xrays.Where(x => x.trxr_type == _trxr_type).FirstOrDefault();
                        if (xray == null)
                        {
                            xray = new trn_doctor_xray();
                            xray.trxr_not_show_rpt = 'N';
                            xray.trxr_type         = _trxr_type;
                            hdr.trn_doctor_xrays.Add(xray);
                        }

                        if (retrieve)
                        {
                            var result = LoadResult(reg.tpr_en_no);
                            xray.trxr_order_code  = result.trxr_order_code;
                            xray.trxr_order_name  = result.trxr_order_name;
                            xray.trxr_order_date  = result.trxr_order_date;
                            xray.trxr_result_date = result.trxr_result_date;
                            xray.trxr_overseen_by = result.trxr_overseen_by;
                            xray.trxr_result      = result.trxr_result;
                        }

                        var xray_images = xray.trn_doctor_xray_images.ToList();
                        int i           = 0;
                        foreach (trn_doctor_xray_image image in xray_images)
                        {
                            System.IO.MemoryStream ms = new System.IO.MemoryStream(image.trxm_image.ToArray());
                            Image img = Image.FromStream(ms);
                            AddImage(img, image.trxm_sel_image == 'S' ? true : false);
                        }

                        txtPacURL.Text          = LoadURL(reg.tpt_id, reg.tpr_en_no);
                        DoctorXrayBS.DataSource = xray;
                    }
                    panel1.Enabled = true;
                }
                catch (Exception ex)
                {
                    Program.MessageError("DialogImaging", "LoadData()", ex, false);
                    panel1.Enabled = false;
                }
            }
        }