public HotelImageJson Get(string searchid, string HotelCode, string curcode) { string rvalue = ""; string ContextResult = ""; DataTable dtHotelUrl = HotelDBLayer.GetHotelImageUrl(HotelCode); if (dtHotelUrl.Rows.Count > 0) { hij.Image = dtHotelUrl.Rows[0]["ImageUrl"].ToString(); hij.Logo = dtHotelUrl.Rows[0]["Logourl"].ToString(); return(hij); } else { string filePathContext = Path.Combine(HttpRuntime.AppDomainAppPath, "HotelXML/" + searchid + "_" + curcode + "_ContextChange-RS.xml"); if (File.Exists(filePathContext)) { ContextResult = File.ReadAllText(filePathContext); } else { ContextResult = XMLRead.ContextChange(searchid); } HotelImageAj hotelimage = new HotelImageAj(HotelCode, "", searchid, ContextResult); string image = hotelimage.Image; string logo = hotelimage.logo; HotelDBLayer.SaveHotelImageUrl(HotelCode, image, logo); hij.Image = image; hij.Logo = logo; return(hij); } }
private string GetHotels(string sc, string searchid) { string rq = ""; //pcc = "VL5H"; //ipcc = "7A7H"; ; //username = "******"; //password = "******"; //result = XMLRead.ContextChange(pcc,ipcc,username,password,searchid); result = XMLRead.ContextChange(searchid); ContextResult = result; if (result.ToString() != "") { DataSet ds = new DataSet(); DataSet dsSession = new DataSet(); StringReader se_stream = new StringReader(result); dsSession.ReadXml(se_stream); string Rq = ""; if (dsSession.Tables["BinarySecurityToken"] != null) { DataTable dtBinarySecurityToken = dsSession.Tables["BinarySecurityToken"]; DataTable dtMessageData = dsSession.Tables["MessageData"]; DataTable dtMessageHeader = dsSession.Tables["MessageHeader"]; string timestamp = DateTime.UtcNow.ToString(); rq = GetRq(dtBinarySecurityToken, dtMessageData, dtMessageHeader, sc); result = XMLRead.SendQuery(rq); XMLRead.SaveXMLFile(rq, result, searchid + "_hotelsAvail"); } } return(result); }
public PNRData(string searchid, CustomerInfo ci, string rph, string ContextResult, string BookinID) { //string filePathContext = Path.Combine(HttpRuntime.AppDomainAppPath, "HotelXML/" + searchid + "_ContextChange-RS.xml"); //if (File.Exists(filePathContext)) //{ // ContextResult = File.ReadAllText(filePathContext); //} //else //{ // ContextResult = XMLRead.ContextChange(searchid); //} string result = ""; int rphl = rph.ToString().Length; if (rphl == 1) { rph = "0" + rph.ToString(); } string RateBodyRQ = GetRateDescBodyRQ(rph); string PassengerBodyRQ = GetPassengerBodyRQ(ci); string HoteResBodyRQ = GetHotelResBodyRQ(ci, rph); string RateRQ = GetRateDescRQ(ContextResult, RateBodyRQ); result = XMLRead.SendQuery(RateRQ); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_RateDesec"); string PassengerRQ = GetPassengerXMLRQ(result, PassengerBodyRQ); result = XMLRead.SendQuery(PassengerRQ); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_PassengerDet"); string HotelResRq = GetHotelResXMLRQ(result, HoteResBodyRQ); result = XMLRead.SendQuery(HotelResRq); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_HotelResDet"); string EndTransRQ = GetEndTransRQ(result); result = XMLRead.SendQuery(EndTransRQ); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_EndTrans"); string EndTransXML = result; Hes = new HotelEndTrans(EndTransXML); if (result.ToString() != "") { DataSet ds = new DataSet(); DataSet dsSession = new DataSet(); StringReader se_stream = new StringReader(result); dsSession.ReadXml(se_stream); string Rq = ""; if (dsSession.Tables["BinarySecurityToken"] != null) { DataTable dtBinarySecurityToken = dsSession.Tables["BinarySecurityToken"]; DataTable dtMessageData = dsSession.Tables["MessageData"]; DataTable dtMessageHeader = dsSession.Tables["MessageHeader"]; string timestamp = DateTime.UtcNow.ToString(); string cresult = XMLRead.closession(dtMessageData.Rows[0]["MessageId"].ToString(), timestamp, dtBinarySecurityToken.Rows[0]["BinarySecurityToken_Text"].ToString(), searchid + "_PNREndTrans", XMLRead.pcc, XMLRead.ipcc); } } }
public static void ExportJTCYTable(IList <JTCY> hzs, string saveDirPath) { Dictionary <int, XMLTable> xmlJtcyDkDic = XMLRead.GetXmlToXMLTabl("Model/JTCY.Excel.hbm.xml"); XMLTable xmlTable = xmlJtcyDkDic[0]; IWorkbook workbook = ExcelRead.ReadExcel("ChengDuGaoXingZaiJiDiModel/家庭成员表模板.xls"); ISheet sheet = workbook.GetSheetAt(0); List <JTCY> jtcys = new List <JTCY>(); foreach (JTCY hz in hzs) { jtcys.AddRange(hz.JTCies); } ExcelWrite.WriteObjects(sheet, xmlTable, jtcys); //合并户主的单元格 int rowIndex = xmlTable.RowStartIndex; foreach (JTCY hz in hzs) { ExcelWrite.SetValue(sheet.GetRow(rowIndex), 0, rowIndex - 4 + ""); ExcelWrite.SetValue(sheet.GetRow(rowIndex), 1, hz.XM); int lastRow = rowIndex + hz.JTCies.Count; sheet.AddMergedRegion(new CellRangeAddress(rowIndex, lastRow - 1, 0, 0)); sheet.AddMergedRegion(new CellRangeAddress(rowIndex, lastRow - 1, 1, 1)); rowIndex = lastRow; } ExcelWrite.Save(workbook, saveDirPath + "\\家庭成员表.xls"); }
public void ExportZu_ZhiJieRenShenFengZhengMing(JTSYQ jtsyq, string saveDir) { //得到四至涉及单位 /*string str = "510185047009JA00008".Replace("510185",""); * var v = str.Insert(3, "-"); * var v1 = v.Insert(7, "-"); * var v2 = v1.Insert(10, "-");*/ List <XZDM> xzdms = new List <XZDM>(); foreach (JTSYQ tem in jtsyq.GroupJTSYQ) { xzdms.AddRange(JTSYQCustom.GetSZInXZDM(tem)); } //得到行政代码表 foreach (XZDM xzdm in xzdms) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.ZhiJieRenZhengMing); WordWrite.ReplaceText(doc, ClazzDic, xzdm); //查看是村不是组 if (Utils.IsStrNull(xzdm.CunZu)) { WordWrite.SaveToFile(doc, saveDir + "/04指界人身份证明及指界委托书" + xzdm.Cun + ".doc"); } else { WordWrite.SaveToFile(doc, saveDir + "/04指界人身份证明及指界委托书/" + xzdm.CunZu + ".doc"); } } }
public MainVM() { ClassClassrooms = XMLRead.ReadClassroom(Path.ClassroomXml).ToArray(); ClassGroups = XMLRead.ReadGroup(Path.GroupXml).ToArray(); ClassTeachers = XMLRead.ReadTeacher(Path.TeacherXml).ToArray(); ClassSubjects = XMLRead.ReadSubject(Path.SubjectXml).ToArray(); ClassDepartments = XMLRead.ReadDepartment(Path.DepartmentXml).ToArray(); Data = new ObservableCollection <ObservableCollection <DropItem> >(); for (int i = 0; i < maxpair; i++) { Data.Add(new ObservableCollection <DropItem>()); } openCommand = this.Factory.CommandSync(Open); saveToExcel = this.Factory.CommandSync(ExportToExcel); selectCommand = this.Factory.CommandSyncParam <int>(Transform); closeWinCommand = this.Factory.CommandSync(Close); clearCommand = this.Factory.CommandSync(Clear); index = this.Factory.Backing <RowColumnIndex?>(nameof(Index), null); departmentIndex = this.Factory.Backing <int>(nameof(DepartmentIndex), 0); Columns = new ObservableCollection <string>(); Rows = new ObservableCollection <PairInfo>(); Init(); }
public void btnWrite() { XMLRead bxXMLRead = new XMLRead("Boxian.xml"); bxXMLRead.Read(); XmlDocument doc = bxXMLRead.XMLdoc; XmlNode root = doc.SelectSingleNode("Missions"); XmlElement Mission = doc.CreateElement("Mission_" + bxIndex.ToString()); XmlElement Log = doc.CreateElement("Log"); Log.InnerText = "第" + (bxIndex + 1).ToString() + "步"; XmlElement AxisAngles = doc.CreateElement("AxisAngles"); for (int i = 0; i < 6; i++) { XmlElement Axisangle = doc.CreateElement("Axis_" + i.ToString() + "_angle"); Axisangle.InnerText = temp_Pos[i].ToString(); AxisAngles.AppendChild(Axisangle); } XmlElement IO = doc.CreateElement("IO"); IO.InnerText = "-1"; Mission.AppendChild(Log); Mission.AppendChild(AxisAngles); Mission.AppendChild(IO); root.AppendChild(Mission); doc.Save(bxXMLRead.path); bxIndex++; }
/// <summary> /// /// </summary> /// <param name="path"></param> /// <param name="sheetIndex"></param> /// <param name="TitelRowIndex"></param> /// <param name="EndRowIndex">此行要读取,默认是最后一行</param> public ExcelReflectModel(string excelPath, string path, int sheetIndex = 0, int TitelRowIndex = 0, int StartRowIndex = 1, int EndRowIndex = -1) { if (!Utils.CheckFileExists(excelPath)) { throw new Exception("文件不存在:" + excelPath); } if (!Utils.CheckFileExists(path)) { throw new Exception("文件不存在:" + path); } Sheet = ExcelRead.ReadExcelSheet(excelPath, sheetIndex); this.PropertDic = XMLRead.GetConfigXmlDic(path, "property", "name", "column"); //this.TitelRowIndex = TitelRowIndex; this.ClazzDic = ReflectUtils.MethodToFunction <T>(); this.TitleDic = GetTitleDic(Sheet.GetRow(TitelRowIndex), this.PropertDic, this.ClazzDic); if (EndRowIndex == -1) { this.LastRowIndex = Sheet.LastRowNum; } else { this.LastRowIndex = EndRowIndex; } this.StartRowIndex = StartRowIndex; }
public RatecommentsAj(string searchid, string ratecommentid) { string result = string.Empty; string[] ratecommentidlst; string HRoomRatecomBodyRS = GetHotelResBodyRQ(searchid, ratecommentid); result = XMLRead.GetResponse(HRoomRatecomBodyRS); RateCommentdto objRateCommentdto = new RateCommentdto(); ratecommentidlst = ratecommentid.Split('|'); XMLRead.SaveJSONTextFile(HRoomRatecomBodyRS, result, searchid + "_" + ratecommentidlst[1] + "_RoomRatecomment"); string filePathRQ = Path.Combine(HttpRuntime.AppDomainAppPath, "HotelRRatecomments/" + searchid + "_" + ratecommentidlst[1] + "_RoomRatecomment" + "-RS.json"); using (StreamReader r = new StreamReader(filePathRQ)) { string json = r.ReadToEnd(); objRateCommentdto = JsonConvert.DeserializeObject <RateCommentdto>(json); } if (objRateCommentdto.rateComments.Count > 0) { Ratecommentdescription = objRateCommentdto.rateComments[0].description; } }
/// <summary> /// 替换文字内容 /// </summary> /// <param name="sheet"></param> /// <param name="groupJTSYQ"></param> /// <param name="xmlobjectDic"></param> public static void ReplaceTextByXMLObject(ISheet sheet, object obj, Dictionary <string, XMLObject> xmlobjectDic) { foreach (IRow row in sheet) { foreach (ICell cell in row) { if (cell.CellType == CellType.String) { string cellValue = cell.StringCellValue; if (cellValue.Contains("[")) { foreach (string method in xmlobjectDic.Keys) { if (cellValue.Contains(method)) { Object value = XMLRead.GetObjectMethodResult(xmlobjectDic[method], obj); if (value != null) { cellValue = cellValue.Replace("[" + method + "]", value.ToString()); } else { cellValue = cellValue.Replace("[" + method + "]", ""); } cell.SetCellValue(cellValue); } } } } } } }
private void ShowOpenFileDialog() { OpenFileDialog ofd = new OpenFileDialog(); { ofd.FilterIndex = 2; ofd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"; if (String.IsNullOrEmpty(previousPath)) { ofd.InitialDirectory = Path.GetFileName(Environment.CurrentDirectory); } else { ofd.InitialDirectory = previousPath; } if (ofd.ShowDialog() == DialogResult.OK) { try { XMLRead xr = new XMLRead(ofd.FileName, this); sysData = xr.sysData; geoTex = xr.geo; columnMaterial = xr.columnMaterial; soilList = xr.soilLayer; show_Results(); } catch (Exception ex) { MessageBox.Show($"Security error.\n\nError message: {ex.Message}\n\n" + $"Details:\n\n{ex.StackTrace}"); } } } }
public void ExportJZDTable(JTSYQ GroupJTSYQ, string dir) { JTSYQCustom.OrderByJZDH(GroupJTSYQ); List <JZD> jzds = new List <JZD>(); double pingFangArea = 0; foreach (JTSYQ jtsyq in GroupJTSYQ.GroupJTSYQ) { pingFangArea += Decimal.ToSingle(decimal.Round(new decimal(jtsyq.Shape_Area), 2)); IList <JZD> temp = jtsyq.JZDS; if (temp == null) { return; } jzds.AddRange(temp); } double area = GroupJTSYQ.Area; GroupJTSYQ.Area = Math.Round(pingFangArea, 2); ISheet sheet = JZDCustom.CreateJZDSheet(jzds); sheet.Workbook.SetSheetName(0, GroupJTSYQ.BM); Dictionary <string, XMLObject> xmlobjectDic = XMLRead.XmlToObjects(JTSYQCustom.JZDXMLRelfect, false); ExcelWrite.ReplaceTextByXMLObject(sheet, GroupJTSYQ, xmlobjectDic); Dictionary <string, XMLObject> xmlobjectDic2 = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); ExcelWrite.ReplaceTextByXMLObject(sheet, GroupJTSYQ.XZDM, xmlobjectDic2); ExcelWrite.Save(sheet.Workbook, dir + "\\06界址点成果表" + GroupJTSYQ.XZDM.Zu + ".xls"); GroupJTSYQ.Area = area; }
public static IList <T> TextToObject <T>(string path, string xmlConfig, Regex reg) { Dictionary <String, String> filedDic = XMLRead.GetConfigXmlDic(xmlConfig, "property", "key", "value"); IList <T> list = TextToObject <T>(path, filedDic, reg); return(list); }
public static IList <T> GetExcelToObject <T>(ISheet sheet, string XMLPath) { XMLTable xmlTable = XMLRead.GetXmlToXMLTabl(XMLPath)[0]; ExcelReflectModel <T> reflectModel = new ExcelReflectModel <T>(sheet, xmlTable); IList <T> list = ExcelUtils.SheetToObjectsByXMLTable <T>(reflectModel); return(list); }
public static IList <JTTDSYQZ> GetJTTDSYQZS(string excelPath) { XMLTable xmlTable = XMLRead.GetXmlToXMLTabl(ExcelRelect)[0]; ExcelReflectModel <JTTDSYQZ> model = new ExcelReflectModel <JTTDSYQZ>(excelPath, xmlTable); IList <JTTDSYQZ> list = ExcelUtils.SheetToObjectsByXMLTable <JTTDSYQZ>(model); return(list); }
public void ExportCunDangAnDai(XZDM xzdm, string saveDir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects_get <XZDM>(); var doc = WordRead.Read(JTSYQCustom.CunDangAnDaiTemplete); WordWrite.ReplaceText(doc, ClazzDic, xzdm); WordWrite.SaveToFile(doc, saveDir + "//00档案袋.doc"); }
public void ExportCunYiJianFanKuaiShu(XZDM xzdm, string dir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.FanKuiYiJianShuXMLRelfect, false); var doc = WordRead.Read(JTSYQCustom.FanKuiYiJianShu); WordWrite.ReplaceText(doc, ClazzDic, xzdm); WordWrite.SaveToFile(doc, dir + "//" + System.IO.Path.GetFileName(JTSYQCustom.FanKuiYiJianShu)); }
public void ExportZu_TuDiQuanShuLaiYuanZhengMing(JTSYQ jtsyq, string saveDir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); var doc = WordRead.Read(JTSYQCustom.Zu_TuDiQuanShuLaiYuanZhengMing); WordWrite.ReplaceText(doc, ClazzDic, jtsyq); WordWrite.SaveToFile(doc, saveDir + "/01土地权属来源证明" + jtsyq.XZDM.XiangZheng + jtsyq.XZDM.CunZu + "(" + jtsyq.XZDM.DJZQDM + ").doc"); }
public void ExportZu_FaRenDaiBiaoShenFengZhengMing(XZDM xzdm, string saveDir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.FaRenDaiBiaoShenFengZhengMing); WordWrite.ReplaceText(doc, ClazzDic, xzdm); WordWrite.SaveToFile(doc, saveDir + "/02法人代表身份证明" + xzdm.Zu + ".doc"); }
public void ExportCunJieGuo_GongShi(XZDM xzdm, string dir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.JieGuo_GongShi); xzdm.SetZuMiaoShu(); WordWrite.ReplaceText(doc, ClazzDic, xzdm); WordWrite.SaveToFile(doc, dir + "//" + System.IO.Path.GetFileName(JTSYQCustom.JieGuo_GongShi)); }
public void ExportZu_FaRenDaiBiaoWeiTuoShu(XZDM xzdm, string saveDir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.FaRenDaiBiaoWeiTuoShu); WordWrite.ReplaceText(doc, ClazzDic, xzdm); //查看是村不是组 WordWrite.SaveToFile(doc, saveDir + "/03法人代表授权委托书" + xzdm.Zu + ".doc"); }
/// <summary> /// 对象写入 row /// </summary> /// <param name="obj"></param> /// <param name="row"></param> /// <param name="xmlDic"></param> public static void WriteRowObject(object obj, IRow row, Dictionary <int, XMLObject> xmlDic) { foreach (int index in xmlDic.Keys) { XMLObject xmlObject = xmlDic[index]; object result = XMLRead.GetObjectMethodResult(xmlObject, obj); SetValue(row, index, result); } }
public static void ExportJSYDTable(IList <JSYD> jsyds, string saveDirPath) { string jsydExcelPath = "ChengDuGaoXingZaiJiDiModel/建设用地表共用宗模板.xls"; Dictionary <int, XMLTable> xmlJtcyDkDic = XMLRead.GetXmlToXMLTabl("Model/JSYD.Excel.hbm.xml"); IWorkbook workbook = ExcelRead.ReadExcel(jsydExcelPath); ISheet sheet = workbook.GetSheetAt(0); ExcelWrite.WriteObjects <JSYD>(sheet, xmlJtcyDkDic[0], jsyds); ExcelWrite.Save(workbook, saveDirPath + "\\建设用地表.xls"); }
static void Main(string[] args) { XMLWrite test = new XMLWrite(); test.WriteXML(); XMLRead test2 = new XMLRead(); test2.ReadXML(); Console.ReadLine(); }
public void AddDataTree(string key, string fName, BPlusTree <string, String> .OptionsV2 treeData) { using (var tree = new BPlusTree <string, String>(treeData)) { tree.Add(key, fName); tree.TryGetValue(key, out string cmpDate); var xmlNAME = new XMLRead(); xmlNAME.ReadXmlData(cmpDate); } }
public string GetImageXMLContext(string Hotelcode, string searchid, string ContextResult) { XMLRead xmlHotelImage = new XMLRead(); string rq = ""; string result = ""; // rq = GetXMLRQ(ContextResult, Hotelcode); // result = XMLRead.SendQuery(rq); //// XMLRead.SaveXMLFile(rq, result, searchid + "_hotelsImage" + "_" + Hotelcode); return(result); }
public string GetMediaXMLContext(string Hotelcode, string searchid, string ContextResult, string b2c_idn) { //XMLRead xmlHotelImage = new XMLRead(); XMLRead.GetPccDetails(b2c_idn); string rq = ""; string result = ""; ////rq = GetMediaXMLRQ(ContextResult, Hotelcode); ////result = XMLRead.SendQuery(rq); //XMLRead.SaveXMLFile(rq, result, searchid + "_Media" + "_" + Hotelcode); return(result); }
public void ExportZu_DangAnDai(JTSYQ jtsyq, string saveDir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.Zu_DangAnDai); XZDM xzdm = jtsyq.XZDM; WordWrite.ReplaceText(doc, ClazzDic, xzdm); Dictionary <string, XMLObject> ClazzDic2 = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); WordWrite.ReplaceText(doc, ClazzDic2, jtsyq); WordWrite.SaveToFile(doc, saveDir + "/00" + xzdm.XiangZheng + xzdm.CunZu + "(" + xzdm.DJZQDM + ")_1档案袋.doc"); }
public void ExportZu_ShenPiBiao(JTSYQ jtsyq, string saveDir) { //JTSYQCustom.SetContainsFeatureArea(jtsyq); XZDM xzdm = jtsyq.XZDM; Dictionary <string, XMLObject> xzdmDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.ShenPiaoBiao); WordWrite.ReplaceText(doc, xzdmDic, xzdm); Dictionary <string, XMLObject> jtsyqDic = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); WordWrite.ReplaceText(doc, jtsyqDic, jtsyq); WordWrite.SaveToFile(doc, saveDir + "/05审批表" + xzdm.Zu + ".doc"); }
public XMLRead(string filepath, GameObject eop) { staticXMLR = this; objects = new Dictionary <String, GameObject>(); phases = new List <Phase>(); validCorrelations = new List <Correlation>(); decisions = new List <Decision>(); evidenceObjectPrefab = eop; ReadFile(filepath); }