Пример #1
0
        private void PrintBy()
        {
            DataTable dtt = (DataTable)dgrdRecipeInfo.DataSource;

            try
            {
                this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor();
                string startPath = Application.StartupPath + "\\report\\住院摆药单(经管).grf";
                for (int i = 0; i < selectPat.Count; i++)
                {
                    DataRow[] rows = dtt.Select("cureno=" + "'" + selectPat[i].CureNo.ToString() + "'");
                    if (rows == null || rows.Length == 0)
                    {
                        continue;
                    }
                    DataTable dt = dtt.Clone();
                    dt.Clear();
                    for (int j = 0; j < rows.Length; j++)
                    {
                        dt.Rows.Add(rows[j].ItemArray);
                    }
                    PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_BY").PrintBill(null, dt,
                                                                                              startPath, (int)_currentUserId);
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = DefaultCursor;
            }
        }
    public static void Main(string[] args)
    {
        var factory = new PrintFactory();

        Console.WriteLine(PrintFactory.GetPrint(PrintType.DigitalPrint));
        Console.WriteLine(PrintFactory.GetPrint(PrintType.InkPrint));
    }
Пример #3
0
 private void tsrbtnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         YP_CheckMaster master      = new YP_CheckMaster();
         int            auditNum    = 0;
         string         strAuditNum = GWMHIS.BussinessLogicLayer.Forms.DlgInputBoxStatic.InputBox("", "请输入要打印的审核单号", "");
         if (strAuditNum != "" && Int32.TryParse(strAuditNum, out auditNum))
         {
             if (_belongSystem == ConfigManager.YF_SYSTEM)
             {
                 master.OpType = ConfigManager.OP_YF_CHECK;
             }
             else
             {
                 master.OpType = ConfigManager.OP_YK_CHECK;
             }
             master.AuditNum = auditNum;
             master.DeptID   = (int)_currentDeptId;
             string startPath = Application.StartupPath + "\\report\\药品盘点单据.grf";
             PrintFactory.GetPrinter(ConfigManager.OP_YK_CHECK).PrintBill(master, null, startPath,
                                                                          (int)_currentUserId);
         }
         else
         {
             throw new Exception("盘点单号格式不正确,请重新输入");
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Пример #4
0
        private void tsrbtnPrint_Click(object sender, EventArgs e)
        {
            string startPath = Application.StartupPath + "\\report\\药品调价单据.grf";

            PrintFactory.GetPrinter(ConfigManager.OP_YK_ADJPRICE).PrintBill(_currentMaster, _orderDt,
                                                                            startPath, (int)_currentUserId);
        }
Пример #5
0
        /// <summary>
        /// 打印统领单据
        /// </summary>
        /// <param name="uniformMaster">统领单头表</param>
        private void PrintDispTL(YP_DispDeptHis uniformMaster)
        {
            try
            {
                this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor();
                string startPath = Application.StartupPath + "\\report\\统领发药单据.grf";
                uniformMaster.PatientNames = CombineTotalMsg(cobSumWay.SelectedIndex, this.chkPrintNoPO.Checked);
                switch (cobSumWay.SelectedIndex)
                {
                case 0:
                    uniformMaster.BillType = "长期医嘱";
                    break;

                case 1:
                    uniformMaster.BillType = "临时医嘱";
                    break;

                default:
                    uniformMaster.BillType = "全部医嘱";
                    break;
                }
                uniformMaster.BillType += chkPrintNoPO.Checked ? "针剂药品" : "全部药品";
                PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_TL").PrintBill(uniformMaster, _totalOrder,
                                                                                          startPath, (int)_currentUserId);
            }
            catch (Exception error)
            {
                throw error;
            }
            finally
            {
                this.Cursor = DefaultCursor;
            }
        }
 public static void VisitorModMain()
 {
     void test()
     {
         IntFactory   b            = new IntFactory();
         PrintFactory printFactory = new PrintFactory();
         int          x            = exp(b).eval(); // int x = exp.eval();
     }
 }
