public GlobalInfo() { JLog.Instance.AppInfo("反序列化配置文件"); #if WEB ConfigParam = JFileExten.FromXML <UserConfigParam>(HttpContext.Current.Server.MapPath(@"~/AppConfig.xml")); #else ConfigParam = JFileExten.FromXML <UserConfigParam>(@".\AppConfig.xml"); #endif }
/// <summary> /// 开始仿真按钮事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonX1_Click(object sender, EventArgs e) { try { PLAData data = new PLAData(); data.ProjectName = txtPrjName.Text; data.WorkOrder = 1000; data.CoverRadius = double.Parse(txtCoverRadius.Text); var baseInfo = ucLTEStationType1.BuildBasicInfo(); baseInfo.CityName = txtCityName.Text; data.BaseInfo = baseInfo; data.CellSectors = new List <AircomCell>(); HashSet <string> celliid = new HashSet <string>(); int index = 0; foreach (var sector in _AllAntennas) { if (!celliid.Contains(sector.Celliid)) { celliid.Add(sector.Celliid); var anteners = _AllAntennas.Where(fo => fo.Celliid.Equals(sector.Celliid)).ToList(); data.CellSectors.Add(new AircomCell() { //Antenners = sector, Celliid = sector.Celliid, Antenners = anteners }); index++; } } string FileName = string.Format(@"E:\SendXML{0}.xml", DateTime.Now.ToString("hh-mm-ss")); JLog.Instance.AppInfo(string.Format("生成XML{0}", FileName)); JFileExten.ToXML(data, FileName); JLog.Instance.AppInfo("调用传对象接口"); //AirComServer.CreateTask(data); BLLDoTask.Instance.CreateTask(data); } catch (Exception ex) { JLog.Instance.Error(ex.Message); } }
public bool CreateTask(PLAData Data) { try { JLog.Instance.AppInfo(string.Format("接收到调用请求,工程名{0}", Data.ProjectName)); var Dir = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "XML\\"; string FileName = string.Format("{1}SendXML{0}.xml", DateTime.Now.ToString("hh-mm-ss"), Dir); JLog.Instance.AppInfo(FileName); JFileExten.ToXML(Data, FileName); BLLDoTask.Instance.CreateTask(Data); return(true); } catch (Exception ex) { JLog.Instance.Error(ex.Message, MethodBase.GetCurrentMethod().Name, MethodBase.GetCurrentMethod().Module.Name); return(false); } }
public bool CreateTaskByXML(string Data) { try { JLog.Instance.AppInfo("通过XML串传递"); var Dir = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "XML\\"; string FileName = string.Format("{1}SendXML{0}.xml", DateTime.Now.ToString("hh-mm-ss"), Dir); string Msg = string.Empty; JFileExten.SaveToCreateFile(FileName, Data, out Msg); var obj = XMLHelper.XmlDeserialize <PLAData>(Data); JLog.Instance.AppInfo(string.Format("接收到调用请求,工程名{0}", obj.ProjectName)); //JLog.Instance.AppInfo(string.Format("接收到浪潮调用请求,工程名{0}", Data.ProjectName)); return(true); } catch (Exception) { throw; } }
public ClientGlobalInfo() { ConfigParam = JFileExten.FromXML <UserConfigParam>(".\\AppConfig.xml"); }
private void btnCallWebSerivce_Click(object sender, EventArgs e) { try { AirComService.PLAData data = new AirComService.PLAData(); data.ProjectName = txtPrjName.Text; data.WorkOrder = 1000; data.CoverRadius = double.Parse(txtCoverRadius.Text); var baseInfo = ucLTEStationType1.BuildBasicInfo(); baseInfo.CityName = txtCityName.Text; #region 转为引用服务的模型 data.BaseInfo = new AirComService.AirComLTENodeBaseInfo() { CityName = baseInfo.CityName, CoverType = (AirComService.EnumCoverType)(byte) baseInfo.CoverType, Lat = baseInfo.Lat, Lng = baseInfo.Lng, SaveType = (AirComService.EnumSaveType)(byte) baseInfo.SaveType, StationAlias = baseInfo.StationAlias, Stationiid = baseInfo.Stationiid, StationType = (AirComService.EnumStationType)(Byte) baseInfo.StationType }; #endregion List <AirComService.AircomCell> cellss = new List <AirComService.AircomCell>(); HashSet <string> ceiids = new HashSet <string>(); int n = 0; foreach (var sector in _AllAntennas) { if (!ceiids.Contains(sector.Celliid)) { ceiids.Add(sector.Celliid); var anteners = _AllAntennas.Where(fo => fo.Celliid.Equals(sector.Celliid)).ToList(); AirComService.AircomCell cell = new AirComService.AircomCell(); cell.Celliid = sector.Celliid; cell.Antenners = anteners.TransAntenner().ToArray(); cellss.Add(cell); n++; } } data.CellSectors = cellss.ToArray(); string FileName = string.Format(@"E:\SendXML{0}.xml", DateTime.Now.ToString("hh-mm-ss")); JLog.Instance.AppInfo(string.Format("生成XML{0}", FileName)); JFileExten.ToXML(data, FileName); JLog.Instance.AppInfo("调用传对象接口"); if (Server.CreateTask(data)) { MessageBox.Show("调用成功"); } else { MessageBox.Show("调用失败"); } } catch (Exception ex) { JLog.Instance.Error(ex.Message); } }