예제 #1
0
        protected void OnbtnPrint_Click(object sender, DirectEventArgs e)
        {
            string floor, timetype, area;

            floor = Common.GetComboBoxValue(cboFLOOR);
            if (floor == "")
            {
                floor = sFLOOR.Text;
            }

            area = Common.GetComboBoxValue(cboArea);
            if (area == "")
            {
                area = sAREA.Text;
            }

            timetype = Common.GetComboBoxValue(cboTIME);
            if (timetype == "")
            {
                timetype = sTIME.Text;
            }
            else
            {
                sTIME.Text = timetype;
            }

            PrintWindow.Show();
            PrintWindow.Loader.SuspendScripting();
            PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_REPORT_NAME=weeksch" + "&_REPORT_sQM=" + sFLOOR.Text + "&_REPORT_P=" + timetype;
            PrintWindow.Loader.DisableCaching = true;
            PrintWindow.LoadContent();
        }
        private void PrintCurrentLabel()
        {
            if (!CheckLicense())
            {
                return;
            }

            if (SelectedLabelView != null && SelectedLabelView.DataContext is LabelViewModel)
            {
                var pWin = new PrintWindow(RegionManager)
                {
                    Title = "Print Label"
                };

                var LVM = SelectedLabelView.DataContext as LabelViewModel;
                var pVM = pWin.DataContext as PrintWindowViewModel;
                if (pVM.Initialize(LVM.Label, LVM.ObjectList, LVM.RuleList))
                {
                    var pLV = new PrintLabelView()
                    {
                        DataContext = pVM
                    };
                    pWin.SetPrintLabelView(pLV);

                    pWin.Owner = Application.Current.MainWindow;
                    pWin.ShowDialog();
                }
                else
                {
                    DialogService.ShowSimpleTextDialog(Application.Current.MainWindow, "Warning", "2개 이상의 Sequential Number 규칙이 적용되었습니다.");
                }
            }
        }
 /// <summary>
 /// Function OpenPrintDialog to open the print window
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>NA</returns>
 /// <createdBy></createdBy>
 /// <createdOn>May-11,2016</createdOn>
 public void OpenPrintDialog(object obj)
 {
     CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     try
     {
         DateoutProcessingModel objPrinModel = new DateoutProcessingModel();
         objPrinModel.Vin         = Vin;
         objPrinModel.VehiclesID  = string.Empty;
         objPrinModel.BayLocation = BayLocation;
         PrintWindow objPrint = new PrintWindow(objPrinModel);
         objPrint.ShowDialog();
     }
     catch (Exception ex)
     {
         LogHelper.LogErrorToDb(ex);
         bool displayErrorOnUI = false;
         CommonSettings.logger.LogError(this.GetType(), ex);
         if (displayErrorOnUI)
         {
             throw;
         }
     }
     finally
     {
         CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     }
 }
예제 #4
0
        private async void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if ((e.ColumnIndex == 7) && (e.RowIndex > -1))
            {
                int      id_doc = Convert.ToInt32(dataGridView1[2, e.RowIndex].Value);
                DateTime date   = Convert.ToDateTime(dataGridView1[1, e.RowIndex].Value);

                //Вызов сервиса печати талона
                byte[]           byte_array = null;
                getTalonResponse response   = await Program.patient.getTalonAsync(date, id_doc, number_polis);

                byte_array = response.Body.getTalonResult;

                if (byte_array != null)
                {
                    File.WriteAllBytes(@"C:\Temp\temp.pdf", byte_array);
                    PrintWindow pw = new PrintWindow();
                    pw.webBrowser1.Navigate(@"C:\Temp\temp.pdf");
                    pw.Show();
                }
                else
                {
                    MessageBox.Show("Ошибка!");
                }
            }
        }
예제 #5
0
        private void btnPrintWindow_Click(object sender, RoutedEventArgs e)
        {
            PrintWindow print = new PrintWindow();

            print.Show();
            this.Hide();
        }
예제 #6
0
        private void OnExecuteFilePrintCommand()
        {
            FlowDocument flowDocument = new FlowDocument();
            Image        image        = new Image()
            {
                Source = CurrentImageContainer.Image.GetBitmapImage()
            };

            flowDocument.Blocks.Add(new BlockUIContainer(image));

            if (File.Exists("printPreview.xps"))
            {
                File.Delete("printPreview.xps");
            }
            var xpsDocument          = new XpsDocument("printPreview.xps", FileAccess.ReadWrite);
            XpsDocumentWriter writer = XpsDocument.CreateXpsDocumentWriter(xpsDocument);

            writer.Write(((IDocumentPaginatorSource)flowDocument).DocumentPaginator);
            FixedDocumentSequence document = xpsDocument.GetFixedDocumentSequence();

            xpsDocument.Close();
            PrintWindow printWindow = new PrintWindow(document);

            printWindow.Show();
        }