Пример #7
0
        public void PrintBill(int printer)
        {
            string startPath = System.Windows.Forms.Application.StartupPath + "\\report\\药品采购计划单.grf";

            if (_currentMaster != null)
            {
                YP_Printer billPrinter = PrintFactory.GetPrinter(ConfigManager.OP_YK_STOCKPLAN);
                billPrinter.PrintBill(_currentMaster, null, startPath, printer);
            }
        }
Пример #8
0
 private void tsrbtnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         string startPath = Application.StartupPath + "\\report\\药品入库单据.grf";
         PrintFactory.GetPrinter(ConfigManager.OP_YK_INOPTYPE).PrintBill(_currentMaster, _orderDt, startPath, (int)_currentUserId);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Пример #9
0
        /// <summary>
        /// 打印
        /// </summary>
        /// <returns></returns>
        public async Task RenderPrinterAsync(CardOrder page)
        {
            try
            {
                #region 验证信息
                var orderNoList = GetSelectOrderNoList(page.DataGridOrderList);
                if ((orderNoList?.Count ?? 0) <= 0)
                {
                    _onTipRender.ExecuteTip(page.BodyPanel, "请选择要打印的订单");
                    return;
                }

                var data      = _onControlRender.ConvertObject <CardOrderItemResponse>(page.DataGridOrderList.Items);
                var orderList = FindOrderNos(data, orderNoList);

                if ((orderList?.Count ?? 0) <= 0)
                {
                    _onTipRender.ExecuteTip(page.BodyPanel, "未找到要打印的订单");
                    return;
                }
                #endregion

                var outOrderNoList = new List <string>();
                var printer        = PrintFactory.GetPrintRender(_onDeviceSettingPlugins.GlobalConfig.PrintConfig);
                var respVerify     = printer.Verify();
                if (!(respVerify?.IsSuccess ?? false))
                {
                    _onTipRender.ExecuteTip(page.BodyPanel, $"{respVerify?.Msg}");
                    return;
                }
                foreach (var item in orderList)
                {
                    var resp = await ExecutePrinter(printer, item);

                    if (!resp)
                    {
                        outOrderNoList.Add(item.OrderNo);
                    }
                }
                if ((outOrderNoList?.Count ?? 0) > 0)
                {
                    _onTipRender.ExecuteTip(page.BodyPanel, $"{string.Join(",", outOrderNoList.ToArray())} 打印失败");
                    return;
                }

                _onTipRender.ExecuteTip(page.BodyPanel, "打印成功", UControl.EnumResultType.OK);
            }
            catch (Exception ex)
            {
                TextHelper.Error("RenderPrinterAsync 异常", ex);
                _onTipRender.ExecuteTip(page.BodyPanel, "打印异常");
            }
        }
