/// <summary>
 /// 供应商报表
 /// </summary>
 /// <param name="printCondition">进销存报表头</param>
 /// <param name="orderDt">进销存报表明细</param>
 /// <param name="path">报表文件路径</param>
 public override void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path)
 {
     try
     {
         if (orderDt != null)
         {
             if (orderDt.Rows.Count > 0)
             {
                 _printOrder = orderDt;
                 report      = new grproLib.GridppReport();
                 report.LoadFromFile(path);
                 report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                 report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                 report.ParameterByName("btime").AsString        = printCondition.actYear;
                 report.ParameterByName("etime").AsString        = printCondition.actMonth;
                 report.ParameterByName("Printer").AsString      = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetUserName(printCondition.userId);
                 report.PrintPreview(false);
             }
         }
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Beispiel #2
0
        /// <summary>
        /// 打印明细账报表
        /// </summary>
        /// <param name="printCondition">报表头</param>
        /// <param name="orderDt">报表明细</param>
        /// <param name="path">报表文件路径</param>
        public override void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path)
        {
            if (printCondition == null || orderDt == null)
            {
                return;
            }
            YP_AccountCondition actCondition = (YP_AccountCondition)printCondition;

            if (orderDt.Rows.Count > 0)
            {
                _printOrder = orderDt;
                report      = new grproLib.GridppReport();
                report.LoadFromFile(path);
                report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                report.ParameterByName("AccountYear").AsString  = actCondition.actYear;
                report.ParameterByName("AccountMonth").AsString = actCondition.actMonth;
                report.ParameterByName("DrugName").AsString     = actCondition.drugName;
                report.ParameterByName("ProductName").AsString  = actCondition.productName;
                report.ParameterByName("BeginNum").AsString     = actCondition.beginNum;
                report.ParameterByName("BeginFee").AsString     = actCondition.begingFee;
                report.ParameterByName("EndNum").AsString       = actCondition.endNum;
                report.ParameterByName("EndFee").AsString       = actCondition.endFee;
                report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                report.PrintPreview(false);
            }
        }
Beispiel #3
0
 public override void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path)
 {
     throw new NotImplementedException();
 }
Beispiel #4
0
        /// <summary>
        /// 打印摆药单据
        /// </summary>
        /// <param name="printCondition">打印头信息</param>
        /// <param name="orderDt">打印明细</param>
        /// <param name="path">报表路径</param>
        public override void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path)
        {
            if (orderDt == null)
            {
                return;
            }
            if (orderDt.Rows.Count > 0)
            {
                HIS.Interface.IZY_Data zyInterFace = new HIS.Interface.ZY_Data();
                _printOrder = new DataTable();
                DateTime currentTime = XcDate.ServerDateTime;
                _printOrder.Columns.Add("OrderContents", Type.GetType("System.String"));
                _printOrder.Columns.Add("PatName", Type.GetType("System.String"));
                _printOrder.Columns.Add("PatAge", Type.GetType("System.String"));
                _printOrder.Columns.Add("BedNo", Type.GetType("System.String"));
                _printOrder.Columns.Add("OrderId", Type.GetType("System.Int32"));
                _printOrder.Columns.Add("ChargeDate", Type.GetType("System.DateTime"));
                _printOrder.Columns.Add("UnitName", Type.GetType("System.String"));
                _printOrder.Columns.Add("CureNo", Type.GetType("System.String"));
                _printOrder.Columns.Add("DrugNum", Type.GetType("System.Decimal"));
                _printOrder.Columns.Add("PresDeptName", Type.GetType("System.String"));
                _printOrder.Columns.Add("SortNum", Type.GetType("System.Int32"));
                _printOrder.PrimaryKey = new DataColumn[] { _printOrder.Columns["OrderId"], _printOrder.Columns["CureNo"] };
                //如果只打口服摆药单
                if (printCondition.drugType == "口服药")
                {
                    for (int index = 0; index < orderDt.Rows.Count; index++)
                    {
                        //按医嘱ID获取用法对应执行单表
                        DataTable useTypeDt = zyInterFace.GetUseType(Convert.ToInt32(orderDt.Rows[index]["docorderid"]));                        if (useTypeDt != null)
                        {
                            //如果是口服药
                            if (useTypeDt.Select("TYPE_NAME='服药单'").Count() == 0)
                            {
                                orderDt.Rows[index]["ISDISPENSE"] = 0;
                            }
                        }
                    }
                }
                for (int index = 0; index < orderDt.Rows.Count; index++)
                {
                    DataRow currentRow = orderDt.Rows[index];
                    if (currentRow["ISDISPENSE"] == DBNull.Value)
                    {
                        continue;
                    }
                    if (Convert.ToInt32(currentRow["ISDISPENSE"]) == 0)
                    {
                        continue;
                    }
                    DataRow findRow = _printOrder.Rows.Find(new object[] { currentRow["docorderid"], currentRow["cureno"] });
                    if (findRow != null)
                    {
                        findRow["DrugNum"] = Convert.ToDecimal(findRow["DrugNum"])
                                             + Convert.ToDecimal(currentRow["DrugNum"]);
                    }
                    else
                    {
                        DataRow newRow = _printOrder.NewRow();
                        newRow["OrderContents"] = zyInterFace.GetDocOrderInfo(Convert.ToInt32(currentRow["docorderid"]));
                        newRow["PatName"]       = currentRow["patname"];
                        string bedNo = currentRow["bedno"].ToString();
                        newRow["SortNum"]      = Convert.ToInt32(bedNo.Replace("加", "100").ToString());
                        newRow["BedNo"]        = bedNo;
                        newRow["OrderId"]      = currentRow["docorderid"];
                        newRow["ChargeDate"]   = currentRow["chargedate"];
                        newRow["UnitName"]     = currentRow["unitname"];
                        newRow["CureNo"]       = currentRow["cureno"];
                        newRow["DrugNum"]      = currentRow["drugnum"];
                        newRow["PresDeptName"] = currentRow["presdeptname"];
                        newRow["PatAge"]       = zyInterFace.GetPatAge(newRow["CureNo"].ToString(), currentTime);
                        _printOrder.Rows.Add(newRow);
                    }
                }
                DataRow[] dRows = _printOrder.Select("", "SortNum");
                DataTable newDt = _printOrder.Clone();
                foreach (DataRow dRow in dRows)
                {
                    newDt.Rows.Add(dRow.ItemArray);
                }
                _printOrder = newDt;
                if (_printOrder.Rows.Count > 0)
                {
                    report = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                    string type = "";
                    switch (printCondition.queyType)
                    {
                    case 0:
                        type = "长期";
                        break;

                    case 1:
                        type = "临时";
                        break;

                    default:
                        break;
                    }
                    report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName
                                                                      + type + "住院药品摆药单";
                    report.ParameterByName("PrintTime").AsDateTime = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    report.ParameterByName("Printer").AsString     = BaseData.GetUserName(printCondition.userId);
                    report.PrintPreview(false);
                }
            }
        }
Beispiel #5
0
 /// <summary>
 /// 打印其他报表(除单据外)
 /// </summary>
 /// <param name="printCondition">报表头</param>
 /// <param name="orderDt">报表明细</param>
 /// <param name="path">报表文件路径</param>
 public abstract void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path);