コード例 #1
0
ファイル: InvoiceActivity.cs プロジェクト: mokth/merpV3
        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();
            }
        }
コード例 #2
0
ファイル: CNEntryActivityEx.cs プロジェクト: mokth/merpV3
        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();
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
ファイル: UtilityActivity.cs プロジェクト: mokth/merpV3
        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();
            }
        }
コード例 #5
0
        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();
            }
        }