예제 #7
0
        private void BookList_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            PrintWindow pw = new PrintWindow(_productManager.PrintBookProductList());

            pw.LabTitle.Content = "订货单";
            pw.ShowDialog();
        }
예제 #8
0
파일: script.cs 프로젝트: wineforever/MDT
        private void RenderTimer_Tick(object sender, EventArgs e)
        {
            //重绘
            var winSize = new float[] { 0, 0, RenderWindow.Width, RenderWindow.Height };

            Wineforever.Coordinate.client.Initialization("3D", winSize, true, CheckBox.Checked
                                                         );
            //刷新帧
            if (CURRENT_FRAME >= MOCAP_FRAMES.Count - 1)
            {
                CURRENT_FRAME = 0;
            }
            else
            {
                CURRENT_FRAME++;
            }
            Render();
            RenderWindow.Image = Wineforever.Coordinate.client.Show();
            //其他
            PrintWindow.Text = Debug;
            PrintWindow.Select(this.PrintWindow.TextLength, 0); //光标定位到文本最后
            PrintWindow.ScrollToCaret();                        //滚动到光标处
            try
            {
                SCALE        = double.Parse(inputbox_scale.Text);
                POINTS_COUNT = int.Parse(inputbox_pointsCount.Text);
            }
            catch (Exception)
            {
                SCALE        = 30;
                POINTS_COUNT = 17;
            }
        }
예제 #9
0
        public static void PrintWpfPreview(FrameworkElement element)
        {
            string printFileName = "print_preview.xps";

            if (File.Exists(printFileName))
            {
                File.Delete(printFileName);
            }

            //System.Printing.PrintDocumentImageableArea ia = null;
            using XpsDocument doc = new XpsDocument(printFileName, FileAccess.ReadWrite);

            XpsDocumentWriter writer = XpsDocument.CreateXpsDocumentWriter(doc);

            SerializerWriterCollator outputDocument = writer.CreateVisualsCollator();

            outputDocument.BeginBatchWrite();
            outputDocument.Write(element);
            outputDocument.EndBatchWrite();

            FixedDocumentSequence preview   = doc.GetFixedDocumentSequence();
            DocumentPaginator     paginator = preview.DocumentPaginator;

            preview.DocumentPaginator.PageSize = new Size(200, 100);
            var         a           = preview.DocumentPaginator.PageCount;
            PrintWindow printWindow = new PrintWindow(preview);

            printWindow.Show();

            doc.Close();
            writer         = null;
            outputDocument = null;
        }
예제 #10
0
 protected AbstractEngine(PrintWindow window, Stop stop, ManualResetEvent wait, CancellationToken token)
 {
     _stopWindow = stop;
     _window     = window;
     _wait       = wait;
     _token      = token;
 }
