Exemple #1
0
        private XSpreadPanel CreateHerbalDrugPresPanel(OrdPresDTO presDto)
        {
            var drugs = this.model.GetPresDrugDataSource(presDto);

            if (drugs == null || drugs.Count == 0)
            {
                return(null);
            }

            XSpreadPanel panel = new XSpreadPanel();

            panel.PanelHeight = drugs.Count;
            int n = spreadView.Width < 147 ? 1 : spreadView.Width / 147;

            panel.Size      = new Size(spreadView.Width, (drugs.Count / n + 1) * 42 + 33);
            panel.TitleText = this.model.GetHerbalDrugCaption(presDto);
            HerBalMedicineCtr herbCrt = new HerBalMedicineCtr()
            {
                MedicineName = "Name_mm",
                DosageName   = "Quan_med",
                UsgeName     = "Name_boildes",
                UnitName     = "Name_unit_med",
                HerbalWidth  = 99,
                HerbalHeight = 35,
                DataSource   = drugs
            };

            herbCrt.SizeChanged -= new EventHandler(herbCrt_SizeChanged);
            herbCrt.SizeChanged += new EventHandler(herbCrt_SizeChanged);
            panel.Panel          = herbCrt;

            return(panel);
        }
        //获取中药处方相关信息
        public string GetHerbalDrugCaption(OrdPresDTO presDto)
        {
            string strCaption = GetWestDrugCaption(presDto);

            if (strCaption.Length > 0)
            {
                strCaption += String.Format(" 草药剂数:{0}", presDto.Presdrugs.Count);
            }
            return(strCaption);
        }
Exemple #3
0
        private void PrintChooseView_Load(object sender, EventArgs e)
        {
            this.xapFormControl.FormCreated += xapFormControl_FormCreated;
            this.xapFormControl.ModelFilled += xapFormControl_ModelFilled;
            this.xapFormControl.RefFilter   += xapFormControl_RefFilter;
            this.xapFormControl.RefResult   += xapFormControl_RefResult;

            this.datasource = new OrdPresDTO();
            this.lstSheetTp = new List <string>();

            this.OnInit();
        }
 //获取西药处方相关信息
 public string GetWestDrugCaption(OrdPresDTO presDto)
 {
     if (presDto != null)
     {
         string strCaption = String.Format(" 处方号:{0}", presDto.Code);
         strCaption += String.Format("  处方类型:{0}", presDto.Name_prestp);
         strCaption += String.Format("  金额:{0}元", getPressItemsTotalPrice(presDto));
         strCaption += String.Format("  取药地点:{0}", presDto.Name_dep_mp);
         strCaption += String.Format("  医生:{0}", presDto.Name_emp_or);
         return(strCaption);
     }
     return("");
 }
        public XapDataList <PresDrugDTO> GetPresDrugDataSource(OrdPresDTO presDto)
        {
            if (presDto == null)
            {
                return(null);
            }
            XapDataList <PresDrugDTO> items = new XapDataList <PresDrugDTO>();

            foreach (PresDrugDTO item in presDto.Presdrugs)
            {
                items.Add(item);
            }
            return(items);
        }
        private XapDataList <PresDrugDTO> FromOrdPresDTO(OrdPresDTO ordPress)
        {
            if (ordPress == null)
            {
                return(null);
            }
            XapDataList <PresDrugDTO> items = new XapDataList <PresDrugDTO>();

            foreach (PresDrugDTO item in ordPress.Presdrugs)
            {
                items.Add(item);
            }
            return(items);
        }
        private Double getPressItemsTotalPrice(OrdPresDTO opd)
        {
            if (null == opd)
            {
                return(0);
            }
            Double totalPrice = 0;

            foreach (PresDrugDTO drug in opd.Presdrugs)
            {
                if (null != drug.Quan_cur && drug.Price != null)
                {
                    totalPrice += drug.Quan_cur.Value * drug.Price.Value;
                }
            }
            return(totalPrice);
        }
Exemple #8
0
        /// <summary>
        /// 创建药品处方面板
        /// </summary>
        /// <param name="presDto"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <returns></returns>
        private XSpreadPanel CreateWestDrugPresPanel(OrdPresDTO presDto)
        {
            var drugs = this.model.GetPresDrugDataSource(presDto);

            if (drugs == null || drugs.Count == 0)
            {
                return(null);
            }

            XSpreadPanel panel = new XSpreadPanel();

            panel.TitleText   = this.model.GetWestDrugCaption(presDto);
            panel.Panel       = this.CreatePresDrugFormGrid(drugs);
            panel.PanelHeight = drugs.Count * (xap.cli.sdk.common.RelativeUIParam.RELATIVERATIO > xap.cli.sdk.common.RelativeUIParam.TEMPLETECHANGEDRATIO ? 30 : 26) + 2;
            panel.Panel.Size  = new Size(spreadView.Width, panel.PanelHeight);//大小屏分辨率

            if ("Y".Equals(model.DicPrestp[presDto.Sd_prestp].Ctrl1))
            {
                panel.TitleBackColor = Color.FromArgb(236, 152, 186);
                panel.IsChangedSkin  = false;
            }

            return(panel);
        }
 public XapDataList <PresDrugDTO> GetPresDrugDataSource(OrdPresDTO presDto)
 {
     return(FromOrdPresDTO(presDto));
 }