public static FileSendOnNet RcvFileRawData2Print(Socket client)
        {
            FileSendOnNet fileRcv = RcvFileRawData(client);

            if (fileRcv.mFileFullPath == null)
            {
                Debug.WriteLine("打印命令:未接受到完整文件");
            }
            else
            {
                PrintDocThread pdt = new PrintDocThread(fileRcv);
                pdt.StartPrint();
            }



            return(fileRcv);
        }
Пример #2
0
        /// <summary>
        /// 现阶段只打印一次
        /// </summary>
        /// <returns></returns>
        public String GetPrintCompletedJson()
        {
            lock (this) {
                JObject       jo_t    = new JObject();
                FileSendOnNet fileRcv = new FileSendOnNet();
                fileRcv.Parse4PrintRecord(this);

                if (this.PrintOnce == true)
                {
                    jo_t.Add("result", "fali");
                    jo_t.Add("ServerInfo", "has print once");
                    return(jo_t.ToString());
                }

                if (fileRcv.mFileFullPath == null)
                {
                    jo_t.Add("result", "fali");
                    jo_t.Add("ServerInfo", "no file");
                }
                else
                {
                    PrintDocThread pdt      = new PrintDocThread(fileRcv);
                    String         reslut_t = pdt.PrintDocment();
                    if (String.IsNullOrEmpty(reslut_t))
                    {
                        jo_t.Add("result", "success");
                        this.PrintOnce = true;
                    }
                    else
                    {
                        jo_t.Add("result", "fali");
                        jo_t.Add("ServerInfo", reslut_t);
                    }
                }
                //jo_t.Add("price2pay", this._Price);
                return(jo_t.ToString());
            }
        }