public static BDCFilterResult ImportFromFC(string slbh, string userName) { BDCFilterResult res = new BDCFilterResult(); int count = 0; FC_REWRITE_TAG tag = new FC_REWRITE_TAG(); string FCslbh = GetRealSLBH(slbh); //string slbh = row[0].ToString(); try { if (CanImport(FCslbh)) { ImportFCDA(slbh, FCslbh, userName, ref count); tag.FILECOUNT = count.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "1"; tag.MESSAGE = "成功"; res.ConfirmType = 0; res.IsSuccess = true;; res.Message = tag.MESSAGE; } else { res.ConfirmType = 0; res.IsSuccess = false; res.Message = "图像尚未扫描入库!"; } } catch (Exception ex) { res.ConfirmType = 0; res.IsSuccess = false; res.Message = ex.Message; tag.FILECOUNT = count.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "0"; tag.MESSAGE = "失败!" + ex.Message; } finally { if (null != tag && null != tag.ID) { ImportDAL.InsertLog(tag); } } //IsSuccess = true; return(res); }
internal static BDCFilterResult ImportQSPic(string base64Str, string sLBH, string userName) { BDCFilterResult res = new BDCFilterResult(); int count = 0; FC_REWRITE_TAG tag = new FC_REWRITE_TAG(); //string slbh = row[0].ToString(); try { if (CanImportPic(sLBH)) { ImportQS(base64Str, sLBH, userName); tag.FILECOUNT = count.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = sLBH; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "1"; tag.MESSAGE = "成功"; res.ConfirmType = 0; res.IsSuccess = true;; res.Message = tag.MESSAGE; } else { res.ConfirmType = 0; res.IsSuccess = false; res.Message = "无完税信息!"; } } catch (Exception ex) { res.ConfirmType = 0; res.IsSuccess = false; res.Message = ex.Message; tag.FILECOUNT = count.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = sLBH; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "0"; tag.MESSAGE = "失败!" + ex.Message; } finally { if (null != tag && null != tag.ID) { ImportDAL.InsertLog(tag); } } //IsSuccess = true; return(res); }
/// <summary> /// /// </summary> /// <param name="IsCL"></param> /// <returns></returns> public static BDCFilterResult ImportFromFC(bool IsCL) { int fileCount = 0; bool IsSuccess = false; BDCFilterResult res = new BDCFilterResult(); DataTable dt = null; if (IsCL) { dt = ImportBLL.GetCLSLBH(); } else { dt = ImportDAL.GetPushedSLBH(); } if (null != dt && dt.Rows.Count > 0) { FC_REWRITE_TAG tag = new FC_REWRITE_TAG(); foreach (DataRow row in dt.Rows) { string slbh = row[0].ToString(); string fcslbh = ""; if (CanImport(slbh)) { try { List <DOC_BINFILE> doc_bin = GetDoc_Binfile(slbh, fcslbh); if (UseFtp.Equals("是") || UseFtp.ToLower().Equals("true")) { if (null != doc_bin && doc_bin.Count > 0) { fileCount = doc_bin.Count; foreach (DOC_BINFILE item in doc_bin) { tag.FILENAME += tag.FILENAME != null ? item.FILENAME : ("," + item.FILENAME); //using (TransactionScope ts = new TransactionScope()) //{ UploadToFtp(slbh, item); item.FTPATH = ChangeFTPPath(item.FTPATH); ImportDAL.InsertDoc_binfile(item); //ts.Complete(); //} } tag.FILECOUNT = fileCount.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "1"; tag.MESSAGE = "成功"; IsSuccess = true; ImportDAL.InsertLog(tag); } else { tag.FILECOUNT = fileCount.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "0"; tag.MESSAGE = "失败!不动产库中无此受理编号记录。"; //IsSuccess = true; ImportDAL.InsertLog(tag); } } else { DOC_FILE doc_file = GetDoc_file(slbh); ImportDAL.InsertDoc_File(doc_file); } } catch (Exception ex) { tag.FILECOUNT = fileCount.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "0"; tag.MESSAGE = "失败!" + ex.Message; ImportDAL.InsertLog(tag); continue; } } } res.ConfirmType = 0; res.IsSuccess = IsSuccess; res.Message = tag.MESSAGE; } return(res); }
public static BDCFilterResult ImportFromFC(string slbh) { int fileCount = 0; bool IsSuccess = false; BDCFilterResult res = new BDCFilterResult(); FC_REWRITE_TAG tag = new FC_REWRITE_TAG(); string FCslbh = GetRealSLBH(slbh); //string slbh = row[0].ToString(); if (CanImport(FCslbh)) { try { List <DOC_BINFILE> doc_bin = GetDoc_Binfile(slbh, FCslbh); if (UseFtp.Equals("是") || UseFtp.ToLower().Equals("true")) { if (null != doc_bin && doc_bin.Count > 0) { fileCount = doc_bin.Count; //using (TransactionScope ts = new TransactionScope()) //{ foreach (DOC_BINFILE item in doc_bin) { try { tag.FILENAME += tag.FILENAME != null ? item.FILENAME : ("," + item.FILENAME); UploadToFtp(FCslbh, item); //item.FTPATH = ChangeFTPPath(item.FTPATH); if (ImportDAL.ExistDoc_binfile(item)) { ImportDAL.UpDateDoc_binfile(item); } else { ImportDAL.InsertDoc_binfile(item); } } catch { continue; } } //ts.Complete(); //} tag.FILECOUNT = fileCount.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "1"; tag.MESSAGE = "成功"; IsSuccess = true; ImportDAL.InsertLog(tag); } else { tag.FILECOUNT = fileCount.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "0"; tag.MESSAGE = "失败!不动产库中无此受理编号记录。"; //IsSuccess = true; ImportDAL.InsertLog(tag); } } } catch (Exception ex) { tag.FILECOUNT = fileCount.ToString(); //tag.FILENAME =doc_bin[0].BINID tag.ID = Guid.NewGuid().ToString(); tag.SLBH = slbh; tag.PUSHDATE = DateTime.Now; tag.ISSUCCESS = "0"; tag.MESSAGE = "失败!" + ex.Message; ImportDAL.InsertLog(tag); } res.ConfirmType = 0; res.IsSuccess = IsSuccess; res.Message = tag.MESSAGE; } else { res.ConfirmType = 0; res.IsSuccess = false; res.Message = "失败!图像尚未扫描入库!"; } return(res); }