Ejemplo n.º 1
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow dataRow = gridView1.GetFocusedDataRow();
         if (dataRow == null)
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("请先选中记录");
             return;
         }
         DialogResult dResult = DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("确定要删除该条记录吗?", "删除提示", DrectSoft.Common.Ctrs.DLG.MyMessageBoxButtons.YesNo);
         if (dResult == DialogResult.No)
         {
             return;
         }
         InCommonNoteEnmtity IncommonNoteDel = m_InCommonNoteList.Find(a => a.InCommonNoteFlow == dataRow["InCommonNoteFlow"].ToString());
         InCommonNoteBiz     inCommonNoteBiz = new InCommonNoteBiz(m_app);
         string message   = "";
         bool   delResult = inCommonNoteBiz.DelInCommonNote(IncommonNoteDel, ref message);
         if (delResult)
         {
             m_InCommonNoteList.Remove(IncommonNoteDel);
             DataTable dt = SetCommonToDataTable(m_InCommonNoteList);
             gcIncommonList.DataSource = dt;
         }
         else
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(message);
         }
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 将commonNoteEntity转成InCommonNoteEnmtity,并保存
 /// </summary>
 /// <param name="commonNoteEntity"></param>
 /// <returns></returns>
 private InCommonNoteEnmtity ConverBycommonNote(CommonNoteEntity commonNoteEntity)
 {
     try
     {
         CommonNoteBiz commonNoteBiz = new DrectSoft.Core.CommonTableConfig.CommonNoteBiz(m_app);
         commonNoteEntity = commonNoteBiz.GetDetailCommonNote(commonNoteEntity.CommonNoteFlow);
         InCommonNoteEnmtity inCommonNote = InCommonNoteBiz.ConvertCommonToInCommon(commonNoteEntity);
         InCommonNoteBiz     icombiz      = new DrectSoft.Core.CommonTableConfig.CommonNoteUse.InCommonNoteBiz(m_app);
         DataTable           inpatientDt  = icombiz.GetInpatient(m_noofinpat);
         inCommonNote.CurrDepartID   = inpatientDt.Rows[0]["OUTHOSDEPT"].ToString();
         inCommonNote.CurrDepartName = inpatientDt.Rows[0]["DEPARTNAME"].ToString();
         inCommonNote.CurrWardID     = inpatientDt.Rows[0]["OUTHOSWARD"].ToString();
         inCommonNote.CurrWardName   = inpatientDt.Rows[0]["WARDNAME"].ToString();
         inCommonNote.NoofInpatient  = m_noofinpat;
         inCommonNote.InPatientName  = inpatientDt.Rows[0]["NAME"].ToString();
         string message    = "";
         bool   saveResult = icombiz.SaveInCommomNoteAll(inCommonNote, ref message);
         if (saveResult)
         {
             return(inCommonNote);
         }
         else
         {
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("创建单据失败");
             return(null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 测试方法
        /// </summary>
        private void Test()
        {
            string        message = "";
            CommonNoteBiz cbiz    = new CommonNoteBiz(m_app);

            m_commonNoteEntity = cbiz.GetDetailCommonNote("f5d1c558-df2a-4ac5-8d1d-6ef3ccaef5e7");
            InCommonNoteBiz            icombiz          = new InCommonNoteBiz(m_app);
            List <InCommonNoteEnmtity> InCommonNoteList = icombiz.GetSimInCommonNote("1333");

            if (InCommonNoteList == null || InCommonNoteList.Count == 0)
            {
                m_inCommonNote = InCommonNoteBiz.ConvertCommonToInCommon(m_commonNoteEntity);
                DataTable inpatientDt = icombiz.GetInpatient("1333");
                m_inCommonNote.CurrDepartID   = inpatientDt.Rows[0]["OUTHOSDEPT"].ToString();
                m_inCommonNote.CurrDepartName = inpatientDt.Rows[0]["DEPARTNAME"].ToString();
                m_inCommonNote.CurrWardID     = inpatientDt.Rows[0]["OUTHOSWARD"].ToString();
                m_inCommonNote.CurrWardName   = inpatientDt.Rows[0]["WARDNAME"].ToString();
                m_inCommonNote.NoofInpatient  = "1333";
                m_inCommonNote.InPatientName  = inpatientDt.Rows[0]["NAME"].ToString();
                bool saveResult = icombiz.SaveInCommomNoteAll(m_inCommonNote, ref message);
            }
            else
            {
                m_inCommonNote = InCommonNoteList[0];
            }
        }
Ejemplo n.º 4
0
 public UCInCommonTabSingle(InCommonNoteTabEntity inCommonNoteTab, CommonNote_TabEntity commonNote_TabEntity, InCommonNoteEnmtity inCommonNote, IEmrHost app, bool canEdit)
 {
     m_inCommonNote         = inCommonNote;
     m_InCommonNoteTab      = inCommonNoteTab;
     m_commonNote_TabEntity = commonNote_TabEntity;
     m_app           = app;
     inCommonNoteBiz = new InCommonNoteBiz(m_app);
     m_canEdit       = canEdit;
     InitializeComponent();
     this.Enabled = m_canEdit;
     InitData();
 }
Ejemplo n.º 5
0
 private void GetMyIncommon()
 {
     try
     {
         DataRow dataRow = gridView1.GetFocusedDataRow();
         if (dataRow == null)
         {
             return;
         }
         MyInCommonNoteEnmtity = m_InCommonNoteList.Find(a => a.InCommonNoteFlow == dataRow["InCommonNoteFlow"].ToString());
         this.DialogResult     = DialogResult.OK;
         this.Close();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 6
0
 public UCInCommonNote(IEmrHost app, CommonNoteEntity commonNoteEntity, InCommonNoteEnmtity inCommonNote, bool canEdit)
 {
     try
     {
         m_app = app;
         m_commonNoteEntity = commonNoteEntity;
         m_inCommonNote     = inCommonNote;
         m_canEdit          = canEdit;
         //Test();
         InitializeComponent();
         GetBiaoDianAndFuHao();
         InitForm();
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.StackTrace);
     }
 }
Ejemplo n.º 7
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         InCommonNoteEnmtity inCommonNoteEnmtity = ConverBycommonNote(m_commonNoteEntity);
         if (inCommonNoteEnmtity == null)
         {
             return;
         }
         InCommonNoteBiz icbiz = new InCommonNoteBiz(m_app);
         icbiz.GetDetaliInCommonNote(ref inCommonNoteEnmtity);
         m_InCommonNoteList.Add(inCommonNoteEnmtity);
         DataTable dt = SetCommonToDataTable(m_InCommonNoteList);
         gcIncommonList.DataSource = dt;
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 切换tab触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabcontrol_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
        {
            if (tabcontrol.SelectedTabPage != tabPagePrint)
            {
                return;
            }
            WaitDialogForm waitDialog = new WaitDialogForm("正在组织打印数据……", "请稍等。");

            try
            {
                //xll 2013-03-26 获取全部数据 点击全部了 就无需再次查找 点击其他的 需要查找
                foreach (XtraTabPage item in tabcontrol.TabPages)
                {
                    if (item.Controls.Count > 0)
                    {
                        UCIncommonNoteTab uCIncommonNoteTab = item.Controls[0] as UCIncommonNoteTab;
                        if (uCIncommonNoteTab != null)
                        {
                            m_inCommonNote = uCIncommonNoteTab.GetAllDetailDate();
                            break;
                        }
                    }
                }
                PrintInCommonView printInCommonView = ConvertPrintEntity();

                iPrintNurse = AbstractorFactry.GetNurseRecord(printInCommonView.PrintFileName);
                SetWaitDialogCaption("正在绘制预览界面……", waitDialog);
                if (iPrintNurse != null && iPrintNurse.IsCustomPrint == true)
                {
                    if (tabPagePrint.Controls == null || tabPagePrint.Controls.Count <= 0)
                    {
                        PrintForm1 printForm1 = new PrintForm1(printInCommonView);
                        printForm1.Dock            = DockStyle.Fill;
                        printForm1.TopLevel        = false;
                        printForm1.FormBorderStyle = FormBorderStyle.None;
                        printForm1.Show();
                        tabPagePrint.Controls.Add(printForm1);
                    }
                    else
                    {
                        PrintForm1 printForm1 = tabPagePrint.Controls[0] as PrintForm1;
                        if (printForm1 != null)
                        {
                            printForm1.m_printInCommonView = printInCommonView;
                            printForm1.RefreshView();
                        }
                    }
                }
                else
                {
                    if (ucPrintRecord == null)
                    {
                        ucPrintRecord = new UCPrintRecord();
                        tabPagePrint.Controls.Add(ucPrintRecord);
                        ucPrintRecord.Dock = DockStyle.Fill;
                    }
                    ucPrintRecord.LoadPrint(printInCommonView);
                }
                waitDialog.Hide();
                waitDialog.Close();
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }