Exemplo n.º 1
0
        /**
         *发送本机下挂的所有打印机
         *
         *
         */
        public static void SendPrinterPrice(Socket client, FileSendOnNet fson)
        {
            String orderid       = fson.GetProperty("orderid_suffix", "");
            String cmd           = fson.GetProperty("cmd", "");
            String asyncNotify_t = fson.GetProperty("ppneedasyncnotify", "false");

            if ("getprice".Equals(cmd))
            {
                if (!String.IsNullOrEmpty(orderid))
                {
                    PrintRecordItem pri = PrintSubmitItems.QueryId(orderid);
                    if (pri != null)
                    {
                        String price_t = pri.GetPriceJson();
                        client.Send(System.Text.Encoding.UTF8.GetBytes(price_t));
                        return;
                    }
                }
            }
            else if ("PrintDoc".Equals(cmd))
            {
                //已经付费---打印之
                if (!String.IsNullOrEmpty(orderid))
                {
                    PrintRecordItem pri = PrintSubmitItems.QueryId(orderid);
                    if (pri != null)
                    {
                        String result_t = pri.GetPrintCompletedJson();
                        client.Send(System.Text.Encoding.UTF8.GetBytes(result_t));
                        return;
                    }

                    if ("true".Equals(asyncNotify_t))
                    {
                        LogHelper.WriteLogError(typeof(PhonePcCommunication), "需要异步通知" + pri.WriteSubmitRecord2Disk(false));
                    }
                }
            }
            else
            {
            }
        }
Exemplo n.º 2
0
 public PrintRecordItem(FileSendOnNet sson)
 {
     /*-----------------------------------*/
     this._OrderId        = sson.GetOrderId();
     this._OrderId_Suffix = sson.GetOrderId_Suffix();
     this._UserName       = sson.GetUserName();
     this._HavePay        = sson.GetPrice2Pay();
     this._Price          = sson.GetPrice2Pay();
     this._FileFullPath   = sson.FileFullPath;
     /*-----------------------------------*/
     this._phoneNumber  = sson._PhoneNumber;
     this._phoneType    = sson._PhoneType;
     this._androidOs    = sson._OsNumber;
     this._PParamcopies = sson.PParamcopies;
     this._PParamcolor  = sson.PParamcolor;
     this._PParamRange  = sson.PParamRange;
     this._PParam2Paper = sson.PParam2Paper;
     this._Paper_Type   = "自动适应纸张大小";
     this._PrinterName  = sson.GetPrinterName();
     //this.PrinterDriveName = PrintLocal.GetPrinterDrivenName(this._PrinterName);
     this.PrinterDriveName = sson.GetPrinterDriveName();
     this._AsyncNofify     = sson.GetProperty("ppneedasyncnotify", "false");
 }