Пример #10
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         string     startPath = Application.StartupPath;
         YP_Printer printer;
         if (tabDispQuery.SelectedTab == tabPgSingle)
         {
             //如果是门诊发药,发票号为0
             if (_currentMaster.InvoiceNum != 0)
             {
                 //如果是发药
                 if (_currentMaster.DrugOC_Flag == 1)
                 {
                     printer    = PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "MZ");
                     startPath += "\\report\\门诊发药单据.grf";
                 }
                 //如果是退药
                 else
                 {
                     printer    = PrintFactory.GetPrinter(ConfigManager.OP_YF_REFUND + "MZ");
                     startPath += "\\report\\门诊退药单据.grf";
                 }
             }
             //如果是住院发药
             else
             {
                 if (_currentMaster.DrugOC_Flag == 1)
                 {
                     printer    = PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_BY");
                     startPath += "\\report\\住院摆药单(经管).grf";
                 }
                 else
                 {
                     printer    = PrintFactory.GetPrinter(ConfigManager.OP_YF_REFUND + "ZY");
                     startPath += "\\report\\住院退药单据.grf";
                 }
             }
             printer.PrintBill(_currentMaster, null, startPath, (int)_currentUserId);
         }
         else
         {
             printer    = PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_TL");
             startPath += "\\report\\统领发药单据(经管).grf";
             printer.PrintBill(_currentDeptDisp, (DataTable)(dgrdDispOrder.DataSource), startPath, (int)_currentUserId);
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Пример #11
0
 private void PrintRefundBill(YP_DRMaster refMaster)
 {
     try
     {
         string startPath = Application.StartupPath + "\\report\\门诊退药单据.grf";
         PrintFactory.GetPrinter(ConfigManager.OP_YF_REFUND + "MZ").PrintBill(refMaster, null, startPath,
                                                                              (int)_currentUserId);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Пример #12
0
        private void btnPutDrug_Click(object sender, EventArgs e)
        {
            if (tabMsgMaster.SelectedIndex == 0)
            {
                PrintBy();
            }
            else if (tabMsgMaster.SelectedIndex == 1)
            {
                string startPath = Application.StartupPath + "\\report\\住院已发药摆药单(经管).grf";

                PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_BY").PrintBill(_currentMaster, null,
                                                                                          startPath, (int)_currentUserId);
            }
        }
Пример #13
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         string            startPath = Application.StartupPath + "\\report\\药品供应商统计单据.grf";
         YP_PrintCondition condition = new YP_PrintCondition();
         condition.actYear  = cobBeginDate.Value.ToString();
         condition.actMonth = cobEndDate.Value.ToString();
         condition.userId   = Convert.ToInt32(user.EmployeeID);
         PrintFactory.GetPrinter("Support_Report").PrintReport(condition, (DataTable)dgvDetail.DataSource, startPath);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Пример #14
0
        private void PrintDispTL(List <BillMaster> printList, YP_DispDeptHis uniformMaster)
        {
            string startPath = Application.StartupPath + "\\report\\统领发药单据(经管).grf";

            PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_TL").PrintBill(uniformMaster, _recipeOrder,
                                                                                      startPath, (int)_currentUserId);
            if (MessageBox.Show("发药成功,是否需要打印摆药单?", "发药成功",
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                startPath = Application.StartupPath + "\\report\\住院摆药单(经管).grf";
                foreach (YP_DRMaster printMaster in printList)
                {
                    PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_BY").PrintBill(printMaster, null,
                                                                                              startPath, (int)_currentUserId);
                }
            }
        }
Пример #15
0
        //摆药按钮
        private void btnPutDrug_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor();
                if (_recipeOrder != null)
                {
                    YP_PrintCondition printCondition = new YP_PrintCondition();
                    printCondition.userId   = (int)_currentUserId;
                    printCondition.drugType = chkIsOnlyPutPO.Checked ? "口服药" : "全部药品";
                    printCondition.queyType = cobSumWay.SelectedIndex;
                    DataRow[] dRows;
                    switch (cobSumWay.SelectedIndex)
                    {
                    case 0:
                        dRows = _recipeOrder.Select("DOCORDERTYPE=0");
                        break;

                    case 1:
                        dRows = _recipeOrder.Select("DOCORDERTYPE=1");
                        break;

                    default:
                        dRows = _recipeOrder.Select("");
                        break;
                    }
                    if (dRows.Count() > 0)
                    {
                        string startPath = Application.StartupPath + "\\report\\住院摆药单.grf";
                        PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_BY").PrintReport(printCondition,
                                                                                                    dRows.CopyToDataTable(),
                                                                                                    startPath);
                    }
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = DefaultCursor;
            }
        }
