public void PrintCommissionChargesReport(String PrinterName, PrinterDevice Device) { frmViewReport oViewReport = new frmViewReport(); DataSet ds = new DataSet(); ds.Tables.Add(Global.oMySql.GetDataTable(String.Format("SELECT c.Rep_ID, c.RepID, rs.Name FROM Customer c Left Join Reps rs On rs.ID=c.Rep_ID Where c.CompanyID='{0}' And Rep_ID>0 Group By c.Rep_ID Order By rs.Name", this.CompanyID), "Rep")); ds.Tables.Add(Global.oMySql.GetDataTable(String.Format("SELECT Rep_ID, sum(Charge) as Charge FROM rep_charges r Where Rep_ID > 0 Group By Rep_ID"), "Charge")); ds.Tables.Add(Global.oMySql.GetDataTable(String.Format("SELECT c.CustomerID, bc.BrochureID, r.ID as Rep_ID, rs.Name, sum(bc.InvoiceAmount) as InvoiceAmount, sum(bc.TaxAmount) as TaxAmount,sum(bc.TaxAmount) as TaxAmount,if(c.Retail>=2500,sum(bc.InvoiceAmount - bc.TaxAmount),sum(bc.InvoiceAmount*(100-(bc.ProfitPercent+5))/(100-bc.ProfitPercent) -bc.TaxAmount)) as InvoiceableAmount, sum(if(c.Retail>=2500,(bc.InvoiceAmount - bc.TaxAmount),(bc.InvoiceAmount*(100-(bc.ProfitPercent+5))/(100-bc.ProfitPercent) -bc.TaxAmount))*bc.CODE/100) as Commission FROM Rep r Left Join Reps rs On r.ID=rs.ID Left Join Customer c On r.ID=c.Rep_ID and r.CompanyID=c.CompanyID Left Join BrochureByCustomer bc On c.CompanyID=bc.CompanyID and c.CustomerID=bc.CustomerID Where r.CompanyID='{0}' And rs.Name is not Null Group By c.Rep_ID Order By rs.ID", this.CompanyID), "Commission")); CommissionChargesRep oRpt = new CommissionChargesRep(); oRpt.SetDataSource(ds); // ds.WriteXml("CommissionChargesReport1.xml", XmlWriteMode.WriteSchema); if (Device == PrinterDevice.Printer) { //oRpt.PrintOptions.PrinterName = "\\\\srv1\\Plain"; oRpt.PrintOptions.PrinterName = PrinterName; oRpt.PrintToPrinter(1, true, 1, 100); //oViewReport.cReport.ReportSource = oRpt; //oViewReport.cReport.PrintReport(); } else { oViewReport.cReport.ReportSource = oRpt; oViewReport.ShowDialog(); } }
public Devices() { int index = 0; while (index < 8) { mDevices[index] = new TapeDevice(index); index++; } while (index < 16) { mDevices[index] = new DiskDevice(index); index++; } mDevices[CardReaderUnitCode] = new CardReaderDevice(CardReaderUnitCode); mDevices[17] = new CardWriterDevice(17); mDevices[18] = new PrinterDevice(18); Teletype = new TeletypeDevice(19); mDevices[19] = Teletype; mDevices[20] = new PaperTapeDevice(20); foreach (MixDevice device in mDevices) { device.ReportingEvent += Device_Reporting; } }
private void btPrint_Click(object sender, EventArgs e) { String PrinterName = ""; PrinterDevice PrintTo = PrinterDevice.Printer; Smtp oSmtp = new Smtp(); switch (txtType.CheckedItem.DataValue.ToString()) { case "Printer": PrintTo = PrinterDevice.Printer; PrinterName = Global.OpenPrintDialog(); if (PrinterName == "") { return; } break; case "PDF": PrintTo = PrinterDevice.PDF; oSmtp.Subject = "Purchase Orders " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); oSmtp.To = "<" + "*****@*****.**" + ">"; //this.eMail + ">"; oSmtp.From = "\"Signature Fundraising Customer Service\" <*****@*****.**>"; String strTitle = "Purchase Order\n\r"; oSmtp.Body = strTitle; break; case "Viewer": PrintTo = PrinterDevice.Viewer; break; } if (lvCustomers.Items.Count > 0) { foreach (Infragistics.Win.UltraWinListView.UltraListViewItem Item in lvCustomers.Items) { if (oReceive.Find(Item.Tag.ToString())) { // if (PrintTo == PrinterDevice.PDF) // oSmtp.Attachment = oReceive.PrintPDF(); // else oReceive.Print(PrintTo, PrinterName); } } //if (PrintTo == PrinterDevice.PDF) // oSmtp.Send(); } this.Dispose(); }
public void Print(PrinterDevice Printo, String PrinterName) { frmViewReport oViewReport = new frmViewReport(); PurchaseOrder oRpt = new PurchaseOrder(); DataSet ds = new DataSet(); ds.Tables.Add(oMySql.GetDataTable("Select * From Vendor Where CompanyID='" + CompanyID + "'", "Vendor")); ds.Tables.Add(oMySql.GetDataTable("Select * From Purchase Where CompanyID='" + CompanyID + "' And PurchaseID='" + ID + "'", "Purchase")); ds.Tables.Add(oMySql.GetDataTable("Select * From Product Where CompanyID='" + CompanyID + "'", "Product")); ds.Tables.Add(oMySql.GetDataTable("Select * From PurchaseDetail Where CompanyID='" + CompanyID + "' And PurchaseID='" + ID + "'", "PurchaseDetail")); // ds.WriteXml("Purchase11.xml", XmlWriteMode.WriteSchema); oRpt.SetDataSource(ds); oRpt.SetParameterValue("CompanyName", base.Name); if (Printo == PrinterDevice.Viewer) { oViewReport.cReport.ReportSource = oRpt; oViewReport.ShowDialog(); } else if (Printo == PrinterDevice.Printer) { oRpt.PrintOptions.PrinterName = PrinterName; oRpt.PrintToPrinter(1, true, 1, 100); } else if (Printo == PrinterDevice.PDF) { PDF oPDF = new PDF(); oPDF.FileName = Application.StartupPath + "\\" + this.ID + ".pdf"; oPDF.ExportReport(oRpt, "pdf", Application.StartupPath + "\\", this.ID); Smtp oSmtp = new Smtp(); oSmtp.Subject = "Purchase Order : " + this.ID + " " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); oSmtp.To = "<" + "*****@*****.**" + ">"; //this.eMail + ">"; oSmtp.From = "\"Signature Fundraising Customer Service\" <*****@*****.**>"; String strTitle = "Purchase Order\n\r"; oSmtp.Body = strTitle; oSmtp.Attachment = oPDF.FileName; if (!oSmtp.Send()) { return; } } }
/// <summary> /// Configures runtime services for the application /// </summary> /// <param name="services"></param> public void ConfigureServices(IServiceCollection services) { var printerStatus = new PrinterStatus(); var actorSystem = ActorSystem.Create("Printer"); var monitor = actorSystem.ActorOf(PrinterMonitor.Props(printerStatus), "printer-monitor"); var printer = actorSystem.ActorOf(PrinterDevice.Props(monitor), "printer"); services.AddSingleton(printerStatus); services.AddSingleton <IPrinterService>(new PrinterService(printer)); services.AddServerSideBlazor().AddHubOptions(options => { // Allow uploads up to 30MB options.MaximumReceiveMessageSize = 1024 * 1024 * 30; }); services.AddRazorPages(); services.AddFileReaderService(options => { options.InitializeOnFirstCall = true; }); }
public void Print(PrinterDevice Printo, String PrinterName) { DataSet ds = this.GetPOReceive(this.CompanyID, this.ID); POReceive oRpt = new POReceive(); frmViewReport oViewReport = new frmViewReport(); oRpt.SetDataSource(ds); //oViewReport.cReport.ReportSource = oRpt; //oViewReport.Show(); // oRpt.PrintToPrinter(1, true, 1, 100); if (Printo == PrinterDevice.Viewer) { oViewReport.cReport.ReportSource = oRpt; oViewReport.ShowDialog(); } else if (Printo == PrinterDevice.Printer) { oRpt.PrintOptions.PrinterName = PrinterName; oRpt.PrintToPrinter(1, true, 1, 100); } }
private void txtSave_Click(object sender, EventArgs e) { switch (txtDevice.Items[txtDevice.CheckedIndex].DataValue.ToString()) { case "Printer": this.PrintDevice = PrinterDevice.Printer; break; case "eMail": this.eMail = txteMail.Text; this.PrintDevice = PrinterDevice.eMail; break; case "PDF": this.PrintDevice = PrinterDevice.File; break; case "Preview": this.PrintDevice = PrinterDevice.Screen; break; } this.Close(); }
/// <summary> /// Print the current label /// </summary> /// <param name="device">Label</param> public void Print(PrinterDevice device) { string epl = GetEPLCode(); RawPrinterHelper.SendStringToPrinter(device.QueueName, epl); }
private void txtCancel_Click(object sender, EventArgs e) { this.PrintDevice = PrinterDevice.None; Close(); }
public Boolean PrintStatement(String PrinterName, PrinterDevice Device) { if (_Total == 0) { Total = GetTotal(); Update(); } frmViewReport oViewReport = new frmViewReport(); //DataSet ds1 = oMySql.GetCustomerStatement(CompanyID, ID); DataSet ds = new DataSet(); ds.Tables.Add(oMySql.GetDataTable(String.Format("Select * From Vendor Where CompanyID='{0}' And VendorID='{1}'", CompanyID, this.VendID), "Vendor")); ds.Tables.Add(oMySql.GetDataTable(String.Format("Select * From Purchase Where CompanyID='{0}' And PurchaseID='{1}'", CompanyID, this.ID), "Purchase")); ds.Tables.Add(oMySql.GetDataTable(String.Format("Select * From PaymentProvider Where CompanyID='{0}' And PurchaseID='{1}' Order by Date", CompanyID, ID), "Statement")); PurchaseStatement oRpt = new PurchaseStatement(); // ds.WriteXml("PrintStatement1.xml", XmlWriteMode.WriteSchema); oRpt.SetDataSource(ds); oRpt.SetParameterValue("CompanyName", base.Name); if (Device == PrinterDevice.Printer) { oRpt.PrintOptions.PrinterName = PrinterName; oRpt.PrintToPrinter(1, true, 1, 100); } else if (Device == PrinterDevice.eMail) { PDF oPDF = new PDF(); oPDF.FileName = Application.StartupPath + "\\" + this.ID + ".pdf"; oPDF.ExportReport(oRpt, "pdf", Application.StartupPath + "\\", this.ID); Smtp oSmtp = new Smtp(); oSmtp.Subject = base.ID + " - Statement " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "(" + this.ID + " - " + this.Name + ")"; if (PrinterName != "") { oSmtp.To = "\"" + this.Name + "\" <" + PrinterName + ">"; //this.eMail + ">"; } /* * else if (this.isEmail(this.eMail) && File.Exists(oPDF.FileName)) * { * * oSmtp.To = "\"" + this.Chairperson + "\" <" + this.eMail + ">"; * if (this.isEmail(this.oCustomerExtra.eMail)) * { * oSmtp.To = "\"" + this.Chairperson + "\" <" + this.oCustomerExtra.eMail + ">"; * } * * oSmtp.To = "\"" + "Scott Elsbree" + "\" <" + "*****@*****.**" + ">"; //this.eMail + ">"; * } */ else { oSmtp.To = "\"" + "Scott Elsbree" + "\" <" + "*****@*****.**" + ">"; //this.eMail + ">"; } oSmtp.From = "\"Signature Fundraising Customer Service\" <*****@*****.**>"; String strTitle = "\n\r"; strTitle += "Thank you for choosing Signature Fundraising. As of today we have not received complete payment for your account.\n\r"; strTitle += "We have attached a copy of your most recent statement showing the balance due. Please remember that according to\n\r"; strTitle += "the agreement we have with your organization interest will accrue on any unpaid balance after 20 days of delivery.\n\r"; strTitle += "We have also attached a check by fax form that will enable you to send payment to us right away. If you have any \n\r"; strTitle += "questions, you may reply to this e-mail or call us at 1-800-645-3863.\n\r"; strTitle += "\n\nThank you.\n\r"; strTitle += "Signature Fundraising\n\r"; //String strTitle = "This statement amount due is for a total of :\n\r $ " + this.StatementAmountDue.ToString() + " \n\r" ; //This invoice is for a total of ::invoice amount::, of which ::payment amount:: has already been received. /* * if (PrinterName == "" && !this.isEmail(this.eMail)) * strTitle += " WRONG EMAIL ADDRESS: " + this.eMail + " of " + this.ID + " : " + this.Name; * * if (PrinterName == "" && !File.Exists(oPDF.FileName)) * strTitle += " NO PDF FILE : " + this.eMail + " of " + this.ID + " : " + this.Name; * else * oSmtp.Attachment = oPDF.FileName; */ oSmtp.Body = strTitle; oSmtp.Attachment = "Check by Fax Form.pdf"; oSmtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "sigfund"); // oSmtp.BCC = "*****@*****.**"; if (!oSmtp.Send()) { Console.WriteLine(oSmtp.Error); oRpt.Dispose(); oViewReport.Dispose(); return(false); } //while (File.GetAttributes(oPDF.FileName) == FileAttributes.ReadOnly) ; /* * ReadFile: * try * { * if (File.Exists(oPDF.FileName)) * File.Delete(oPDF.FileName); * } * catch (IOException ex) * { * Console.WriteLine(ex.Message); * goto ReadFile; * } */ } else { oViewReport.cReport.ReportSource = oRpt; oViewReport.ShowDialog(); } oRpt.Dispose(); oViewReport.Dispose(); return(true); }