示例#1
0
        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);
                }
            }
        }