void FilePrintEvent(List <string> value) { NameValueCollection data = new NameValueCollection { { "sourceclient", "PC" } }; Bll.AUFileDocument document = new AUFileDocument(); string temVal = document.AUDiskFilePrint(AccountInfo.Token, value.ToArray(), data); JObject jo = (JObject)JsonConvert.DeserializeObject(temVal); if (JObjectHelper.GetStrNum(jo["code"].ToString()) == 200) { //FileHelper.FileCount = jo["dataList"]["previewImgs"].Count(); FileHelper.FileCount = jo["dataList"]["filePageSection"].ToString().Split('-')[1].GetInt(); FileHelper.FileUrl = RequestAddress.server + jo["dataList"]["pdfUrl"]; FileHelper.OrderId = jo["dataList"]["id"].ToString(); FileHelper.OrderNo = jo["dataList"]["orderNo"].ToString(); FileHelper.OrderState = JObjectHelper.GetStrNum(jo["dataList"]["orderState"].ToString()); FileHelper.LocalFileDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "filetemporary"); FileHelper.LocalFilePath = Path.Combine(FileHelper.LocalFileDirectory, jo["dataList"]["fileName"].ToString()); DispatcherHelper.CheckBeginInvokeOnUI(() => { (new FilePreView()).Show(); }); } else { DispatcherHelper.CheckBeginInvokeOnUI(() => { MessageBox.Show(jo["message"].ToString()); }); } RunState = false; }
/// <summary> /// 获取同步文件列表 /// </summary> void GetTrayFileList() { ThreadPool.QueueUserWorkItem((obj) => { RunState = true; EmptyIsShow = false; Bll.AUFileDocument document = new AUFileDocument(); string temVal = document.GetTransferAUDiskFile(AccountInfo.Token, AccountInfo.ID); JObject jo = (JObject)JsonConvert.DeserializeObject(temVal); if (JObjectHelper.GetStrNum(jo["code"].ToString()) == 200) { DispatcherHelper.CheckBeginInvokeOnUI(() => { UnDownload.Clear(); int index = 0; for (int i = 0; i < jo["dataList"].Count(); i++) { UnDownload.Add(new Model.TrayHistory() { Index = index + 1, FileUrl = RequestAddress.server + jo["dataList"][i]["fileUrl"], Id = jo["dataList"][i]["ID"].ToString(), FileName = Path.GetFileName(jo["dataList"][i]["fileUrl"].ToString()), CreateDate = DateTime.Now, CanDownload = true, DownTextShow = true }); index++; EmptyIsShow = false; } }); } RunState = false; }); }
void UploadFileEvent(List <string> value) { NameValueCollection data = new NameValueCollection { { "sourceClient", "PC" }, { "audiskflag", "audiskpc" } }; Bll.AUFileDocument document = new AUFileDocument(); string temVal = document.AUDiskFilesCloud(AccountInfo.Token, value.ToArray(), data); JObject jo = (JObject)JsonConvert.DeserializeObject(temVal); if (JObjectHelper.GetStrNum(jo["code"].ToString()) == 200) { for (int i = 0; i < value.Count; i++) { XElement File = new XElement("File"); //File.SetElementValue("Id", UnDownload[Index].Id); File.SetElementValue("FileName", Path.GetFileName(value[i].ToString())); File.SetElementValue("FileUrl", value[i].ToString()); //File.SetElementValue("DownLoadPath", Path.Combine(localDownload, UnDownload[Index].FileName)); File.SetElementValue("CreateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm")); FileOperationHelper.WriteXml(History, File); } DispatcherHelper.CheckBeginInvokeOnUI(() => { Delete(LocalTray); var trayUpload = PageTrayHistoryUploadedViewModel.GetInstance(); ThreadPool.QueueUserWorkItem(delegate { SynchronizationContext.SetSynchronizationContext( new System.Windows.Threading.DispatcherSynchronizationContext(System.Windows .Application .Current.Dispatcher)); SynchronizationContext.Current.Post(p => { trayUpload.GetLocalTrayHistoryUploaded(); }, null); }); }); } else { DispatcherHelper.CheckBeginInvokeOnUI(() => { MessageBox.Show(jo["message"].ToString()); }); } RunState = false; }
void DelNoTransferAUDiskFile(string id) { AUFileDocument document = new AUFileDocument(); document.DelNoTransferAUDiskFile(AccountInfo.Token, id); }