void Printreceipt() { CNNoteDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <CNNoteDtls> ().Where(x => x.cnno == inv.cnno).ToList <CNNoteDtls>(); list = new CNNoteDtls[ls.Count]; ls.CopyTo(list); } //mmDevice = null; //findBTPrinter (); IPrintDocument prtInv = PrintDocManager.GetPrintDocument <PrintCreditNote>(); prtInv.SetDocument(inv); prtInv.SetDocumentDtls(list); prtInv.SetNoOfCopy(1); prtInv.SetCallingActivity(this); if (prtInv.StartPrint()) { updatePrintedStatus(inv); } else { Toast.MakeText(this, prtInv.GetErrMsg(), ToastLength.Long).Show(); } }
void PrintInv(Invoice inv, int noofcopy) { //Toast.MakeText (this, "print....", ToastLength.Long).Show (); InvoiceDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <InvoiceDtls> ().Where(x => x.invno == inv.invno).ToList <InvoiceDtls>(); list = new InvoiceDtls[ls.Count]; ls.CopyTo(list); } //mmDevice = null; //findBTPrinter (); IPrintDocument prtInv = PrintDocManager.GetPrintDocument <PrintInvoice>(); prtInv.SetDocument(inv); prtInv.SetDocumentDtls(list); prtInv.SetNoOfCopy(noofcopy); prtInv.SetCallingActivity(this); if (prtInv.StartPrint()) { updatePrintedStatus(inv); var found = listData.Where(x => x.invno == inv.invno).ToList(); if (found.Count > 0) { found [0].isPrinted = true; SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <Invoice> (this, listData, Resource.Layout.ListItemRow, viewdlg); } } else { Toast.MakeText(this, prtInv.GetErrMsg(), ToastLength.Long).Show(); } }
void PrintSO(SaleOrder so, int noofcopy) { //Toast.MakeText (this, "print....", ToastLength.Long).Show (); SaleOrderDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <SaleOrderDtls> ().Where(x => x.sono == so.sono).ToList <SaleOrderDtls>(); list = new SaleOrderDtls[ls.Count]; ls.CopyTo(list); } IPrintDocument prtSO = PrintDocManager.GetPrintDocument <PrintSalesOrder>(); prtSO.SetDocument(so); prtSO.SetDocumentDtls(list); prtSO.SetNoOfCopy(noofcopy); prtSO.SetCallingActivity(this); if (prtSO.StartPrint()) { updatePrintedStatus(so); var found = listData.Where(x => x.sono == so.sono).ToList(); if (found.Count > 0) { found [0].isPrinted = true; SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <SaleOrder> (this, listData, Resource.Layout.ListItemRow, viewdlg); } } else { Toast.MakeText(this, prtSO.GetErrMsg(), ToastLength.Long).Show(); } }
void PrintInv(CNNote inv, int noofcopy) { //Toast.MakeText (this, "print....", ToastLength.Long).Show (); CNNoteDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <CNNoteDtls> ().Where(x => x.cnno == inv.cnno).ToList <CNNoteDtls>(); list = new CNNoteDtls[ls.Count]; ls.CopyTo(list); } IPrintDocument prtInv = PrintDocManager.GetPrintCNDocument <PrintCreditNote>(); prtInv.SetDocument(inv); prtInv.SetDocumentDtls(list); prtInv.SetNoOfCopy(noofcopy); prtInv.SetCallingActivity(this); if (prtInv.StartPrint()) { updatePrintedStatus(inv); var found = listData.Where(x => x.cnno == inv.cnno).ToList(); if (found.Count > 0) { found [0].isPrinted = true; SetViewDlg viewdlg = SetViewDelegate; listView.Adapter = new GenericListAdapter <CNNote> (this, listData, Resource.Layout.ListItemRowCN, viewdlg); } } }
void Buttestprint_Click(object sender, EventArgs e) { IPrintDocument prtInv = PrintDocManager.GetPrintDocument <PrintTest>(); prtInv.SetNoOfCopy(1); prtInv.SetCallingActivity(this); if (!prtInv.StartPrint()) { Toast.MakeText(this, prtInv.GetErrMsg(), ToastLength.Long).Show(); } }
void PrintInvSumm(DateTime printdate1, DateTime printdate2) { IPrintDocument prtInv = PrintDocManager.GetPrintSummary <PrintSummary>(); prtInv.SetNoOfCopy(1); Hashtable para = new Hashtable(); para.Add("DateStart", printdate1); para.Add("DateEnd", printdate2); prtInv.SetExtraPara(para); prtInv.SetCallingActivity(this); prtInv.StartPrint(); Toast.MakeText(this, prtInv.GetErrMsg(), ToastLength.Long).Show(); }
void Printreceipt() { InvoiceDtls[] list; using (var db = new SQLite.SQLiteConnection(pathToDatabase)){ var ls = db.Table <InvoiceDtls> ().Where(x => x.invno == inv.invno).ToList <InvoiceDtls>(); list = new InvoiceDtls[ls.Count]; ls.CopyTo(list); } if (inv.custcode == null || inv.custcode == "") { string[] codes = spinCust.SelectedItem.ToString().Split(new char[] { '|' }); if (codes.Length < 2) { Toast.MakeText(this, Resources.GetString(Resource.String.msg_invalidcust), ToastLength.Long).Show(); return; } inv.custcode = codes [0].Trim(); inv.description = txtcustname; } //mmDevice = null; //findBTPrinter (); IPrintDocument prtInv = PrintDocManager.GetPrintDocument <PrintInvoice>(); prtInv.SetDocument(inv); prtInv.SetDocumentDtls(list); prtInv.SetNoOfCopy(1); prtInv.SetCallingActivity(this); if (prtInv.StartPrint()) { updatePrintedStatus(inv); } else { Toast.MakeText(this, prtInv.GetErrMsg(), ToastLength.Long).Show(); } }