Exemple #1
0
        internal virtual bool Print()
        {
            string pathToDatabase = ((GlobalvarsApp)Application.Context).DATABASE_PATH;
            string userID         = ((GlobalvarsApp)Application.Context).USERID_CODE;

            text   = "";
            errMsg = "";
            bool isPrinted = false;

            text = InvoiceSummary.GetInvoiceSumm_Template("invsumm.vm", pathToDatabase, userID, printDate1, printDate2);          //Get from template
            if (string.IsNullOrEmpty(text))
            {
                text = GetInvoiceSumm(printDate1, printDate2);
            }

//			if (para.PaperSize == "8.5Inch") {
//				if (para.PrinterType == "Network Laserjet Printer")

            IPrintToDevice device = PrintDeviceManager.GetPrintingDevice <BlueToothDeviceHelper> ();

            device.SetCallingActivity(callingActivity);
            isPrinted = device.StartPrint(text, noOfCopy, ref errMsg);

            return(isPrinted);
        }
Exemple #2
0
        private bool Print()
        {
            text   = "";
            errMsg = "";
            bool isPrinted = false;

            text = GetInvoiceSumm(printDate1, printDate2);
            IPrintToDevice device = PrintDeviceManager.GetPrintingDevice <BlueToothDeviceHelper> ();

            device.SetCallingActivity(callingActivity);
            isPrinted = device.StartPrint(text, noOfCopy, ref errMsg);

            return(isPrinted);
        }
Exemple #3
0
        private bool Print()
        {
            text   = "";
            errMsg = "";
            bool isPrinted = false;

            GetSaleOrderText(so, list);
            IPrintToDevice device = PrintDeviceManager.GetPrintingDevice <BlueToothDeviceHelper> ();

            device.SetCallingActivity(callingActivity);
            device.SetIsPrintCompLogo(iSPrintCompLogo());
            isPrinted = device.StartPrint(text, noOfCopy, ref errMsg);

            return(isPrinted);
        }
Exemple #4
0
        public static IPrintToDevice GetPrintingDevice <T>()
        {
            string         USERDEFINE     = ((GlobalvarsApp)Application.Context).USERFUNCTION;
            string         pathToDatabase = ((GlobalvarsApp)Application.Context).DATABASE_PATH;
            IPrintToDevice intent         = null;
            AdPara         para           = DataHelper.GetAdPara(pathToDatabase);

            if (para.PrinterType == "Network POS Printer")
            {
                intent = GetPrintingDeviceEx <TCPDeviceHelper> ();
            }
            else
            {
                intent = GetPrintingDeviceEx <T> ();
            }
            return(intent);
        }
Exemple #5
0
        private bool Print()
        {
            text   = "";
            errMsg = "";
            bool   isPrinted      = false;
            string pathToDatabase = ((GlobalvarsApp)Application.Context).DATABASE_PATH;
            string userID         = ((GlobalvarsApp)Application.Context).USERID_CODE;

            text = GetInvoiceText_Template("invoiceNTax.vm", pathToDatabase, userID, inv, list);          //Get from template
            if (string.IsNullOrEmpty(text))
            {
                GetInvoiceText(inv, list);                  //take defaul is template is null
            }
            IPrintToDevice device = PrintDeviceManager.GetPrintingDevice <BlueToothDeviceHelper> ();

            device.SetCallingActivity(callingActivity);
            device.SetIsPrintCompLogo(iSPrintCompLogo());
            isPrinted = device.StartPrint(text, noOfCopy, ref errMsg);

            return(isPrinted);
        }
Exemple #6
0
        private static IPrintToDevice GetPrintingDeviceEx <T>()
        {
            string         USERDEFINE = ((GlobalvarsApp)Application.Context).USERFUNCTION;
            IPrintToDevice intent     = null;
            string         classname  = "wincom.mobile.erp" + "." + typeof(T).Name + "_" + USERDEFINE;

            try {
                Type cType = Type.GetType(classname, false, true);
                if (cType != null)
                {
                    intent = (IPrintToDevice )Activator.CreateInstance(cType);
                }
                else
                {
                    intent = (IPrintToDevice )Activator.CreateInstance(typeof(T));
                }
            } catch {
                if (intent == null)
                {
                    intent = (IPrintToDevice )Activator.CreateInstance(typeof(T));
                }
            }
            return(intent);
        }