Пример #16
0
 private void tsrPrintEmpty_Click(object sender, EventArgs e)
 {
     try
     {
         if (_checkOrderDt.Rows.Count > 0)
         {
             string startPath = Application.StartupPath + "\\report\\药品空盘点表单.grf";
             PrintFactory.GetPrinter(ConfigManager.OP_YK_CHECK + "EMPTY").PrintBill(_currentMaster, _checkOrderDt,
                                                                                    startPath, (int)_currentUserId);
         }
         else
         {
             MessageBox.Show("请先提取数据");
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Пример #17
0
        private void PrintDispTL(List <BillMaster> printList, YP_DispDeptHis uniformMaster)
        {
            string startPath = Application.StartupPath + "\\report\\统领发药单据(经管).grf";

            for (int i = 0; i < selectPat.Count; i++)
            {
                DataRow[] rows = _recipeOrder.Select("cureno=" + "'" + selectPat[i].CureNo.ToString() + "'");
                if (rows == null || rows.Length == 0)
                {
                    continue;
                }
                DataTable dt = _recipeOrder.Clone();
                dt.Clear();
                for (int j = 0; j < rows.Length; j++)
                {
                    dt.Rows.Add(rows[j].ItemArray);
                }
                PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_TL").PrintBill(uniformMaster, dt,
                                                                                          startPath, (int)_currentUserId);
            }
        }
Пример #18
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgrdDrugIOS.DataSource != null)
         {
             DataTable         printDt   = (DataTable)(dgrdDrugIOS.DataSource);
             string            startPath = Application.StartupPath + "\\report\\药品进销存报表.grf";
             YP_PrintCondition condition = new YP_PrintCondition();
             condition.actYear  = cobQueryYear.Text;
             condition.actMonth = cobQueryMonth.Text;
             condition.drugType = cobQueryType.Text;
             condition.userId   = (int)_currentUser;
             condition.deptId   = (int)_currentDept;
             PrintFactory.GetPrinter("IOS_Report").PrintReport(condition, printDt, startPath);
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Пример #19
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         DataTable           dt        = (DataTable)dgrdOrderAccount.DataSource;
         YP_AccountCondition condition = new YP_AccountCondition();
         condition.actMonth    = cobAccountMonth.Text;
         condition.actYear     = cobAccountYear.Text;
         condition.drugName    = txtDgName.Text;
         condition.drugType    = "";
         condition.productName = txtProduct.Text;
         condition.beginNum    = lblBeginNum.Text;
         condition.begingFee   = lblBeginFee.Text;
         condition.endNum      = lblEndNum.Text;
         condition.endFee      = lblEndFee.Text;
         string startPath = Application.StartupPath + "\\report\\药品明细帐报表.grf";
         PrintFactory.GetPrinter("Account_Report").PrintReport(condition, dt, startPath);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Пример #20
0
        public async void ExecuteRefundAsync(CardOrder page, string orderNo, decimal refundAmount, decimal totalAmount, decimal receiveAmount, string refundPassword)
        {
            if (string.IsNullOrWhiteSpace(refundPassword))
            {
                refundPassword = await _onCashierRequest.FindRefundPassword(AccountCache.Persist.CashId);
            }

            var resp = await _onOrderRequest.ExecuteRefundAsync(orderNo, refundPassword, refundAmount);

            if (!(resp.IsSuccess) || (resp?.Data ?? null) == null)
            {
                _onTipRender.ExecuteTip(page.BodyPanel, resp?.Msg ?? "退款失败");
                return;
            }

            await this.RenderListAsync(page);

            #region 打印退款小票
            TextHelper.LogInfo($"打印退款小票储蓄卡退款小票开始");
            var printer     = PrintFactory.GetPrintRender(_onDeviceSettingPlugins.GlobalConfig.PrintConfig);
            var printerResp = await printer.ExecuteRefundAsync(new Model.RefundContentRequest()
            {
                IsRepair      = false,
                TotalAmount   = totalAmount,
                ReceiptAmount = receiveAmount,
                RefundAmount  = resp.Data.RefundFee,
                IsCard        = true,
                PayType       = resp.Data.PayType.ToPayType().GetDescription(),
                TradeNo       = resp.Data.OutTradeNo,
                TradeTime     = string.IsNullOrEmpty(resp.Data.RefundTime) ? DateTime.Now : Convert.ToDateTime(resp.Data.RefundTime)
            }, AccountCache.ToMerchantResponse(), true);

            #endregion

            _onSystemRender.ExecuteVideoAsync(refundAmount, EnumOptionPayType.Refund);
            _onTipRender.ExecuteTip(page.BodyPanel, "退款成功", UControl.EnumResultType.OK);
        }