Ejemplo n.º 1
0
        /// <summary>
        /// Печатаем чек
        /// </summary>
        /// <param name="check">Строка для печати</param>
        /// <returns>Напечатался или нет</returns>
        public bool Print(string check)
        {
            switch (PrnModel)
            {
            case Model.T400:
                if (t400 == null)
                {
                    if (this.port != null)
                    {
                        t400 = new T400(this.port);
                    }
                    else
                    {
                        Initialize();
                    }
                }

                if (t400 == null)
                {
                    return(false);
                }

                return(t400.Print(check));

            case  Model.ICT:
                if (ict == null)
                {
                    if (this.port != null)
                    {
                        ict = new ICT(this.port);
                    }
                    else
                    {
                        Initialize();
                    }
                }
                if (ict == null)
                {
                    return(false);
                }

                return(ict.Print(check));

            case Model.VKP80:
                if (vkp == null)
                {
                    if (this.port != null)
                    {
                        vkp = new VKP80(this.port);
                    }
                    else
                    {
                        Initialize();
                    }
                }
                if (vkp == null)
                {
                    return(false);
                }


                return(vkp.Print(check));

            case Model.AV268:
                if (av == null)
                {
                    if (this.port != null)
                    {
                        av = new  AV286(this.port);
                    }
                    else
                    {
                        Initialize();
                    }
                }
                if (av == null)
                {
                    return(false);
                }

                return(av.Print(check));

            case Model.CITIZEN:
                if (cit == null)
                {
                    if (this.port != null)
                    {
                        cit = new Citizen(this.port);
                    }
                    else
                    {
                        Initialize();
                    }
                }
                if (cit == null)
                {
                    return(false);
                }

                return(cit.Print(check));

            case Model.TUP900:
                if (tup == null)
                {
                    if (this.port != null)
                    {
                        tup = new Tup900(this.port);
                    }
                    else
                    {
                        Initialize();
                    }
                }
                if (tup == null)
                {
                    return(false);
                }

                return(tup.Print(check));
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Печатаем чек
        /// </summary>
        /// <param name="check">Строка для печати</param>
        /// <returns>Напечатался или нет</returns>
        public bool Print(string check)
        {
            switch (PrnModel)
            {
            case Model.T400:
                if (t400 == null)
                {
                    if (this.port != null)
                    {
                        t400 = new T400(this.port);
                    }
                    else
                    {
                        Initialize("");
                    }
                }

                if (t400 == null)
                {
                    return(false);
                }

                return(t400.Print(check));

            case  Model.ICT:
                if (ict == null)
                {
                    if (this.port != null)
                    {
                        ict = new ICT(this.port);
                    }
                    else
                    {
                        Initialize("");
                    }
                }
                if (ict == null)
                {
                    return(false);
                }

                return(ict.Print(check));

            case Model.VKP80:
                if (vkp == null)
                {
                    if (this.port != null)
                    {
                        vkp = new VKP80(this.port);
                    }
                    else
                    {
                        Initialize("");
                    }
                }
                if (vkp == null)
                {
                    return(false);
                }


                return(vkp.Print(check));

            case Model.AV268:
                if (av == null)
                {
                    if (this.port != null)
                    {
                        av = new  AV286(this.port);
                    }
                    else
                    {
                        Initialize("");
                    }
                }
                if (av == null)
                {
                    return(false);
                }

                return(av.Print(check));

            case Model.CITIZEN:
                if (cit == null)
                {
                    if (this.port != null)
                    {
                        cit = new Citizen(this.port);
                    }
                    else
                    {
                        Initialize("");
                    }
                }
                if (cit == null)
                {
                    return(false);
                }

                return(cit.Print(check));

            case Model.TUP900:
                if (tup == null)
                {
                    if (this.port != null)
                    {
                        tup = new Tup900(this.port);
                    }
                    else
                    {
                        Initialize("");
                    }
                }
                if (tup == null)
                {
                    return(false);
                }

                return(tup.Print(check));

            case Model.PRIM21K:
                if (prim21k == null)
                {
                    if (this.port != null)
                    {
                        prim21k = new PRIM21KNF();
                        prim21k.Initialize(this.port);
                    }
                    else
                    {
                        Initialize("prim21k");
                    }
                }

                if (prim21k == null)
                {
                    return(false);
                }

                if (prim21k.PrintPND(check) == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(false);
        }