예제 #11
0
        private void SaleSta_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            PrintWindow pw = new PrintWindow(_productManager.PrintSaleStatisticsInfo());

            pw.LabTitle.Content = "受欢迎商品单";
            pw.ShowDialog();
        }
 protected void Btn_Print_Click(object Sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_PAT_ID=" + _PAT_ID + "&_REPORT_NAME=A09";
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
예제 #13
0
 protected void btnPrint_Click(object sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_REPORT_NAME=s01&_INFO_DATE=" + _Get_YMD2(DateField1.Text) + "&_REPORT_P=" + sTIME.Text;
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
 protected void OnbtnPrint_Click(object sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_PAT_ID=" + _PAT_ID + "&_INFO_DATE=" + sel_date.Text + "&_REPORT_NAME=f6a";
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
 protected void OnbtnPrintS_Click(object sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_REPORT_NAME=drug_term&_PAT_IC=" + Patient_ID.Text + "&_REPORT_P=short";
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
예제 #16
0
 protected void OnbtnPrint_Click(object sender, DirectEventArgs e)
 {
     GetWeek();
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "report/Report_Dialysis_h.aspx?_REPORT_NAME=checkin&_INFO_DATE=" + sDATE.Text + "&_REPORT_P=" + sWEEK.Text + "&_REPORT_sQM=" + sFLOOR.Text;
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
예제 #17
0
        private void Printer_Click(object sender, RoutedEventArgs e)
        {
            PrintWindow printWindow = new PrintWindow()
            {
                QuotationData = QuotationData,
                UserData      = this.UserData,
            };

            printWindow.ShowDialog();
        }
예제 #18
0
 /// <summary>
 /// 点击贴签系统菜单
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void miPrint_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     if (!this.ToString().Contains("PrintWindow") && !this.ToString().Contains("LoginWindow"))
     {
         PrintWindow printWindow = new PrintWindow();
         printWindow.Show();
         this.needCloseWindowConfirm = false;
         CloseCurrentWindow();
     }
 }
예제 #19
0
        protected void BtnPrint_Click(object sender, DirectEventArgs e)
        {
            string Url = "../report/Report_Dialysis_h.aspx?_PAT_IC=" + _PAT_IC + "&_BEG_DATE=" + _Get_YMD(start_date.Text) + "&_END_DATE=" + _Get_YMD(end_date.Text) + "&_REPORT_NAME=100";

            PrintWindow.Show();
            PrintWindow.Loader.SuspendScripting();
            PrintWindow.Loader.Url            = Url;
            PrintWindow.Loader.DisableCaching = true;
            PrintWindow.LoadContent();
        }
예제 #20
0
        public void PrintOffer(Offer offer)
        {
            ReportDocument report = new ReportDocument();

            report.Load("../../OfferReport.rpt");
            report.SetDataSource(_offerViewModel.OfferServices);
            PrintWindow print = new PrintWindow();

            print.LinkReport(report);
            print.Show();
        }
        public ActionResult ReadLst(string id)
        {
            PrintWindow window = new PrintWindow()
            {
                Title  = "详细清单",
                Loader = { Url = Url.Action("ReadApplymentLst", new { id = id }) }
            };

            window.Render(RenderMode.Auto);
            return(this.Direct());
        }
예제 #22
0
 private void PrintPage_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     using (PrintWindow window = new PrintWindow())
     {
         window.EnsureButtonClick += (sender1, e1) =>
         {
             PrintExecute(sender, window.IsRecursion);
             window.Close();
         };
         window.ShowDialog();
     }
 }
예제 #23
0
 public OrderPage(ReceiptPrinter printer)
 {
     this.printer = printer;
     orderDetails = new OrderDetails();
     InitializeComponent();
     pickItemsWindow      = new PickItemsWindow(orderDetails, MenuManager.MenuCategories);
     PickItemsTab.Content = pickItemsWindow;
     deliveryWindow       = new DeliveryWindow(orderDetails);
     DeliveryTab.Content  = deliveryWindow;
     printWindow          = new PrintWindow(orderDetails, printer);
     PrintTab.Content     = printWindow;
 }
예제 #24
0
        private async void button1_Click(object sender, EventArgs e)
        {
            if (comboBox2.Text != "")
            {
                DataBase.Insert("fun_ins_records", dateTimePicker1.Value, Convert.ToInt32(comboBox1.SelectedValue),
                                number_polis, Convert.ToDateTime(comboBox2.Text).TimeOfDay);

                if (!DataBase.HasError)
                {
                    try
                    {
                        await Program.patient.generateTalonAsync(dateTimePicker1.Value,
                                                                 Convert.ToInt32(comboBox1.SelectedValue), number_polis);
                    }
                    catch (Exception ex) { MessageBox.Show(ex.Message); }

                    if (MessageBox.Show("Запись прошла успешно! \nРаспечатать талон?",
                                        "Талон", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        //Вызов сервиса печати талона
                        byte[]           byte_array = null;
                        getTalonResponse response   = await Program.patient.getTalonAsync(
                            dateTimePicker1.Value, Convert.ToInt32(comboBox1.SelectedValue), number_polis);

                        byte_array = response.Body.getTalonResult;

                        if (byte_array != null)
                        {
                            File.WriteAllBytes(@"C:\Temp\temp.pdf", byte_array);
                            PrintWindow pw = new PrintWindow();
                            pw.webBrowser1.Navigate(@"C:\Temp\temp.pdf");
                            pw.Show();
                        }
                        else
                        {
                            MessageBox.Show("Ошибка!");
                        }
                    }
                    dateTimePicker1_ValueChanged(sender, e);
                }
                else
                {
                    MessageBox.Show(DataBase.ErrorMessage);
                }
            }
            else
            {
                MessageBox.Show("Выберите время!");
            }
        }
예제 #25
0
        private void btn_Print_Click(object sender, RoutedEventArgs e)
        {
            var dc = this.DataContext as SaleViewModel;

            dc.Sale.SalePrice    = dc.SumSalePrice;
            dc.Sale.ServicePrice = dc.SumServicePrice;
            dc.Sale.SumPrice     = dc.SumPrice;
            var data = new SaleData {
                Sale = dc.Sale, SaleItemCollection = dc.SaleItemCollection, ServiceItemCollection = dc.ServiceItemCollection
            };
            PrintWindow pw = new PrintWindow("print\\SaleFlowDocument.xaml", data, new SaleDocumentRenderer());

            pw.ShowDialog();
        }
예제 #26
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (maskedTextBox1.Text.Replace(" ", "").Length != 16)
            {
                MessageBox.Show("Некорректно задан номер медецинского полиса!");
            }
            else
            {
                DataTable table = DataBase.Select("fun_sel_login_pacient", maskedTextBox1.Text);
                DataRow[] rows  = table.Select();

                if (!DataBase.HasError && rows.Count() != 0)
                {
                    Patient.NumberPolicy = Convert.ToString(rows[0][0]);
                    Patient.LastName     = Convert.ToString(rows[0][1]);
                    Patient.FirstName    = Convert.ToString(rows[0][2]);
                    Patient.MiddLeName   = Convert.ToString(rows[0][3]);

                    maskedTextBox1.Text = "";
                    if (Info.Page != 100)
                    {
                        History.Values.Push(1);
                        ((UserForm)this.Parent).NextPage(Info.Page);
                        this.Hide();
                    }
                    else
                    {
                        byte[] byte_array = null;
                        byte_array = Program.patient.getMedCard(Patient.NumberPolicy);
                        if (byte_array != null)
                        {
                            File.WriteAllBytes(@"C:\Temp\temp.pdf", byte_array);
                            PrintWindow pw = new PrintWindow();
                            pw.webBrowser1.Navigate(@"C:\Temp\temp.pdf");
                            pw.Show();
                        }
                        else
                        {
                            MessageBox.Show("Ошибка!");
                        }
                    }
                }
            }
        }
예제 #27
0
 private void Content3_VisibleChanged(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         byte[] byte_array = null;
         byte_array = Program.patient.getMedCard(number_polis);
         if (byte_array != null)
         {
             File.WriteAllBytes(@"C:\Temp\temp.pdf", byte_array);
             PrintWindow pw = new PrintWindow();
             pw.webBrowser1.Navigate(@"C:\Temp\temp.pdf");
             pw.Show();
         }
         else
         {
             MessageBox.Show("Ошибка!");
         }
     }
 }
예제 #28
0
        protected void btnPrint_Click(object sender, DirectEventArgs e)
        {
            btnDetail_Click(sender, e);
            toDay = DateTime.Now.ToString("yyyy-MM-dd");
            string seldate = _Get_YMD2(this.DateField1.Text);
            string sSQL2   = "SELECT * FROM drug_itemlist ";

            sSQL2 += "WHERE dyivl_ivdate='" + toDay + "' ";
            DataTable dt2      = db.Query(sSQL2);
            string    SerialNo = "";

            if (dt2.Rows.Count > 0)
            {
                SerialNo = dt2.Rows[0]["dyivl_serialno"].ToString();
            }

            PrintWindow.Show();
            PrintWindow.Loader.SuspendScripting();
            PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_INFO_DATE=" + seldate + "&_REPORT_NAME=s05&_REPORT_P=" + SerialNo;
            PrintWindow.Loader.DisableCaching = true;
            PrintWindow.LoadContent();
        }
예제 #29
0
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            if (File.Exists("printPreview.xps"))
            {
                File.Delete("printPreview.xps");
            }
            var xpsDocument          = new XpsDocument("printPreview.xps", FileAccess.ReadWrite);
            XpsDocumentWriter writer = XpsDocument.CreateXpsDocumentWriter(xpsDocument);

            writer.Write(((IDocumentPaginatorSource)FD).DocumentPaginator);
            Document = xpsDocument.GetFixedDocumentSequence();
            xpsDocument.Close();
            var windows = new PrintWindow(Document);

            windows.ShowDialog();



            //PrintDialog printDialog = new PrintDialog();
            //if (printDialog.ShowDialog() == true)
            //{
            //    printDialog.PrintVisual(this, this.Title);
            //}
        }
예제 #30
0
 public PrinterEngine(PrintWindow window, Stop stop, ManualResetEvent wait, CancellationToken tokenSource, TaskScheduler context) : base(window, stop, wait, tokenSource)
 {
     _context = context;
 }
예제 #31
0
        private void Validate()
        {
            try
            {

                var newExamVm = SimpleIoc.Default.GetInstance<NewExamViewModel>();
                var newMaladeVm = SimpleIoc.Default.GetInstance<NewMaladeViewModel>();

                Examen.Malade = newMaladeVm.SelectedMalade;
                newExamVm.ExamensRepository.Add(Examen);

                //
                var printvm = SimpleIoc.Default.GetInstance<PrintViewModel>();
                var exam = newExamVm.ExamensRepository.Get().ToList().FirstOrDefault(n => n.Moment == Examen.Moment);
                printvm.Examen = exam;
                var printwin = new PrintWindow();
                printwin.Show();
                SelectedEye = "(vide)";
                LastEye = string.Empty;
                //Thread.Sleep(1000);
                //ResetForms();

            }
            catch (Exception e)
            {
                e.SaveException();
                ResetForms();
            }
        }