public void PrintDocment() { String error_str; this.Wait(); #if true bool Success = false; #if true Success = printerOnLocal.PrintDocment(); #endif if (Success == false) { #if true /*---本地打印失败-----*/ try { Success = printerOnNet.PrintDocment(); }catch (Exception e) { LogHelper.WriteLog(this.GetType(), e); } #endif } LibCui.DeleteFile(file.mFileFullPath); LibCui.DeleteFile(file.GetPCLprnfullPath()); #endif this.Release(); if (Success == true) { PrintRecord pp = new PrintRecord(); pp.WriteRecord2Disk(file); } }
public String PrintDocment() { String error_str_t = null; this.Wait(); Debug.WriteLine(">>>>>>>>>进入打印+/n" + file.GetFileName()); LogHelper.WriteLog(this.GetType(), i++.ToString()); LogHelper.WriteLog(this.GetType(), ">>>>>>>>>进入打印+/n" + file.GetFileName()); #if true bool Success = false; #if true Success = printerOnLocal.PrintDocment(); #endif if (Success == false) { LogHelper.WriteLog(this.GetType(), "本地打印【失败】"); error_str_t = "机器故障"; #if USE_NET /*---本地打印失败-----*/ try { Success = printerOnNet.PrintDocment(); }catch (Exception e) { LogHelper.WriteLog(this.GetType(), e); } #endif } else { LogHelper.WriteLog(this.GetType(), "本地打印【成功】"); } /* if (false||LibCui.DeleteFileForce(file.mFileFullPath)) * { * LogHelper.WriteLog(this.GetType(), "文件【已删除】"); * } * else { * LogHelper.WriteLog(this.GetType(), "文件【删除失败】"); * }*/ // LibCui.DeleteFile(file.GetPCLprnfullPath()); #endif if (Success == true) { //打印成功-- PrintRecord pp = new PrintRecord(); pp.WriteRecord2Disk(file); // PcCloudComm.Notify_Thread(); } Debug.WriteLine("<<<<<<<<<<<退出打印"); LogHelper.WriteLog(this.GetType(), "<<<<<<<<<<<退出打印"); this.Release(); return(error_str_t); }
private void timerUpdataData_Tick(object sender, EventArgs e) { List <PrintRecordItem> pRi_new = PrintRecord.ReadAllRecord(); if (pRi_new.Count == this.pRi.Count) { } else { this.AddListView(this.listViewData, pRi_new); this.pRi = pRi_new; } }
/**/ public ListViewItem GetListView() { ListViewItem LVI = new ListViewItem(this._PrinterName); // LVI.SubItems.Clear(); // LVI.SubItems.Add(this._phoneNumber); LVI.SubItems.Add(this._phoneNumber); LVI.SubItems.Add(this._phoneType); LVI.SubItems.Add(this._androidOs); LVI.SubItems.Add(this._PParamcopies.ToString()); LVI.SubItems.Add((this._PParamcolor == true)?"彩色":"黑白"); LVI.SubItems.Add(this._PParamRange); LVI.SubItems.Add((this._PParam2Paper == false)?"单面":"双面"); LVI.SubItems.Add(this._Paper_Type); LVI.SubItems.Add(this._TimeCompete); return(LVI); } /** */ public String GetFileFullPath_SubmitPath() { String forderData = _DateTimeSubmit.ToString("yyyy年MM月dd日"); String hour = _DateTimeSubmit.ToString("HH时"); string Fullpath = PrintRecord.GetRootPath() + forderData + "\\" + hour + "\\"; if (!Directory.Exists(Fullpath)) { Directory.CreateDirectory(Fullpath); } string FileFullpath = Fullpath + PrintRecord.FileName_Submit_Order; return(FileFullpath); }
/// <summary> /// 保存到,未付款打印队列 /// </summary> /// <param name="client"></param> /// <returns></returns> public static FileSendOnNet RcvFileRawData2Save_NoPay(Socket client) { FileSendOnNet fileRcv = RcvFileRawData(client); if (fileRcv.mFileFullPath == null) { } else { //文件拷贝带走。 //OpenFileInExploer(fileRcv); //保存到提交记录 PrintRecord pp = new PrintRecord(); pp.WriteSubmitRecord2Disk_NoPay(fileRcv); } return(fileRcv); }
private void AddData2List() { pRi = PrintRecord.ReadAllRecord(); this.AddListView(this.listViewData, pRi); }