Exemplo n.º 1
0
 /// <summary>
 /// 当DateTimeShow相同时  下面的DateTimeShow不显示
 /// </summary>
 /// <param name="printInCommonView"></param>
 private void ConvertForDateTime(PrintInCommonView printInCommonView)
 {
     if (printInCommonView != null || printInCommonView.PrintInCommonTabViewList1 != null)
     {
         InCommonNoteBiz.ConvertForDateTime(printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList);
     }
 }
Exemplo n.º 2
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];
            }
        }
Exemplo n.º 3
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);
     }
 }
Exemplo n.º 4
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;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// 打印全部事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void printDocumentPre_PrintPage(object sender, PrintPageEventArgs e)
 {
     try
     {
         if (m_printInCommonView == null ||
             m_printInCommonView.PrintInCommonTabViewList1 == null)
         {
             return;
         }
         if (m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList == null)
         {
             m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = new List <PrintInCommonItemView>();
         }
         int PageRecordCount           = iPrintNurse.PageRecordCount; //每张的行数
         var PrintInCommonItemViewList = m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList;
         int allcount  = PrintInCommonItemViewList.Count;
         int pageCount = (allcount + PageRecordCount - 1) / PageRecordCount;  //总页数
         if (pageCount == 0)
         {
             pageCount = 1;
         }
         List <PrintInCommonItemView> printInCommonItemViewEven = new List <PrintInCommonItemView>();
         for (int j = printPageNowPer * PageRecordCount; j < ((printPageNowPer + 1) * PageRecordCount); j++)
         {
             if (j < allcount)
             {
                 PrintInCommonItemViewList[j].RowNum = j + 1;
                 InCommonNoteBiz.ConvertForImgRec(PrintInCommonItemViewList[j]);
                 printInCommonItemViewEven.Add(PrintInCommonItemViewList[j]);
             }
         }
         InCommonNoteBiz.ConvertForDateTime(printInCommonItemViewEven);
         InCommonNoteBiz.SetRowEnd(printInCommonItemViewEven, m_printInCommonView.PrintFileName);
         RecordPrintView recordPrintView = ConvertPrintView(m_printInCommonView);
         recordPrintView.PrintInpatientView.ListCount = printInCommonItemViewEven.Count.ToString();
         int Addpage = Convert.ToInt32(speNum.Value);
         recordPrintView.PrintInpatientView.CurrPage = (printPageNowPer + Addpage).ToString();
         recordPrintView.PrintInCommonItemViewList   = printInCommonItemViewEven;
         iPrintNurse.GetPreview(recordPrintView, e.Graphics);
         if (printPageNowPer < pageCount - 1 && printPageNowPer < printEnd - 1)
         {
             e.HasMorePages             = true;
             printPreviewControl1.Rows += 1;
             printPageNowPer++;
             return;
         }
         else
         {
             spinEditPage.Properties.MinValue = (int)speNum.Value;
             spinEditPage.Properties.MaxValue = pageCount + (int)speNum.Value - 1;
             printPageNowPer = 0;
             e.HasMorePages  = false;
         }
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message + ex.StackTrace);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 将一列变成可绑定的多列  最大只有5大列
        /// </summary>
        /// <param name="printInCommonView"></param>
        private void ConvertForDuoLie(PrintInCommonView printInCommonView)
        {
            List <PrintInCommonItemView> printInCommonItemViewListOld = printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList;

            if (printInCommonItemViewListOld == null)
            {
                return;
            }
            Dictionary <string, string> dicstr = InCommonNoteBiz.GetReportxmlCol(printInCommonView);

            if (!dicstr.ContainsKey("maxCols"))
            {
                return;
            }
            string maxcols = dicstr["maxCols"]; //大列数
            int    maxcolsint;                  //大列
            bool   ismax = int.TryParse(maxcols, out maxcolsint);

            if (maxcolsint <= 1 || maxcolsint > 5)
            {
                return;
            }
            List <PrintInCommonItemView> printInCommonItemViewListNew = new List <PrintInCommonItemView>();

            for (int i = 0; i < printInCommonItemViewListOld.Count; i++)
            {
                int yushu = i % maxcolsint;
                if (yushu == 0)
                {
                    PrintInCommonItemView printInCommonItemView = new PrintInCommonItemView();
                    if (maxcolsint >= 5 &&
                        (i + 4 < printInCommonItemViewListOld.Count))
                    {
                        printInCommonItemView.PrintInCommonItemView5 = printInCommonItemViewListOld[i + 4];
                    }
                    if (maxcolsint >= 4 &&
                        (i + 3 < printInCommonItemViewListOld.Count))
                    {
                        printInCommonItemView.PrintInCommonItemView4 = printInCommonItemViewListOld[i + 3];
                    }
                    if (maxcolsint >= 3 &&
                        (i + 2 < printInCommonItemViewListOld.Count))
                    {
                        printInCommonItemView.PrintInCommonItemView3 = printInCommonItemViewListOld[i + 2];
                    }
                    if (maxcolsint >= 2 &&
                        (i + 1 < printInCommonItemViewListOld.Count))
                    {
                        printInCommonItemView.PrintInCommonItemView2 = printInCommonItemViewListOld[i + 1];
                    }
                    printInCommonItemView.PrintInCommonItemView1 = printInCommonItemViewListOld[i];

                    printInCommonItemViewListNew.Add(printInCommonItemView);  //添加整理好的一行
                }
            }

            printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = printInCommonItemViewListNew;
        }
Exemplo n.º 7
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        private void InitForm()
        {
            WaitDialogForm waitDialog = new WaitDialogForm("正在获取数据……", "请稍等。");

            try
            {
                if (inCommonNoteBiz == null)
                {
                    inCommonNoteBiz = new InCommonNoteBiz(m_app);
                }
                inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
                waitDialog.Hide();
                waitDialog.Close();
                foreach (var item in m_inCommonNote.InCommonNoteTabList)
                {
                    CommonNote_TabEntity commonNote_TabEntity = null;
                    foreach (var itemTab in m_commonNoteEntity.CommonNote_TabList)
                    {
                        if (itemTab.CommonNote_Tab_Flow == item.CommonNote_Tab_Flow)
                        {
                            commonNote_TabEntity = itemTab;
                            break;
                        }
                    }
                    if (commonNote_TabEntity == null)
                    {
                        continue;
                    }
                    XtraTabPage tabPage = new XtraTabPage();
                    tabPage.Tag  = item;
                    tabPage.Text = item.CommonNoteTabName;
                    if (item.ShowType == "表格")
                    {
                        UCIncommonNoteTab UCIncommonNoteTab = new UCIncommonNoteTab(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(UCIncommonNoteTab);
                        UCIncommonNoteTab.Dock = DockStyle.Fill;
                    }
                    else
                    {
                        UCInCommonTabSingle ucInCommonTabSingle = new UCInCommonTabSingle(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(ucInCommonTabSingle);
                        ucInCommonTabSingle.Dock = DockStyle.Fill;
                    }
                    tabcontrol.TabPages.Add(tabPage);
                }
                tabcontrol.SelectedTabPageIndex = 1;
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                throw ex;
            }
        }
Exemplo n.º 8
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();
 }
Exemplo n.º 9
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            WaitDialogForm waitForm = new WaitDialogForm("正在批量保存数据...", "请稍等");

            try
            {
                string    messageAll  = "";
                bool      hasSave     = true;
                DataTable dataTablePL = gridControl1.DataSource as DataTable;
                if (dataTablePL == null || dataTablePL.Rows.Count <= 0)
                {
                    return;
                }
                foreach (DataRow item in dataTablePL.Rows)
                {
                    if ((bool)item["check"] != true)
                    {
                        continue;
                    }
                    string hisrowflow = Guid.NewGuid().ToString();
                    string groupflow  = item["groupflow"].ToString();
                    foreach (var inItem in dicitemList[groupflow])
                    {
                        string message    = "";
                        bool   itemresult = m_InCommonNoteBiz.SaveIncommonNoteItem(inItem, ref message);
                        if (!itemresult)
                        {
                            hasSave    = false;
                            messageAll = message;
                        }
                        InCommonNoteBiz.AddInCommonColHistory(inItem, hisrowflow);
                    }
                    InCommonNoteBiz.AddInCommonRowHistory(dicitemList[groupflow][0], hisrowflow);
                }
                if (hasSave == false)
                {
                    MyMessageBox.Show("保存失败!" + messageAll, 1);
                }
                else
                {
                    MyMessageBox.Show("保存成功!", 1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
            finally
            {
                waitForm.Close();
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// 初始化病人信息
 /// xlb 2013-01-17
 /// </summary>
 private void InitInpatRecord()
 {
     try
     {
         treeListInpat.ClearNodes();
         m_inCommonNoteBiz = new InCommonNoteBiz(m_app);
         string currentDept = m_app.User.CurrentDeptId == null ? "" : m_app.User.CurrentDeptId;
         string currentWard = m_app.User.CurrentWardId == null ? "" : m_app.User.CurrentWardId;
         currentInpat = m_inCommonNoteBiz.GetAllInpatient(currentDept, currentWard);
         MakeTreeOne(currentInpat);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 11
0
 DataTable dtInpatient;                                           //科室病区病人
 public AddFrom(CommonNoteEntity commonNoteEntity, IEmrHost app)
 {
     this.m_CommonNoteEntity = commonNoteEntity;
     this.m_app             = app;
     this.m_CommonNoteBiz   = new CommonNoteBiz(this.m_app);
     this.m_InCommonNoteBiz = new InCommonNoteBiz(this.m_app);
     InitializeComponent();
     #region ---已注销 by xlb 2013.02.04--------------------
     //if (m_CommonNoteEntity.CommonNote_TabList == null)
     //{
     //    CommonNoteBiz commonNoteBiz = new DrectSoft.Core.CommonTableConfig.CommonNoteBiz(m_app);
     //    m_CommonNoteEntity = commonNoteBiz.GetDetailCommonNote(m_CommonNoteEntity.CommonNoteFlow);
     //}
     #endregion
     dateTimeAdd.DateTime = DateTime.Now;
 }
Exemplo n.º 12
0
        Dictionary <string, List <InCommonNoteItemEntity> > dicitemListDel     = new Dictionary <string, List <InCommonNoteItemEntity> >(); //删除的数据

        /// <summary>
        /// 构造方法
        /// edit by xlb 2013-02-01
        /// 加上了等待窗
        /// </summary>
        /// <param name="commonNoteEntity"></param>
        /// <param name="app"></param>
        public DayListForm(CommonNoteEntity commonNoteEntity, IEmrHost app)
        {
            m_WaitDialog            = new WaitDialogForm("正在打开" + "" + commonNoteEntity.CommonNoteName + "", "请稍后...");
            this.m_CommonNoteEntity = commonNoteEntity;
            this.m_app             = app;
            this.m_CommonNoteBiz   = new CommonNoteBiz(this.m_app);
            this.m_InCommonNoteBiz = new InCommonNoteBiz(this.m_app);
            InitializeComponent();
            #region ----------------已注销 by xlb 2013.02.04--------
            if (m_CommonNoteEntity.CommonNote_TabList == null)
            {
                CommonNoteBiz commonNoteBiz = new DrectSoft.Core.CommonTableConfig.CommonNoteBiz(m_app);
                m_CommonNoteEntity = commonNoteBiz.GetDetailCommonNote(m_CommonNoteEntity.CommonNoteFlow);
            }
            #endregion
            dateEdit1.DateTime = DateTime.Now;
        }
Exemplo n.º 13
0
        /// <summary>
        /// 打印指定列事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void printDocumentPrintNow_PrintPage(object sender, PrintPageEventArgs e)
        {
            try
            {
                if (m_printInCommonView == null ||
                    m_printInCommonView.PrintInCommonTabViewList1 == null)
                {
                    return;
                }
                if (m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList == null)
                {
                    m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = new List <PrintInCommonItemView>();
                }
                var PrintInCommonItemViewList = m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList;
                int allcount        = PrintInCommonItemViewList.Count;
                int PageRecordCount = iPrintNurse.PageRecordCount;                     //每张的行数
                int pageIndex       = (int)spinEditPage.Value - (int)speNum.Value + 1; //实际打印页码需要重新计算
                List <PrintInCommonItemView> printInCommonItemViewEven = new List <PrintInCommonItemView>();
                for (int j = (pageIndex - 1) * PageRecordCount; j < (pageIndex * PageRecordCount); j++)
                {
                    if (j < allcount)
                    {
                        PrintInCommonItemViewList[j].RowNum = j + 1;
                        printInCommonItemViewEven.Add(PrintInCommonItemViewList[j]);
                    }
                }
                InCommonNoteBiz.ConvertForDateTime(printInCommonItemViewEven);
                InCommonNoteBiz.SetRowEnd(printInCommonItemViewEven, m_printInCommonView.PrintFileName);
                RecordPrintView recordPrintView = ConvertPrintView(m_printInCommonView);
                recordPrintView.PrintInpatientView.ListCount = printInCommonItemViewEven.Count.ToString();

                int Addpage = Convert.ToInt32(speNum.Value);
                recordPrintView.PrintInpatientView.CurrPage = (pageIndex + Addpage - 1).ToString();

                recordPrintView.PrintInCommonItemViewList = printInCommonItemViewEven;
                iPrintNurse.GetPreview(recordPrintView, e.Graphics);
                e.HasMorePages = false;
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Exemplo n.º 14
0
 /// <summary>
 /// 右键删除事件
 /// xlb 2013-01-19
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barButtonItemDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         TreeListNode treeList = treeListInpat.FocusedNode;
         if (treeList != null && treeList.Tag != null && treeList.Tag is InCommonNoteEnmtity)
         {
             m_inCommonNote = treeList.Tag as InCommonNoteEnmtity;
         }
         else
         {
             barCheckItemDel.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
         }
         if (MyMessageBox.Show("您确定删除吗?", "提示", MyMessageBoxButtons.OkCancel) == DialogResult.Cancel)
         {
             return;
         }
         if (m_inCommonNoteBiz == null)
         {
             m_inCommonNoteBiz = new InCommonNoteBiz(m_app);
         }
         string message = "";
         //用来判断要删除的单据是否有记录,有则无法删除
         int count = m_inCommonNoteBiz.GetCommonItemCount(m_inCommonNote.InCommonNoteFlow);
         if (count != 0)
         {
             //throw new Exception("已被使用无法删除");
             MessageBox.Show("已被使用无法删除");
             return;
         }
         bool delResult = m_inCommonNoteBiz.DelInCommonNote(m_inCommonNote, ref message);
         if (delResult)
         {
             treeListInpat.DeleteNode(treeList);//删除节点
             MessageBox.Show("删除单据成功");
         }
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
Exemplo n.º 15
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);
     }
 }
Exemplo n.º 16
0
        ///// <summary>
        ///// 展开节点触发的事件
        ///// xlb 2013-01-29
        ///// 解决存在大量数据时一次加载引起的卡屏
        ///// </summary>
        ///// <param name="sender"></param>
        ///// <param name="e"></param>
        //private void treeListInpat_AfterExpand(object sender, DevExpress.XtraTreeList.NodeEventArgs e)
        //{
        //    try
        //    {
        //        //如果有子节点则展开
        //        if (e.Node.HasChildren)
        //        {
        //            e.Node.ExpandAll();
        //        }
        //        TreeListNode parentNode = e.Node;//以当前要展开的节点为父节点
        //        InPatientSim inpatient=new InPatientSim();
        //        if (e.Node.Tag is InPatientSim)
        //        {
        //            inpatient = e.Node.Tag as InPatientSim;
        //        }

        //        List<InCommonNoteEnmtity> inCommonNoteList = m_inCommonNoteBiz.GetSimInCommonNote(inpatient.NoofInpat.ToString());
        //        MakeTreeATwo(inCommonNoteList, parentNode);
        //    }
        //    catch (Exception ex)
        //    {
        //        MyMessageBox.Show(1, ex);
        //    }
        //}
        #endregion

        /// <summary>
        /// 右键新增事件
        /// xlb 2013-01-19
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItemAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                InPatientSim inpatient = null;
                TreeListNode node      = treeListInpat.FocusedNode; //父节点
                TreeListNode node2     = null;                      //子节点
                if (node != null && node.Tag != null && node.Tag is InPatientSim)
                {
                    inpatient = node.Tag as InPatientSim;
                }

                CommonChooseForm commonChooseForm = new Core.CommonTableConfig.CommonNoteUse.CommonChooseForm("护理单据模板选择", m_app);
                //窗体运行起始位置居中
                commonChooseForm.StartPosition = FormStartPosition.CenterScreen;

                if (commonChooseForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                InCommonNoteEnmtity inCommonNote = ConvertToByCommonNote(commonChooseForm.SelectCommonNoteEntity, inpatient);
                if (inCommonNote == null)
                {
                    return;
                }

                InCommonNoteBiz icbiz = new InCommonNoteBiz(m_app);
                icbiz.GetDetaliInCommonNote(ref inCommonNote);
                string createTIme  = DateUtil.getDateTime(inCommonNote.CreateDateTime, DateUtil.NORMAL_LONG);
                string commmonNote = "创建人:" + inCommonNote.CreateDoctorName + "|" + "时间:" + createTIme;
                node2     = treeListInpat.AppendNode(new object[] { inCommonNote.InCommonNoteName, "Leaf", commmonNote }, node);
                node2.Tag = inCommonNote;
                treeListInpat.FocusedNode = node2;//定位在新增子节点上
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
Exemplo n.º 17
0
        private void Save()
        {
            UCRecordDateTime uCRecordDateTime = scorlInfo.Controls["uCRecordDateTime"] as UCRecordDateTime;
            UCRecordDoctor   uCRecordDoctor   = scorlInfo.Controls["uCRecordDoctor"] as UCRecordDoctor;
            string           datestr          = uCRecordDateTime.GetDate();
            string           timestr          = uCRecordDateTime.GetTime();
            string           recordDoc        = uCRecordDoctor.GetDoc();
            string           message          = "";

            foreach (var item in scorlInfo.Controls)
            {
                if (item is ucLabText)
                {
                    bool getResult = (item as ucLabText).GetInCommonNoteItemSave(ref message);
                    if (getResult == false)
                    {
                        m_app.CustomMessageBox.MessageShow(message);
                        return;
                    }
                }
            }
            if (inCommonNoteBiz == null)
            {
                inCommonNoteBiz = new InCommonNoteBiz(m_app);
            }
            foreach (var item in m_InCommonNoteTab.InCommonNoteItemList)
            {
                item.RecordDate       = datestr;
                item.RecordTime       = timestr;
                item.RecordDoctorName = recordDoc;
                inCommonNoteBiz.SaveIncommonNoteItem(item, ref message);
            }
            DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存成功");
            inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
            m_InCommonNoteTab = m_inCommonNote.InCommonNoteTabList.Find(a => a.InCommonNote_Tab_Flow == m_InCommonNoteTab.InCommonNote_Tab_Flow);
            InitData();
        }
Exemplo n.º 18
0
 /// <summary>
 /// 将CommonNoeEntity->InCommonNoteEnmtity;
 /// xlb 2013-01-19
 /// </summary>
 /// <param name="commonNote"></param>
 /// <returns></returns>
 private InCommonNoteEnmtity ConvertToByCommonNote(CommonNoteEntity commonNote, InPatientSim inPatient)
 {
     try
     {
         //用来接收选择的模板的新模板名称
         string        commonNoteNames = commonNote.CommonNoteName == null ? "" : commonNote.CommonNoteName;
         CommonNoteBiz commonNoteBiz   = new CommonNoteBiz(m_app);
         commonNote = commonNoteBiz.GetDetailCommonNote(commonNote.CommonNoteFlow);
         commonNote.CommonNoteName = commonNoteNames;//模板名称修改
         InCommonNoteEnmtity inCommonNote    = InCommonNoteBiz.ConvertCommonToInCommon(commonNote);
         InCommonNoteBiz     incommonNoteBiz = new InCommonNoteBiz(m_app);
         DataTable           dtPatient       = incommonNoteBiz.GetInpatient(inPatient.NoofInpat.ToString());
         inCommonNote.CurrDepartID   = dtPatient.Rows[0]["OUTHOSDEPT"].ToString();
         inCommonNote.CurrDepartName = dtPatient.Rows[0]["DEPARTNAME"].ToString();
         inCommonNote.CurrWardID     = dtPatient.Rows[0]["OUTHOSWARD"].ToString();
         inCommonNote.CurrWardName   = dtPatient.Rows[0]["WARDNAME"].ToString();
         inCommonNote.NoofInpatient  = inPatient.NoofInpat.ToString();
         inCommonNote.InPatientName  = dtPatient.Rows[0]["NAME"].ToString();
         inCommonNote.CreateDateTime = DateTime.Now.ToString();
         inCommonNote.Valide         = "1";
         string message    = "";
         bool   saveResult = incommonNoteBiz.SaveInCommomNoteAll(inCommonNote, ref message);
         if (saveResult)
         {
             return(inCommonNote);
         }
         else
         {
             MessageBox.Show("创建单据失败");
             return(null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 19
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                int     index   = gridView1.FocusedRowHandle;
                DataRow dataRow = gridView1.GetFocusedDataRow();
                if (dataRow == null)
                {
                    m_app.CustomMessageBox.MessageShow("未选中要删除的记录");
                    return;
                }
                DialogResult diaResult = m_app.CustomMessageBox.MessageShow("确定要删除选中数据吗?", DrectSoft.Core.CustomMessageBoxKind.QuestionYesNo);
                if (diaResult == DialogResult.No)
                {
                    return;
                }
                string groupflow = dataRow["groupFlow"].ToString();
                List <InCommonNoteItemEntity> inCommonNoteItemEntityList = dicitemList[groupflow];

                if (m_CommonNoteEntity.UsingPicSign == "1" && inCommonNoteItemEntityList[0].RecordDoctorId != m_app.User.DoctorId)
                {
                    m_app.CustomMessageBox.MessageShow("只有记录者才可删除该记录");
                    return;
                }


                //如果改变的集合中有改数据 移除删除的数据
                if (dicitemListChanged.ContainsKey(groupflow))
                {
                    dicitemListChanged.Remove(groupflow);
                }

                //直接从数据库中删除
                string message    = "";
                string hisrowflow = Guid.NewGuid().ToString();
                foreach (var item in inCommonNoteItemEntityList)
                {
                    if (string.IsNullOrEmpty(item.InCommonNote_Item_Flow))
                    {
                        continue;
                    }
                    item.Valide = "0";
                    bool itemresult = m_InCommonNoteBiz.SaveIncommonNoteItem(item, ref message);
                    InCommonNoteBiz.AddInCommonColHistory(item, hisrowflow);
                }

                InCommonNoteBiz.AddInCommonRowHistory(inCommonNoteItemEntityList[0], hisrowflow);


                //将删除的集合添加到删除的集合中
                //if (!dicitemListDel.ContainsKey(groupflow))
                //{
                //    dicitemListDel.Add(groupflow, inCommonNoteItemEntityList);
                //}

                //m_InCommonNoteTab中的项目中移除删除的项目
                foreach (InCommonNoteItemEntity item in inCommonNoteItemEntityList)
                {
                    InCommonNoteItemEntityListAll.Remove(item);
                }
                BindDate();
                txtSearch_EditValueChanged(null, null);
                gridView1.MoveBy(index);
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.StackTrace);
            }
        }
Exemplo n.º 20
0
        private void gvInpatient_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                var gvInpatient = (sender as DevExpress.XtraGrid.Views.Grid.GridView);
                if (gvInpatient == null)
                {
                    return;
                }
                m_drInpatient = gvInpatient.GetFocusedDataRow();
                if (m_drInpatient == null || string.IsNullOrEmpty(m_drInpatient["NOOFINPAT"].ToString()))
                {
                    return;
                }


                //未保存数据提示
                if (pcJLD.Controls != null && pcJLD.Controls.Count != 0)
                {
                    UCInCommonNote uCInCommonNote = (pcJLD.Controls[0] as UCInCommonNote);
                    if (uCInCommonNote != null)
                    {
                        bool HasSave = uCInCommonNote.HasInfoSave();
                        if (HasSave == true)
                        {
                            DialogResult diaResult = DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("存在数据未保存,确定退出吗?", "提示", DrectSoft.Common.Ctrs.DLG.MyMessageBoxButtons.YesNo);
                            if (diaResult == DialogResult.No)
                            {
                                return;
                            }
                        }
                    }
                }

                m_noofInpat = m_drInpatient["NOOFINPAT"].ToString();
                InCommonNoteEnmtity        MyinCommonNoteEnmtity = null;
                InCommonNoteBiz            inCommonNoteBiz       = new InCommonNoteBiz(m_app);
                List <InCommonNoteEnmtity> inCommonNoteListAll   = inCommonNoteBiz.GetSimInCommonNote(this.m_noofInpat);
                List <InCommonNoteEnmtity> inCommonNoteList      = inCommonNoteListAll.FindAll(a => a.CommonNoteFlow == m_commonNoteEntity.CommonNoteFlow) as List <InCommonNoteEnmtity>;
                if (inCommonNoteList != null && inCommonNoteList.Count >= 2)
                {
                    InCommListForm inCommListForm = new InCommListForm(inCommonNoteList, m_app, m_noofInpat, m_commonNoteEntity);
                    DialogResult   diaResult      = inCommListForm.ShowDialog();
                    if (diaResult == DialogResult.OK)
                    {
                        MyinCommonNoteEnmtity = inCommListForm.MyInCommonNoteEnmtity;
                        AddUCInCommonNote(MyinCommonNoteEnmtity);
                    }
                    else
                    {
                        return;
                    }
                }
                else if (inCommonNoteList == null || inCommonNoteList.Count == 0)
                {
                    MyinCommonNoteEnmtity = ConverBycommonNote(m_commonNoteEntity);
                    if (MyinCommonNoteEnmtity == null)
                    {
                        return;
                    }
                    AddUCInCommonNote(MyinCommonNoteEnmtity);
                }
                else
                {
                    MyinCommonNoteEnmtity = inCommonNoteList[0];
                    AddUCInCommonNote(MyinCommonNoteEnmtity);
                }
                lblJLDName.Text = m_drInpatient["NAME"].ToString() + ":" + MyinCommonNoteEnmtity.InCommonNoteName;
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.StackTrace);
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        private void InitForm()
        {
            WaitDialogForm waitDialog = new WaitDialogForm("正在获取数据……", "请稍等。");

            try
            {
                if (inCommonNoteBiz == null)
                {
                    inCommonNoteBiz = new InCommonNoteBiz(m_app);
                }
                //xll 在初始化列表界面的时候获取值
                //inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
                inCommonNoteBiz.GetIncommTab(ref m_inCommonNote);
                waitDialog.Hide();
                waitDialog.Close();
                //判断选择节点是否被删除,删除则给出提示
                if (m_inCommonNote == null || m_inCommonNote.InCommonNoteFlow == null)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该单据已被他人删除");
                    return;
                }
                //int countItem=  inCommonNoteBiz.GetCommonItemCount(m_inCommonNote.InCommonNoteFlow);
                foreach (var item in m_inCommonNote.InCommonNoteTabList)
                {
                    CommonNote_TabEntity commonNote_TabEntity = null;
                    foreach (var itemTab in m_commonNoteEntity.CommonNote_TabList)
                    {
                        if (itemTab.CommonNote_Tab_Flow == item.CommonNote_Tab_Flow)
                        {
                            commonNote_TabEntity = itemTab;
                            break;
                        }
                    }
                    if (commonNote_TabEntity == null)
                    {
                        continue;
                    }
                    XtraTabPage tabPage = new XtraTabPage();
                    tabPage.Tag  = item;
                    tabPage.Text = item.CommonNoteTabName;
                    if (item.ShowType == "表格")
                    {
                        UCIncommonNoteTab UCIncommonNoteTab = new UCIncommonNoteTab(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(UCIncommonNoteTab);
                        UCIncommonNoteTab.Dock = DockStyle.Fill;
                    }
                    else
                    {
                        UCInCommonTabSingle ucInCommonTabSingle = new UCInCommonTabSingle(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(ucInCommonTabSingle);
                        ucInCommonTabSingle.Dock = DockStyle.Fill;
                    }
                    tabcontrol.TabPages.Add(tabPage);
                }
                tabcontrol.SelectedTabPageIndex = 1;
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                throw ex;
            }
        }
Exemplo n.º 22
0
        public void ConverToDuoRow(PrintInCommonView printInCommonView)
        {
            try
            {
                List <PrintInCommonItemView> printInCommonItemViewListOld = printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList;
                if (printInCommonItemViewListOld == null)
                {
                    return;
                }
                Dictionary <string, ColmonXMLEntity> dicwordcounts = InCommonNoteBiz.GetReportxmlwords(printInCommonView);  //xml中属性 和最大字符数
                if (dicwordcounts == null || dicwordcounts.Count == 0)
                {
                    return;
                }
                List <PrintInCommonItemView> printInCommonItemViewListOut = new List <PrintInCommonItemView>(); //存放处理好的对象
                List <PrintInCommonItemView> printInCommonItemViewListNew = new List <PrintInCommonItemView>();

                Dictionary <string, List <PrintInCommonItemView> > dicIncommList = new Dictionary <string, List <PrintInCommonItemView> >();

                //将datetime时间相同的分组
                for (int i = 0; i < printInCommonItemViewListOld.Count; i++)
                {
                    if (!dicIncommList.ContainsKey(printInCommonItemViewListOld[i].DateTimeShow))
                    {
                        dicIncommList.Add(printInCommonItemViewListOld[i].DateTimeShow, new List <PrintInCommonItemView>());
                    }
                    dicIncommList[printInCommonItemViewListOld[i].DateTimeShow].Add(printInCommonItemViewListOld[i]);
                }


                foreach (List <PrintInCommonItemView> incommItemList in dicIncommList.Values)
                {
                    #region 处理数据
                    printInCommonItemViewListNew = incommItemList;
                    int maxrow = -1;                                                             //用于获取一个对象中被分成的最大行数
                    Dictionary <string, string> dicNeedRows = new Dictionary <string, string>(); //需要换行的列 值
                    foreach (var item in dicwordcounts)
                    {
                        string valueStr = "";
                        if (item.Value == null)
                        {
                            break;
                        }
                        string proName = item.Key;  //属性名

                        foreach (var inCommonItem in printInCommonItemViewListNew)
                        {
                            PropertyInfo property = inCommonItem.GetType().GetProperty(proName); //获取该对象的该属性
                            if (property != null)
                            {
                                object valueobj = property.GetValue(inCommonItem, null);
                                if (valueobj != null)
                                {
                                    valueStr += valueobj.ToString();
                                }
                                property.SetValue(inCommonItem, "", null);
                            }
                        }
                        //xll 20130228 伤处字符中的/r 回车键
                        //valueStr = valueStr.Replace("\n", "");

                        dicNeedRows.Add(proName, valueStr);
                        int zheshu = GetNeedRows(valueStr, item.Value).Count;
                        if (zheshu > maxrow)
                        {
                            maxrow = zheshu;
                        }
                    }   //获得需要换行的属性和值的集合 并获得需要的最大行数


                    //处理数据 最终的分行处理
                    for (int j = 0; j < maxrow; j++)
                    {
                        foreach (var itemneed in dicNeedRows)  //对各列进行截取
                        {
                            string proName = itemneed.Key;
                            if (j >= printInCommonItemViewListNew.Count)
                            {
                                PrintInCommonItemView printInCommonItemView = new CommonNoteUse.PrintInCommonItemView();
                                printInCommonItemView.Date                = printInCommonItemViewListNew[0].Date;
                                printInCommonItemView.Time                = printInCommonItemViewListNew[0].Time;
                                printInCommonItemView.DateTimeShow        = printInCommonItemViewListNew[0].DateTimeShow;
                                printInCommonItemView.RecordDoctorId      = printInCommonItemViewListNew[0].RecordDoctorId;
                                printInCommonItemView.RecordDoctorName    = printInCommonItemViewListNew[0].RecordDoctorName;
                                printInCommonItemView.RecordDoctorImg     = printInCommonItemViewListNew[0].RecordDoctorImg;
                                printInCommonItemView.RecordDoctorImgbyte = printInCommonItemViewListNew[0].RecordDoctorImgbyte;
                                printInCommonItemViewListNew.Add(printInCommonItemView);
                            }

                            PropertyInfo property      = printInCommonItemViewListNew[j].GetType().GetProperty(proName); //获取该对象的该属性
                            string       rowindexvalue = GetIndexStr(j, GetNeedRows(itemneed.Value, dicwordcounts[proName]));
                            property.SetValue(printInCommonItemViewListNew[j], rowindexvalue, null);
                        }
                    }
                    #endregion
                    //将处理好的对象集合存放到最新的数据集中
                    printInCommonItemViewListOut.AddRange(printInCommonItemViewListNew);
                }
                printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = printInCommonItemViewListOut;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 23
0
 //初始化界面的 后台
 private void InitData()
 {
     inCommonNoteBiz.GetDetaliInCommonNoteByDay(ref m_inCommonNote, ref m_InCommonNoteTab, "", "");
     if (m_InCommonNoteTab.InCommonNoteItemList == null || m_InCommonNoteTab.InCommonNoteItemList.Count == 0)
     {
         m_InCommonNoteTab.InCommonNoteItemList = InCommonNoteBiz.ConvertItem(m_commonNote_TabEntity);
         foreach (var item in m_InCommonNoteTab.InCommonNoteItemList)
         {
             item.InCommonNote_Tab_Flow = m_InCommonNoteTab.InCommonNote_Tab_Flow;
             item.InCommonNoteFlow      = m_InCommonNoteTab.InCommonNoteFlow;
             item.CreateDoctorID        = m_app.User.DoctorId;
             item.CreateDoctorName      = m_app.User.DoctorName;
             //item.InCommonNote_Item_Flow = Guid.NewGuid().ToString();
             item.RecordDate       = DateUtil.getDateTime(System.DateTime.Now.ToString(), DateUtil.NORMAL_SHORT);
             item.RecordTime       = DateUtil.getDateTime(System.DateTime.Now.ToString(), DateUtil.NORMAL_LONG).Substring(11, 8);
             item.RecordDoctorName = m_app.User.DoctorName;
         }
     }
     scorlInfo.Controls.Clear();
     for (int i = 0; i < m_InCommonNoteTab.InCommonNoteItemList.Count; i++)
     {
         List <InCommonNoteItemEntity> inCommonNoteItemEntityList = m_InCommonNoteTab.InCommonNoteItemList;
         if (i == 0)
         {
             //记录时间
             UCRecordDateTime uCRecordDateTime = new UCRecordDateTime(inCommonNoteItemEntityList[i].RecordDate, inCommonNoteItemEntityList[i].RecordTime);
             point = new Point(0, 0);
             uCRecordDateTime.Location = point;
             uCRecordDateTime.Name     = "uCRecordDateTime";
             scorlInfo.Controls.Add(uCRecordDateTime);
         }
         if (inCommonNoteItemEntityList[i].DataElement == null)
         {
             DataElemntBiz dataElemntBiz = new CommonTableConfig.DataElemntBiz(m_app);
             var           dateelement   = dataElemntBiz.GetDataElement(inCommonNoteItemEntityList[i].DataElementFlow);
             inCommonNoteItemEntityList[i].DataElement = dateelement;
         }
         //项目
         ucLabText ucLabText = new ucLabText(inCommonNoteItemEntityList[i]);
         ucLabText.Height = 40;
         ucLabText.Width  = 319;
         int row   = (i + 1) / 3;
         int colmn = (i + 1) % 3;
         point.X            = ucLabText.Width * colmn;
         point.Y            = ucLabText.Height * row;
         ucLabText.Location = point;
         scorlInfo.Controls.Add(ucLabText);
         if (i == inCommonNoteItemEntityList.Count - 1)
         {
             // 记录人
             UCRecordDoctor uCRecordDoctor = new UCRecordDoctor(inCommonNoteItemEntityList[i].RecordDoctorName);
             uCRecordDoctor.Height = 40;
             uCRecordDoctor.Width  = 319;
             uCRecordDoctor.Name   = "uCRecordDoctor";
             int row1   = (i + 2) / 3;
             int colmn1 = (i + 2) % 3;
             point.X = uCRecordDoctor.Width * colmn1;
             point.Y = uCRecordDoctor.Height * row1;
             uCRecordDoctor.Location = point;
             scorlInfo.Controls.Add(uCRecordDoctor);
         }
     }
 }
Exemplo n.º 24
0
        /// <summary>
        /// 打印表格时一行不过换行显示
        /// </summary>
        /// <param name="printInCommonView"></param>
        private void ConvertForChangeRow(PrintInCommonView printInCommonView)
        {
            List <PrintInCommonItemView> printInCommonItemViewListOld = printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList;

            if (printInCommonItemViewListOld == null)
            {
                return;
            }
            List <PrintInCommonItemView>         printInCommonItemViewListNew = new List <PrintInCommonItemView>();
            Dictionary <string, ColmonXMLEntity> dicwordcounts = InCommonNoteBiz.GetReportxmlwords(printInCommonView);  //xml中属性 和最大字符数

            if (dicwordcounts == null || dicwordcounts.Count == 0)
            {
                return;
            }
            foreach (var inCommonItem in printInCommonItemViewListOld)
            {
                int maxrow = -1;                                                             //用于获取一个对象中被分成的最大行数
                Dictionary <string, string> dicNeedRows = new Dictionary <string, string>(); //需要换行的列 值
                foreach (var item in dicwordcounts)
                {
                    if (item.Value == null)
                    {
                        break;
                    }
                    string       proName  = item.Key;                                    //属性名
                    PropertyInfo property = inCommonItem.GetType().GetProperty(proName); //获取该对象的该属性
                    if (property != null)
                    {
                        string valuestr = "";
                        object valueobj = property.GetValue(inCommonItem, null);
                        if (valueobj != null)
                        {
                            valuestr = valueobj.ToString();
                        }
                        dicNeedRows.Add(proName, valuestr);
                        int zheshu = GetNeedRows(valuestr, item.Value).Count;
                        if (zheshu > maxrow)
                        {
                            maxrow = zheshu;
                        }
                    }
                }
                if (maxrow == -1)
                {
                    continue;
                }
                if (maxrow == 1 || maxrow == 0)
                {
                    PrintInCommonItemView printInCommonItemView = inCommonItem;
                    printInCommonItemViewListNew.Add(printInCommonItemView);
                }
                else
                {
                    List <PrintInCommonItemView> printInCommonItemOnemore = new List <PrintInCommonItemView>();  //一个正常行最终变成的多行
                    for (int i = 0; i < maxrow; i++)
                    {
                        PrintInCommonItemView printInCommonItemView;
                        if (i == 0)
                        {
                            printInCommonItemView = inCommonItem;
                        }
                        else
                        {
                            printInCommonItemView = new PrintInCommonItemView();
                        }
                        foreach (var itemneed in dicNeedRows)  //对各列进行截取
                        {
                            string       proName       = itemneed.Key;
                            PropertyInfo property      = printInCommonItemView.GetType().GetProperty(proName); //获取该对象的该属性
                            string       rowindexvalue = GetIndexStr(i, GetNeedRows(itemneed.Value, dicwordcounts[proName]));
                            property.SetValue(printInCommonItemView, rowindexvalue, null);
                        }
                        printInCommonItemOnemore.Add(printInCommonItemView);
                    }
                    printInCommonItemOnemore[printInCommonItemOnemore.Count - 1].RecordDoctorName = printInCommonItemOnemore[0].RecordDoctorName;
                    printInCommonItemOnemore[printInCommonItemOnemore.Count - 1].RecordDoctorId   = printInCommonItemOnemore[0].RecordDoctorId;
                    printInCommonItemOnemore[printInCommonItemOnemore.Count - 1].RecordDoctorImg  = printInCommonItemOnemore[0].RecordDoctorImg;
                    printInCommonItemOnemore[0].RecordDoctorName = "";
                    printInCommonItemOnemore[0].RecordDoctorId   = "";
                    printInCommonItemOnemore[0].RecordDoctorImg  = "";
                    printInCommonItemViewListNew.AddRange(printInCommonItemOnemore);
                }
            }
            printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = printInCommonItemViewListNew;
        }
Exemplo n.º 25
0
        /// <summary>
        /// 将数据对象转诊打印对象 用于绑定到控件进行打印预览
        /// </summary>
        /// <returns></returns>
        private PrintInCommonView ConvertPrintEntity()
        {
            //inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
            PrintInCommonView printInCommonView = new CommonNoteUse.PrintInCommonView();

            printInCommonView.PrintFileName    = m_inCommonNote.PrinteModelName;
            printInCommonView.IncommonNoteflow = m_inCommonNote.InCommonNoteFlow;
            printInCommonView.RecordName       = m_commonNoteEntity.CommonNoteName;
            //病人的基本信息构造
            if (inCommonNoteBiz == null)
            {
                inCommonNoteBiz = new InCommonNoteBiz(m_app);
            }
            DataTable          inpatientDt        = inCommonNoteBiz.GetInpatient(m_inCommonNote.NoofInpatient);
            PrintInpatientView printInpatientView = new CommonNoteUse.PrintInpatientView();

            printInpatientView.HospitalName    = m_app.CurrentHospitalInfo.Name;
            printInpatientView.SubHospitalName = m_app.CurrentHospitalInfo.Subname;
            printInpatientView.AdmitDiagnosis  = inpatientDt.Rows[0]["DIAGNOSISNAME"].ToString();
            printInpatientView.Depart          = m_inCommonNote.CurrDepartName;
            printInpatientView.InBedNo         = inpatientDt.Rows[0]["OUTBED"].ToString();
            printInpatientView.RecordName      = m_inCommonNote.InCommonNoteName;
            if (inpatientDt.Rows[0]["INWARDDATE"].ToString().Length >= 10)
            {
                printInpatientView.InDateTime = inpatientDt.Rows[0]["INWARDDATE"].ToString().Substring(0, 10);
            }
            printInpatientView.InNo              = inpatientDt.Rows[0]["PATID"].ToString();
            printInpatientView.OutNo             = inpatientDt.Rows[0]["NOOFCLINIC"].ToString();
            printInpatientView.PatId             = inpatientDt.Rows[0]["PATNOOFHIS"].ToString();
            printInpatientView.InpatientAge      = inpatientDt.Rows[0]["AGESTR"].ToString();
            printInpatientView.InpatientName     = inpatientDt.Rows[0]["NAME"].ToString();
            printInpatientView.Sex               = inpatientDt.Rows[0]["SEX"].ToString();
            printInpatientView.Ward              = m_inCommonNote.CurrWardName;
            printInCommonView.PrintInpatientView = printInpatientView;

            if (m_inCommonNote.InCommonNoteTabList == null)
            {
                return(printInCommonView);
            }
            for (int i = 0; i < m_inCommonNote.InCommonNoteTabList.Count; i++)
            {
                CommonNote_TabEntity commonNote_TabEntity = null;
                foreach (var itemTab in m_commonNoteEntity.CommonNote_TabList)
                {
                    if (itemTab.CommonNote_Tab_Flow == m_inCommonNote.InCommonNoteTabList[i].CommonNote_Tab_Flow)
                    {
                        commonNote_TabEntity = itemTab;
                        break;
                    }
                }
                PrintInCommonTabView printInCommonTabView = new CommonNoteUse.PrintInCommonTabView();  //主要目的是给这个对象复制
                Dictionary <string, List <InCommonNoteItemEntity> > dicitemList;
                List <string> strNames = InCommonNoteBiz.ConvertInCommonTabToPrint(m_inCommonNote.InCommonNoteTabList[i], printInCommonTabView, out dicitemList, commonNote_TabEntity, m_app, m_inCommonNote);

                string proName = "PrintInCommonTabViewList";
                proName = proName + (i + 1);
                PropertyInfo property = printInCommonView.GetType().GetProperty(proName);
                if (property != null)
                {
                    property.SetValue(printInCommonView, printInCommonTabView, null);
                }

                if (i == 0 && m_inCommonNote.InCommonNoteTabList[i] != null)
                {
                    ConverToDuoRow(printInCommonView);
                    //ConvertForDuoLie(printInCommonView);


                    IPrintNurse iPrintNurse = AbstractorFactry.GetNurseRecord(printInCommonView.PrintFileName);
                    if (iPrintNurse != null)
                    {
                        iPrintNurse.commonNoteCountEntity = CommonNoteBiz.GetCommonNoteCount(m_commonNoteEntity.CommonNoteFlow);

                        printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = iPrintNurse.JiSuanZongLiang(printInCommonView);
                    }
                    else
                    {
                        if (printInCommonView != null &&
                            printInCommonView.PrintInCommonTabViewList1 != null &&
                            printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList != null)
                        {
                            InCommonNoteBiz.ConvertForDateTime(printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList);
                            InCommonNoteBiz.SetRowEnd(printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList, printInCommonView.PrintFileName);
                        }
                    }



                    //xll 2013-01-12 处理相同时间数据
                    //ConvertForDateTime(printInCommonView);
                }
            }
            return(printInCommonView);
        }
Exemplo n.º 26
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string messageAll = "";
                bool   hasSave    = true;

                //保存修改的数据
                foreach (List <InCommonNoteItemEntity> itemList in dicitemListChanged.Values)
                {
                    string hisrowflow = Guid.NewGuid().ToString();
                    foreach (var item in itemList)
                    {
                        string message    = "";
                        bool   itemresult = m_InCommonNoteBiz.SaveIncommonNoteItem(item, ref message);
                        if (!itemresult)
                        {
                            hasSave    = false;
                            messageAll = message;
                        }
                        InCommonNoteBiz.AddInCommonColHistory(item, hisrowflow);
                    }
                    InCommonNoteBiz.AddInCommonRowHistory(itemList[0], hisrowflow);
                }
                if (hasSave == false)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存失败!" + messageAll, 1);
                    return;
                }
                //保存删除的数据
                //foreach (var itemDelList in dicitemListDel.Values)
                //{
                //    foreach (var item in itemDelList)
                //    {
                //        string message = "";
                //        if (string.IsNullOrEmpty(item.InCommonNote_Item_Flow)) continue;
                //        item.Valide = "0";
                //        bool itemresult = m_InCommonNoteBiz.SaveIncommonNoteItem(item, ref message);
                //        if (!itemresult)
                //        {
                //            hasSave = false;
                //            messageAll = message;
                //        }
                //    }
                //}

                if (hasSave == false)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存失败!" + messageAll, 1);
                }
                else
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存成功!", 1);
                    GetData();
                    txtSearch_EditValueChanged(null, null);
                    dicitemListChanged = new Dictionary <string, List <InCommonNoteItemEntity> >();
                    dicitemListDel     = new Dictionary <string, List <InCommonNoteItemEntity> >();
                }
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.StackTrace);
            }
        }