public ComputerPong() { myLatestSave = new SaveGame(); mySaveGameXML = new XMLHelper<SaveGame>(); myGameTime = DateTime.Now; //Transition Time TransitionOnTime = TimeSpan.FromSeconds(mySettings.TransitionOnTime); TransitionOffTime = TimeSpan.FromSeconds(mySettings.TransitionOffTime); //Load Player Info myPlayers = new GamePlayers(); myPlayersXML = new XMLHelper<GamePlayers>(); myPlayersXML.Load(ref myPlayers); //Load GameHistory myGameHistoryXML = new XMLHelper<GameHistory>(); myGameList = new GameHistory(); myGameHistoryXML.Load(ref myGameList); //Load Game Objects ObstaclePosition = new Obstacle(mySettings.MaxWidth / 2 - 10, mySettings.MaxHeight / 2 - 80); BallPosition = new Ball(mySettings.MaxWidth / 2 - 10, mySettings.MaxHeight / 2 - 10); RightPaddlePosition = new Paddle(mySettings.MaxWidth - 25, mySettings.MaxHeight / 2 - 40, mySettings.PaddleMoveFactor); LeftPaddlePosition = new Paddle(10, mySettings.MaxHeight / 2 - 40, mySettings.PaddleMoveFactor); playerPosition = new Vector2(mySettings.InitPosX, mySettings.InitPosY); enemyPosition = new Vector2(mySettings.InitPosX, mySettings.InitPosY); //Check if Both Users are In System or if Quick Play is Enabled if (myPlayers.myPlayers.Length != mySettings.NumberOfPlayers && !mySettings.QuickPlay) throw new Exception("There Need to be " + mySettings.NumberOfPlayers + " Active users in the system"); }
public static ConfigModel GetModel() { XMLHelper xml = new XMLHelper(Application.StartupPath + "\\Config.xml"); ConfigModel model = new ConfigModel(); //model.ServerIP = xml.GetItem("MBoxIP", "10.20.31.1"); model.LocalIP = xml.GetItem("LocalIP", "127.0.0.1"); model.Title = xml.GetItem("Title", "调度通讯软件"); model.DBServer = xml.GetItem("DBServer", "."); model.DBName = xml.GetItem("DBName", "BW_VoiceDispatch"); model.DBUserName = xml.GetItem("DBUserName", "sa"); model.DBPassword = xml.GetItem("DBPassword", "kj222"); model.LastUser = xml.GetItem("LastUser", ""); model.AlarmMusicUrl = xml.GetItem("AlarmMusicUrl", "alarm.wav"); model.CheckBoxOnLineInterval = int.Parse(xml.GetItem("CheckBoxOnLineInterval", "60")); model.VideoSize = int.Parse(xml.GetItem("VideoSize", "1")); model.SortByDepartment = bool.Parse(xml.GetItem("SortByDepartment", "false")); model.SortByName = bool.Parse(xml.GetItem("SortByName", "false")); model.SortByNumber = bool.Parse(xml.GetItem("SortByNumber", "false")); model.SortByOnline = bool.Parse(xml.GetItem("SortByOnline", "false")); model.SortInterval = int.Parse(xml.GetItem("SortInterval", "10")); model.ShowColums = int.Parse(xml.GetItem("ShowColums", "5")); model.ShowRows = int.Parse(xml.GetItem("ShowRows", "6")); model.IsAutoStartBySystem = bool.Parse(xml.GetItem("IsAutoStartBySystem", "true")); model.IsAutoLogin = bool.Parse(xml.GetItem("IsAutoLogin", "true")); model.IsDefaultRight = bool.Parse(xml.GetItem("IsDefaultRight", "true")); //model.MaxMeetingMember = int.Parse(xml.GetItem("MaxMeetingMember", "15")); model.AutoFilterMember = bool.Parse(xml.GetItem("AutoFilterMember", "false")); model.TalkLogSearchDays = int.Parse(xml.GetItem("TalkLogSearchDays", "30")); // model.IpBrocastSendInterval = int.Parse(xml.GetItem("IpBrocastSendInterval", "60")); model.WriteSDKLog = bool.Parse(xml.GetItem("WriteSDKLog", "false")); model.IsVideoCall = bool.Parse(xml.GetItem("IsVideoCall", "false")); model.IsIpBrocast = bool.Parse(xml.GetItem("IsIpBrocast", "false")); //model.FontSet4 = xml.GetItem("FontSet4", "12,2,2"); //model.FontSet5 = xml.GetItem("FontSet5", "12,2,2"); //model.FontSet6 = xml.GetItem("FontSet6", "12,2,2"); //model.FontSet7 = xml.GetItem("FontSet7", "12,2,2"); //model.FontSet8 = xml.GetItem("FontSet8", "12,2,2"); model.OutsideNumberMaxLength = int.Parse(xml.GetItem("TalkLogSearchDays", "6")); model.BoxIP = xml.GetItem("BoxIP", ""); model.NVRLoadIP = xml.GetItem("NVRLoadIP", "172.0.0.1"); model.NVRLoadPort = Convert.ToInt32(xml.GetItem("NVRLoadPort", "0")); model.NVRLoadName = xml.GetItem("NVRLoadName", ""); model.NVRLoadPassword = xml.GetItem("NVRLoadPassword", ""); return model; }
public static bool WriteModel(ConfigModel model) { XMLHelper xml = new XMLHelper(Application.StartupPath + "\\Config.xml"); xml.SetItem("LocalIP", model.LocalIP); xml.SetItem("DBServer", model.DBServer); xml.SetItem("DBName", model.DBName); xml.SetItem("DBUserName", model.DBUserName); xml.SetItem("DBPassword", model.DBPassword); xml.SetItem("LastUser", model.LastUser); xml.SetItem("SortByDepartment", model.SortByDepartment.ToString()); xml.SetItem("SortByName", model.SortByName.ToString()); xml.SetItem("SortByNumber", model.SortByNumber.ToString()); xml.SetItem("SortByOnline", model.SortByOnline.ToString()); xml.SetItem("ShowColums", model.ShowColums.ToString()); xml.SetItem("ShowRows", model.ShowRows.ToString()); xml.SetItem("BoxIP", model.BoxIP); xml.SetItem("VideoSize", model.VideoSize.ToString()); return true; }
public WebReturn DoOperation(WebRequest webRequest) { WebReturn webReturn = new WebReturn(); webReturn.Result = true; webReturn.Code = 0; if (webRequest == null) { webReturn.Result = false; webReturn.Code = Defines.RET_PARAM_INVALID; webReturn.Message = string.Format("WebRequest is null"); return(webReturn); } SessionInfo session = webRequest.Session; if (session == null) { webReturn.Result = false; webReturn.Code = Defines.RET_PARAM_INVALID; webReturn.Message = string.Format("SessionInfo is null"); return(webReturn); } webReturn.Session = session; try { OperationReturn optReturn; DatabaseInfo dbInfo = session.DatabaseInfo; if (dbInfo != null) { dbInfo.RealPassword = DecryptString(dbInfo.Password); session.DBConnectionString = dbInfo.GetConnectionString(); } optReturn = XMLHelper.DeserializeObject <ServerRequestInfo>(webRequest.Data); if (!optReturn.Result) { webReturn.Result = false; webReturn.Code = optReturn.Code; webReturn.Message = optReturn.Message; return(webReturn); } ServerRequestInfo request = optReturn.Data as ServerRequestInfo; if (request == null) { webReturn.Result = false; webReturn.Code = Defines.RET_OBJECT_NULL; webReturn.Message = string.Format("RequestInfo is null"); return(webReturn); } switch (request.Command) { case (int)ServerRequestCommand.GetDiskDriverList: optReturn = GetDiskDriverList(request); if (!optReturn.Result) { webReturn.Result = false; webReturn.Code = optReturn.Code; webReturn.Message = optReturn.Message; return(webReturn); } webReturn.ListData = optReturn.Data as List <string>; break; case (int)ServerRequestCommand.GetChildDirectoryList: optReturn = GetChildDirectoryList(request); if (!optReturn.Result) { webReturn.Result = false; webReturn.Code = optReturn.Code; webReturn.Message = optReturn.Message; return(webReturn); } webReturn.ListData = optReturn.Data as List <string>; break; case (int)ServerRequestCommand.GetChildFileList: optReturn = GetChildFileList(request); if (!optReturn.Result) { webReturn.Result = false; webReturn.Code = optReturn.Code; webReturn.Message = optReturn.Message; return(webReturn); } webReturn.ListData = optReturn.Data as List <string>; break; case (int)ServerRequestCommand.GetNetworkCardList: optReturn = GetNetworkCardList(request); if (!optReturn.Result) { webReturn.Result = false; webReturn.Code = optReturn.Code; webReturn.Message = optReturn.Message; return(webReturn); } webReturn.ListData = optReturn.Data as List <string>; break; case (int)ServerRequestCommand.GetCTIServiceName: optReturn = GetCTIServiceName(request); if (!optReturn.Result) { webReturn.Result = false; webReturn.Code = optReturn.Code; webReturn.Message = optReturn.Message; return(webReturn); } webReturn.ListData = optReturn.Data as List <string>; break; case (int)ServerRequestCommand.GetServerName: break; case (int)ServerRequestCommand.SetResourceChanged: optReturn = SetResourceChanged(request); if (!optReturn.Result) { webReturn.Result = false; webReturn.Code = optReturn.Code; webReturn.Message = optReturn.Message; return(webReturn); } break; default: webReturn.Result = false; webReturn.Code = Defines.RET_PARAM_INVALID; webReturn.Message = string.Format("Request code invalid.\t{0}", webRequest.Code); return(webReturn); } webReturn.Message = optReturn.Message; return(webReturn); } catch (Exception ex) { webReturn.Result = false; webReturn.Code = Defines.RET_FAIL; webReturn.Message = ex.Message; return(webReturn); } }
public void LoadUserScoreSheetList() { try { mListScoreSheetItems = new List <BasicScoreSheetItem>(); WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3103Codes.GetUserScoreSheetList; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(selTaskRecord.RecoredReference.ToString()); //if (selTaskRecord.TaskType == "2" || selTaskRecord.TaskType == "4")//如果是自动任务分配,在去匹配座席ID //{ // var item = App.ListCtrolAgentInfos.Where(a => a.AgentName == selTaskRecord.AgtOrExtID).FirstOrDefault(); // webRequest.ListData.Add(item.AgentID); //} //else //{ //} webRequest.ListData.Add(selTaskRecord.AgtOrExtID); webRequest.ListData.Add("0"); webRequest.ListData.Add(selTaskRecord.TaskID.ToString()); // Service31031Client client = new Service31031Client(); Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031")); //WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException(string.Format("Fail.\tListData is null")); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; OperationReturn optReturn = XMLHelper.DeserializeObject <BasicScoreSheetInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicScoreSheetInfo info = optReturn.Data as BasicScoreSheetInfo; if (info == null) { ShowException(string.Format("Fail.\tBaiscScoreSheetInfo is null")); return; } BasicScoreSheetItem item = new BasicScoreSheetItem(info); item.RowNumber = i + 1; item.Background = GetScoreSheetBackground(item); if (selTaskRecord.TaskType == "3" || selTaskRecord.TaskType == "4") { if (item.ScoreSheetID == oldTemplateID) { item.Title = string.Format("({0})", CurrentApp.GetLanguageInfo("3103T00183", "1st Task")) + item.Title; } } if (ParentPage.mViewScore) { if (item.ScoreSheetID == selTaskRecord.TemplateID) { mListScoreSheetItems.Add(item); } } else { mListScoreSheetItems.Add(item); } } } catch (Exception ex) { ShowException(ex.Message); } }
/// <summary> /// Loads a configuration file passed to the new Swiffotron and parses it, /// creating any implementing classes named in the configuration. /// </summary> /// <param name="configXml">A stream ready and primed with lovely XML /// configuration data.</param> private void LoadConfigXML(Stream configXml) { this.Xml = new XMLHelper(); this.Xml.SetContext(new SwiffotronContext("Swiffotron configuration")); Xml.LoadConfigurationXML(configXml); /* First, set up any caches: */ XmlAttribute attrib; foreach (XPathNavigator hit in Xml.Select(@"/con:config/con:cache")) { XmlAttributeCollection attribs = ((XmlElement)hit.UnderlyingObject).Attributes; /* The schema defines these attributes as mandatory, so they will exist: */ string name = attribs[@"name"].Value; string classname = attribs[@"classname"].Value; /* Optional parameters, which we default to null before we call Initialise on * any implementor. */ attrib = attribs[@"init"]; string init = (attrib == null) ? null : attrib.Value; attrib = attribs[@"assembly"]; string assembly = (attrib == null) ? null : attrib.Value; /* Create our named cache as specified by our config file. */ ISwiffotronCache newCache = Extern.CreateCache(name, assembly, classname, init); /* Use Add method here to ensure that the name is unique. Key errors get thrown * upwards and destroy the app. Hey, fix your config file, user. */ this.Caches.Register(name, newCache); } /* Now, set up any stores: */ foreach (XPathNavigator hit in Xml.Select(@"/con:config/con:store")) { XmlAttributeCollection attribs = ((XmlElement)hit.UnderlyingObject).Attributes; /* The schema defines these attributes as mandatory, so they will exist: */ string name = attribs[@"name"].Value; string classname = attribs[@"classname"].Value; /* Optional parameter, which we default to null before we call Initialise on * any implementor. */ attrib = attribs[@"init"]; string init = (attrib == null) ? null : attrib.Value; attrib = attribs[@"assembly"]; string assembly = (attrib == null) ? null : attrib.Value; /* Create our named store as specified by our config file. */ ISwiffotronStore newStore = Extern.CreateStore(name, assembly, classname, init); /* Use Add method here rather than the index operator to ensure that the * name is unique. Key errors get thrown upwards and destroy the app. * Hey, fix your config file, user. */ this.Stores.Register(name, newStore); } /* ISSUE 68: Staggeringly inefficient xpath queries that navigate from the root node every damned * time. Do we care? */ this.EnableStoreWrites = Xml.SelectBoolean(@"/con:config/con:swfprefs/con:storeWriteEnabled/text()"); this.swfReaderOptions = new SWFReaderOptions() { StrictTagLength = Xml.SelectBoolean(@"/con:config/con:swfprefs/con:stricttaglength/text()") }; this.swfWriterOptions = new SWFWriterOptions() { Compressed = Xml.SelectBoolean(@"/con:config/con:swfprefs/con:compression/text()"), EnableDebugger = Xml.SelectBoolean(@"/con:config/con:swfprefs/con:debugcode/text()") }; string htmlType = Xml.SelectString(@"/con:config/con:htmlType/text()", "JQuery"); this.HTMLType = (SWF2HTMLOptions.FrameworkType)Enum.Parse(typeof(SWF2HTMLOptions.FrameworkType), htmlType); this.HTMLStandalone = Xml.SelectBoolean(@"/con:config/con:htmlStandalone/text()", false); }
public string GetArtist() { return(XMLHelper.GetValue(element, "artist")); }
public void CreateMeasuresFolderStructure() { string measureFolder = ApplicationManager.Instance.GetMeasuresFolder(); string aa = "http://bcl.nrel.gov/api/taxonomy/measure"; taxonomy result = DownloadAndDeserializeJsonData <taxonomy>(aa); if (result != null) { IEnumerable <string> measureFiles = Directory.EnumerateFiles(measureFolder, "measure.xml", SearchOption.AllDirectories); List <measure> measures = new List <measure>(); foreach (string measureFilePath in measureFiles) { measure m = null; try { m = XMLHelper.Deserialize <measure>(File.ReadAllText(measureFilePath)); } catch (Exception ex) { } if (m != null) { //SimulationMeasureType measureType = SimulationMeasureType.None; //foreach (var item in m.attributes) //{ // if (item?.name == "Measure Type" && Enum.TryParse<SimulationMeasureType>(item.value, out measureType)) // { // m.MeasureType = measureType; // break; // } //} measures.Add(m); } } List <SimulationMeasure> simulationMeasures = new List <SimulationMeasure>(); foreach (Term term in result.term) { SimulationMeasure measureCategory = new SimulationMeasure(); measureCategory.Name = term.name; measureCategory.Description = term.description; simulationMeasures.Add(measureCategory); if (term.term?.Count > 0) { measureCategory.Measures = new List <SimulationMeasure>(); foreach (Term childTerm in term.term) { SimulationMeasure childCategory = new SimulationMeasure(); childCategory.Name = childTerm.name; childCategory.Description = childTerm.description; measureCategory.Measures.Add(childCategory); string measureTag = string.Format("{0}.{1}", term.name, childTerm.name); List <measure> termMeasures = measures.Where(m => m.tags.tag == measureTag).ToList(); if (termMeasures?.Count > 0) { childCategory.Measures = new List <SimulationMeasure>(); foreach (measure simMeausre in termMeasures) { SimulationMeasure termMeasure = new SimulationMeasure(); termMeasure.Name = simMeausre.name; termMeasure.Description = simMeausre.description; SimulationMeasureType measureType = SimulationMeasureType.None; foreach (var item in simMeausre.attributes) { if (item?.name == "Measure Type" && Enum.TryParse <SimulationMeasureType>(item.value, out measureType)) { termMeasure.Type = measureType; break; } } childCategory.Measures.Add(termMeasure); } } } } } measuresTreeView.DataSource = simulationMeasures; } }
public static DateTime lastPicDate = DateTime.Now;//上一次电站图片更新事件 /// <summary> /// 取得功率图表数据 /// </summary> /// <param name="plantId"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public static ChartData getPowerData(string plantId, string startDate, string endDate) { string startDateStr = string.Format("{0}-{1}-{2}", endDate.Substring(0, 4), endDate.Substring(4, 2), endDate.Substring(6, 2)); double cacheHour = DateTime.Parse(startDateStr) < DateTime.Now.AddDays(-1) ? 24 : 0.5; string key = plantId + startDate + endDate; ChartData chartData = null; DateTime lastDate = dataDateMap.ContainsKey(key) ? dataDateMap[key] : DateTime.Now; if (lastDate.AddMinutes(30) > DateTime.Now) { chartData = chartdataItemMap.ContainsKey(key) ? chartdataItemMap[key] : null; } if (chartData != null) { return(chartData); } string filename = System.Environment.CurrentDirectory + "/data/power/" + key; try { chartData = JsonUtil.getChartData(string.Format("/openapi/plantDayChartData?pid={0}&startdate={1}&enddate={2}", plantId, startDate, endDate)); if (chartData == null) { //从本地磁盘去数据 chartData = new ChartData(); if (File.Exists(filename)) { try { XMLHelper.DeserializerXML <ChartData>(filename, ref chartData); } catch (Exception eee) { LogUtil.error("反向本地缓存 error:" + eee.StackTrace); chartData = null; } } else { return(null); } } else { dataDateMap[key] = DateTime.Now; chartdataItemMap[key] = chartData; //写入本地缓存 try { if (chartData != null) { XMLHelper.SerializerXML <ChartData>(filename, chartData); } } catch (Exception eee) { LogUtil.error("写入本地缓存 error:" + eee.StackTrace); } } } catch (Exception e2) { LogUtil.error("getPowerData error:" + e2.Message); return(null); } return(chartData); }
public string GetMBID() { return(XMLHelper.GetValue(element, "mbid")); }
public bool Connect() { if (emsSession == null || emsSession.IsClosed) { try { ConnectionFactory factory = new TIBCO.EMS.ConnectionFactory(emsServerUrl); // create the emsConnection emsConnection = factory.CreateConnection(emsUserName, emsUserPassword); Utilities.WriteLog(String.Format(@"Подсоединено к : {0};", emsServerUrl)); // create the emsSession emsSession = emsConnection.CreateSession(false, Session.AUTO_ACKNOWLEDGE); Utilities.WriteLog(String.Format(@"Создана сессия;")); // set the exception listener emsConnection.ExceptionListener = this; msgProducer = emsSession.CreateProducer(destination); Utilities.WriteLog(String.Format(@"Создан продюсер;")); completionListener = new EMSCompletionListener(entitiesModel); // create the emsDestination if (useTopic) emsDestination = emsSession.CreateTopic(_emsInputQueueName); else emsDestination = emsSession.CreateQueue(_emsInputQueueName); if (useTopic) destination = emsSession.CreateTopic(_emsOutputQueueName); else destination = emsSession.CreateQueue(_emsOutputQueueName); var message = String.Format(@"Подписано на события очереди: {0}",_emsInputQueueName); Utilities.WriteLog(message); // create the consumer msgConsumer = emsSession.CreateConsumer(emsDestination); Utilities.WriteLog(String.Format(@"Создан консюмер: {0}", emsDestination.ToString())); // set the message listener msgConsumer.MessageListener = this; xmlHelper = new XMLHelper(); // start the emsConnection emsConnection.Start(); // Note: when message callback is used, the emsSession // creates the dispatcher thread which is not a daemon // thread by default. Thus we can quit this method however // the application will keep running. It is possible to // specify that all emsSession dispatchers are daemon threads. return true; } catch (Exception ex) { Utilities.WriteExceptionMessageToLog(ex, String.Format(@"Ошибка подключения к очереди {0}", _emsInputQueueName)); return false; } } return true; }
private void btnLogin2_Click(object sender, EventArgs e) { String Username = txtUser2.Text; String Password = txtPass2.Text; if (Username.ToUpper().Equals(txtUser1.Text.ToString().ToUpper())) { MessageBox.Show("User cannot play against Himself"); return; } if (Username.ToUpper().Equals("SA") ) { MessageBox.Show("SA Cannot play against another Player"); return; } else { //Verify Username and Password from UserList myUserXML.Load(ref myUserList); Boolean UserFound = false; for (int i = 0; i < myUserList.myUsers.Length; i++) { if (myUserList.myUsers[i].UserName.ToUpper().Equals(Username.ToUpper()) && myUserList.myUsers[i].Password.ToUpper().Equals(Password.ToUpper())) { myPlayers.AddItem(myUserList.myUsers[i]); XMLHelper<GamePlayers> myPlayersXML = new XMLHelper<GamePlayers>(); myPlayersXML.Save(myPlayers); Begin(); UserFound = true; break; } } if (!UserFound) MessageBox.Show("Login Unsuccessful, Try Again. (Passwords are case sensitive)"); } }
private bool ChangeContents() { if (!string.IsNullOrWhiteSpace(TxtOneContentsName.Text)) { if (string.Equals(TxtOneContentsName.Text, _mContentsTree.StrParentNodeName)) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00019", "Subfolder name can not be the same as the parent")); return(false); } if (_mContentsTree.LstChildInfos.Any(param => string.Equals(TxtOneContentsName.Text, param.StrNodeName))) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00019", "Subfolder name can not be the same as the parent")); return(false); } if (_mContentsTree.LstNodeInfos.Any(param => string.Equals(TxtOneContentsName.Text, param.StrNodeName))) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00023", "Subfolder name can not be the same as the parent")); return(false); } } else { ShowInformation(CurrentApp.GetLanguageInfo("3604T00021", "Please Input ContentsName")); return(false); } _mContentsParam = new ContentsParam(); _mContentsParam.LongNodeId = _mContentsTree.LongNodeId; _mContentsParam.StrNodeName = TxtOneContentsName.Text; _mContentsTree.StrNodeName = TxtOneContentsName.Text; WebRequest webRequest; Service36041Client client; WebReturn webReturn; webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3604Codes.OptChangeContents; OperationReturn optReturn = XMLHelper.SeriallizeObject(_mContentsParam); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return(false); } webRequest.ListData.Add(optReturn.Data.ToString()); // client = new Service36041Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), // WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service36041")); client = new Service36041Client(); webReturn = client.UmpTaskOperation(webRequest); client.Close(); string strLog; if (!webReturn.Result) { #region 写操作日志 strLog = string.Format("{0} {1} : {2}", Utils.FormatOptLogString("3604T00010"), Utils.FormatOptLogString("3604T00024"), webReturn.Message); CurrentApp.WriteOperationLog(S3604Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_FAIL, strLog); #endregion ShowException(string.Format("{0}: {1}", CurrentApp.GetLanguageInfo("3604T00024", "Insert data failed"), webReturn.Message)); return(false); } #region 写操作日志 strLog = string.Format("{0}", Utils.FormatOptLogString("3604T00010")); CurrentApp.WriteOperationLog(S3604Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog); #endregion CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("3604T00010", "Change Contents!")); CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("3604T00025", "Change Success!")); ParentPage.RefreshTree(_mContentsTree); return(true); }
/// <summary> /// Initializes a new instance of the Swiffotron class. /// </summary> /// <param name="configStream">An open stream to the config XML data, or null to /// use default configuration.</param> public Swiffotron(Stream configStream) { if (configStream == null) { configStream = Assembly .GetExecutingAssembly() .GetManifestResourceStream(@"SWFProcessing.Swiffotron.res.default-config.xml"); } this.conf = new Configuration(configStream); this.Xml = new XMLHelper(); this.stores = this.conf.Stores; this.caches = this.conf.Caches; }
private bool CreateContents() { WebRequest webRequest; Service36041Client client; WebReturn webReturn; string[] strContents = new string[10]; long[] strResultId = new long[10]; var lstContentsTree = new List <ContentsTree>(); if (RbutOneContentsName.IsChecked == true) { if (!string.IsNullOrWhiteSpace(TxtOneContentsName.Text)) { strContents[0] = TxtOneContentsName.Text; if (strContents[0] == _mContentsTree.StrNodeName) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00019", "Subfolder name can not be the same as the parent")); return(false); } foreach (var param in _mContentsTree.LstChildInfos) { if (string.Equals(TxtOneContentsName.Text, param.StrNodeName)) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00020", "Contents has been created!")); return(false); } } } else { ShowInformation(CurrentApp.GetLanguageInfo("3604T00021", "Please Input ContentsName")); return(false); } } else { if (!string.IsNullOrWhiteSpace(TxtMoreContentsName.Text)) { strContents = TxtMoreContentsName.Text.Split(new char[] { '\\' }); if (strContents[0] == S3604App.GContentsTree.StrNodeName) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00019", "Subfolder name can not be the same as the parent")); return(false); } for (int i = 0; i < strContents.Length - 1; i++) { if (strContents[i] == strContents[i + 1]) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00019", "Subfolder name can not be the same as the parent")); return(false); } if (i + 2 > 10) { ShowInformation(CurrentApp.GetLanguageInfo("3604T00022", "Create cannot exceed 10 more Contents")); return(false); } } } else { ShowInformation(CurrentApp.GetLanguageInfo("3604T00021", "Please Input ContentsName")); return(false); } } for (int i = 0; i < strContents.Length; i++) { if (!S3604App.GQueryModify) { //生成新的查询配置表主键 webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.WSGetSerialID; webRequest.ListData.Add("36"); webRequest.ListData.Add("3604"); webRequest.ListData.Add(DateTime.Now.ToString("yyyyMMddHHmmss")); // client = new Service36041Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), // WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service36041")); client = new Service36041Client(); webReturn = client.UmpTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { return(false); } string strNewResultId = webReturn.Data; if (string.IsNullOrEmpty(strNewResultId)) { return(false); } strResultId[i] = Convert.ToInt64(strNewResultId); } } for (int i = 0; i < strContents.Length; i++) { var contentsTree = new ContentsTree(); if (string.IsNullOrEmpty(strContents[i])) { break; } if (i == 0) { _mContentsParam.LongParentNodeId = _mContentsTree.LongNodeId; _mContentsParam.StrParentNodeName = _mContentsTree.StrNodeName; contentsTree.LongParentNodeId = _mContentsTree.LongNodeId; } else { _mContentsParam.LongParentNodeId = strResultId[i - 1]; _mContentsParam.StrParentNodeName = strContents[i - 1]; contentsTree.LongParentNodeId = strResultId[i - 1]; } _mContentsParam.StrNodeName = strContents[i]; _mContentsParam.LongNodeId = strResultId[i]; _mContentsParam.StrDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); contentsTree.LongNodeId = strResultId[i]; contentsTree.StrNodeName = strContents[i]; webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3604Codes.OptCreateContents; OperationReturn optReturn = XMLHelper.SeriallizeObject(_mContentsParam); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return(false); } webRequest.ListData.Add(optReturn.Data.ToString()); //client = new Service36041Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), // WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service36041")); client = new Service36041Client(); webReturn = client.UmpTaskOperation(webRequest); client.Close(); string strLog; if (!webReturn.Result) { #region 写操作日志 strLog = string.Format("{0} {1} : {2}", Utils.FormatOptLogString("3604T00003"), Utils.FormatOptLogString("3604T00026"), webReturn.Message); CurrentApp.WriteOperationLog(S3604Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_FAIL, strLog); #endregion ShowException(string.Format("{0} : {1}", CurrentApp.GetLanguageInfo("3604T00026", "Insert data failed"), webReturn.Message)); return(false); } #region 写操作日志 strLog = string.Format("{0}", Utils.FormatOptLogString("3604T00003")); CurrentApp.WriteOperationLog(S3604Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog); #endregion CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("3604T00003", "Add Contents!")); CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("3604T00027", "Add Success!")); lstContentsTree.Add(contentsTree); } ParentPage.RefreshTree(lstContentsTree); return(true); }
private void LoadNetworkCardInfos(List <string> listHostAddresses) { List <NetworkCardInfo> listCardInfo = new List <NetworkCardInfo>(); WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S1110Codes.GetServerInfo; Service11102Client client = new Service11102Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress( CurrentApp.Session.AppServerInfo, "Service11102")); bool isFail = true; string strMsg = string.Empty; if (MainPage != null) { MainPage.SetBusy(true, CurrentApp.GetMessageLanguageInfo("005", "Getting server networkcard information")); } BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (s, de) => { try { for (int i = 0; i < listHostAddresses.Count; i++) { string address = listHostAddresses[i]; if (string.IsNullOrEmpty(address)) { strMsg += string.Format("Server address is empty!;"); continue; } ServerRequestInfo requestInfo = new ServerRequestInfo(); requestInfo.ServerHost = address; requestInfo.ServerPort = 8009; requestInfo.Command = (int)ServerRequestCommand.GetNetworkCardList; OperationReturn optReturn = XMLHelper.SeriallizeObject(requestInfo); if (!optReturn.Result) { strMsg += string.Format("Fail.\t{0}\t{1}\t{2};", address, optReturn.Code, optReturn.Message); continue; } webRequest.Data = optReturn.Data.ToString(); WebReturn webReturn = client.DoOperation(webRequest); if (!webReturn.Result) { strMsg += string.Format("WSFail.\t{0}\t{1}\t{2};", address, webReturn.Code, webReturn.Message); continue; } if (webReturn.ListData == null) { strMsg += string.Format("ListData is null;"); continue; } for (int j = 0; j < webReturn.ListData.Count; j++) { string info = webReturn.ListData[j]; string[] arrInfo = info.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); if (arrInfo.Length < 2) { continue; } NetworkCardInfo card = new NetworkCardInfo(); card.ID = arrInfo[1]; card.Name = string.Format("{0}[{1}]", arrInfo[0], address); card.Description = string.Format("{0}[{1}]({2})", arrInfo[0], address, arrInfo[1]); listCardInfo.Add(card); } } isFail = false; } catch (Exception ex) { isFail = true; strMsg = ex.Message; } }; worker.RunWorkerCompleted += (s, re) => { worker.Dispose(); if (MainPage != null) { MainPage.SetBusy(false, string.Empty); } try { if (isFail) { ShowException(strMsg); return; } if (!string.IsNullOrEmpty(strMsg)) { ShowException(strMsg); } for (int i = 0; i < listCardInfo.Count; i++) { var card = listCardInfo[i]; PropertyValueEnumItem item = new PropertyValueEnumItem(); item.Value = card.ID; item.Display = card.Name; item.Description = card.Description; item.Info = card; var temp = mListNetworkCardItems.FirstOrDefault(e => e.Value == item.Value); if (temp == null) { mListNetworkCardItems.Add(item); } else { temp.Display = item.Display; temp.Description = item.Description; temp.Info = item.Info; } } } catch (Exception ex) { ShowException(ex.Message); } }; worker.RunWorkerAsync(); }
public string GetCountry() { return(XMLHelper.GetValue(element, "country")); }
/// <summary> /// 初始化加载已存在映射的表单列表 /// </summary> private void InitMappingSheet() { XMLHelper xmlHelper = new XMLHelper("TableMapping.xml"); mMappingedSheetList = xmlHelper.LoadMappingedSheetNameList(); }
/// <summary> /// TreeNode结点,右键菜单选中事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmsSheetNode_ItemClicked(Object sender, ToolStripItemClickedEventArgs e) { //获取所点击的结点名称 String sheetName = treeViewExcels.SelectedNode.Text; //复制表名 if (e.ClickedItem.Text.Contains(ConstantText.CopySheetName)) { Clipboard.SetText(sheetName); return; } //映射该表 if (e.ClickedItem.Text.Contains(ConstantText.MappingTable)) { //实例化弹出映射窗体 TableMapping tableMapping = new TableMapping(sheetName, mExcelFileInfos[treeViewExcels.SelectedNode.Parent.Text], this); tableMapping.ShowDialog(this); //改变所选节点,映射状态 XMLHelper xmlHelper = new XMLHelper("TableMapping.xml"); if (xmlHelper.GetTableNameMapping(sheetName) != null) { treeViewExcels.SelectedNode.ForeColor = Color.Red; treeViewExcels.SelectedNode.ToolTipText = ConstantText.MappingExist; } else { treeViewExcels.SelectedNode.ForeColor = Color.Black; treeViewExcels.SelectedNode.ToolTipText = ConstantText.ClickToCopy; } } }
void Awake() { s_Instance = this; var helper = new XMLHelper( Global.ROBOT_DATA_PATH); for(int i = 0 ; i < (int)Global.DataTableType.None ; ++ i ) { DataTable table = helper.ReadSheet( ((Global.DataTableType)i).ToString() ); robotData.Add(table); List<string> equipmentNames = new List<string>(); for(int j = 0 ; j < table.rows.Count ; ++ j) equipmentNames.Add(table.rows[j].row.Select("Name").ToString()); equipmentList.Add(equipmentNames); // Debug.Log( ((Global.DataTableType)i).ToString() + " " + equipmentNames[0]); } // ReadXLS(Application.dataPath+"/RobotBody.xls"); }
private OperationReturn SetResourceChanged(ServerRequestInfo request) { OperationReturn optReturn = new OperationReturn(); optReturn.Result = true; optReturn.Code = 0; try { List <string> listParams = request.ListData; if (listParams.Count < 1) { optReturn.Result = false; optReturn.Code = Defines.RET_PARAM_INVALID; optReturn.Message = string.Format("Count parameter invalid"); return(optReturn); } string strCount = listParams[0]; int intCount; if (!int.TryParse(strCount, out intCount)) { optReturn.Result = false; optReturn.Code = Defines.RET_PARAM_INVALID; optReturn.Message = string.Format("Parameter count invalid"); return(optReturn); } if (intCount + 1 > listParams.Count) { optReturn.Result = false; optReturn.Code = Defines.RET_PARAM_INVALID; optReturn.Message = string.Format("Count parameter invalid"); return(optReturn); } List <NotifyObjectInfo> listNotifyObjects = new List <NotifyObjectInfo>(); for (int i = 0; i < intCount; i++) { string strServerInfo = listParams[i + 1]; optReturn = XMLHelper.DeserializeObject <NotifyObjectInfo>(strServerInfo); if (!optReturn.Result) { return(optReturn); } NotifyObjectInfo serverInfo = optReturn.Data as NotifyObjectInfo; if (serverInfo == null) { optReturn.Result = false; optReturn.Code = Defines.RET_OBJECT_NULL; optReturn.Message = string.Format("ServerInfo is null"); return(optReturn); } listNotifyObjects.Add(serverInfo); } List <string> listReturn = new List <string>(); //异步模式(过指定的时间超时) List <string> args = new List <string>(); for (int i = 0; i < listNotifyObjects.Count; i++) { args.Add(string.Format("{0}:8009", listNotifyObjects[i].Address)); } if (mService00Helper == null) { mService00Helper = new Service00Helper(); mService00Helper.Debug += mService00Helper_Debug; mService00Helper.Start(); } mService00Helper.HostAddress = request.ServerHost; mService00Helper.HostPort = request.ServerPort; optReturn = mService00Helper.DoOperation(RequestCommand.SET_RESOURCE_CHANGED, args); if (!optReturn.Result) { return(optReturn); } string strMessage = optReturn.Data.ToString(); if (!string.IsNullOrEmpty(strMessage)) { if (strMessage.StartsWith("Error")) { optReturn.Result = false; optReturn.Code = Defines.RET_FAIL; optReturn.Message = string.Format("{0}", strMessage); return(optReturn); } optReturn.Message = strMessage; } optReturn.Data = listReturn; } catch (Exception ex) { optReturn.Result = false; optReturn.Code = Defines.RET_FAIL; optReturn.Message = ex.Message; } return(optReturn); }
private static ConfigBase LoadConfig(ConfigBase config, string key) { string configFileName = key + CONFIG_EXT; string configFile = Path.Combine(ConfigFolder, configFileName); XMLHelper xml = new XMLHelper(configFile, ENCRYPT); if (File.Exists(configFile)) { config = xml.Load(config.GetType()) as ConfigBase; } else { xml.Save(config); } return config; }
public ServicePool() { _config = XMLHelper.DeserializeFromFile <SOAConfiguration>(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile); }
private void btnUpdate_Click(object sender, EventArgs e) { if (!txtPassword_2.Text.ToString().Equals(txtPassword.Text.ToString())) { MessageBox.Show("Error: Passwords dont match"); return; } try { User myUser = new User(); myUser.Email = txtEmail.Text; myUser.ImageURL = SelectedImageURL; myUser.Password = txtPassword.Text; myUser.IsApproved = true; myUser.UserName = txtUsername.Text; myUser.ImageURL = txtImage.Text; UserList myUserList = new UserList(); XMLHelper<UserList> myXML = new XMLHelper<UserList>(); myXML.Load(ref myUserList); int Index = myUserList.FindName(myUser.UserName); if (Index != -1) { myUserList.RemoveItem(Index); myUserList.AddItem(myUser); myXML.Save(myUserList); this.Dispose(); } else { MessageBox.Show("Error: This username does not exist"); } } catch (Exception ex) { MessageBox.Show("Error Occurred: " + ex.Message.ToString()); return; } }
/// <summary> /// 执行消息回复 /// </summary> /// <param name="MessageHandler"></param> /// <returns></returns> public string Excute() { var Request = HttpContext.Current.Request; string signature = Request["signature"]; string timestamp = Request["timestamp"]; string nonce = Request["nonce"]; string echostr = Request["echostr"]; string encrypt_type = Request["encrypt_type"]; // aes 是安全模式。 null是明文模式 string msg_signature = Request["msg_signature"]; //消息加密后 会有这个参数 //解加密类 Utils.Tencent.WXBizMsgCrypt wxcpt = new Utils.Tencent.WXBizMsgCrypt(_token, _EncodingAESKey, _appId); //获取xml Stream xmlStream = Request.InputStream; string postData = ""; using (StreamReader sr = new StreamReader(xmlStream)) { postData = sr.ReadToEnd(); } //收到的消息 ReceiveMessage receiveMsg = null; //是否安全模式? if (encrypt_type == "aes") { string str = ""; int i = wxcpt.DecryptMsg(msg_signature, timestamp, nonce, postData, ref str); if (i == 0) { receiveMsg = XMLHelper.XMLDeserializer <ReceiveMessage>(new MemoryStream(Encoding.UTF8.GetBytes(str))); } } else { receiveMsg = XMLHelper.XMLDeserializer <ReceiveMessage>(new MemoryStream(Encoding.UTF8.GetBytes(postData))); } //避免重复接受 if (receiveMsg.MsgId != null) { if (CacheHelper.GetCache(receiveMsg.MsgId) != null) { return(""); } CacheHelper.SetCache(receiveMsg.FromUserName + receiveMsg.CreateTime, "xx", new TimeSpan(0, 0, 1, 0)); } //执行MessageHandler ReplyBaseMessage replyMsg = ExcuteMessageHandler(receiveMsg); if (replyMsg == null) { return(""); } //是否安全模式? if (encrypt_type == "aes") { string relMsg = XMLHelper.XMLSerializer <ReplyBaseMessage>(replyMsg); string EncryptMsg = ""; //加密 wxcpt.EncryptMsg(relMsg, timestamp, nonce, ref EncryptMsg); return(EncryptMsg); } else { return(XMLHelper.XMLSerializer <ReplyBaseMessage>(replyMsg)); } }
private void Refresh() { bool connectflag = GlobalData.Connectflag; if (connectflag) { bool flag = Device.SpeedData == null; if (flag) { this.speed = 0.0; } else { try { this.speed = Convert.ToDouble(Device.SpeedData) / 10.0; bool flag2 = XMLHelper.UsersInforGetNum() > 0; if (flag2) { this.weight = Convert.ToInt32(XMLHelper.UsersInforReader("Information", 6)); } else { bool flag3 = GlobalData.weight != null; if (flag3) { this.weight = Convert.ToInt32(GlobalData.weight); } else { this.weight = 75; } } this.Horizontal = 9.8067 * Math.Cos(Math.Atan(this.slope / 100.0)) * (double)(this.weight + 7) * 0.005; this.x = Math.Atan(this.slope / 100.0); this.Friction = 9.8067 * (double)(this.weight + 7) * Math.Sin(this.x); this.Friction2 = -9.8067 * (double)(this.weight + 7) * Math.Sin(this.x); this.speed2 = 0.0; this.speed3 = 15.0; while (Math.Abs(this.speed3 - this.speed2) > 1.0) { bool flag4 = this.speed > 0.0; if (flag4) { bool flag5 = this.gear < 3; if (flag5) { this.DownSlopeResistance = 0.19657071 * (this.speed3 / 3.6) * (this.speed3 / 3.6); this.speed2 = 3.6 * (this.power + this.Friction2 * this.speed3 / 3.6) / (this.DownSlopeResistance + this.Horizontal); bool flag6 = this.speed2 > 75.0 || this.speed2 < 0.0; if (flag6) { this.speed2 = 75.0; } } else { this.UpSlopeResistance = 0.19657071 * (this.speed3 / 3.6) * (this.speed3 / 3.6); this.speed2 = 3.6 * this.power / (this.UpSlopeResistance + this.Horizontal + this.Friction); } bool flag7 = this.speed2 <= 0.0; if (flag7) { this.speed2 = 0.0; } } else { this.speed2 = 0.0; } bool flag8 = this.power == 0.0; if (flag8) { this.speed2 = 0.0; } this.speed3 = ((this.speed3 - this.speed2 > 0.0) ? (this.speed3 - 0.1) : (this.speed3 + 0.1)); } bool flag9 = Math.Abs(this.oldspeed2 - this.speed2) > 5.0; if (flag9) { this.speed2 = 0.5 * (this.oldspeed2 + this.speed2); } this.oldspeed2 = this.speed2; } catch { this.speed = 0.0; } } } else { bool flag10 = GlobalData.speedChannel >= 0 && GlobalData.speedChannel < 8; if (flag10) { switch (GlobalData.speedChannel) { case 0: this.SpeedDate = ANT_heart_rate.BS0; break; case 1: this.SpeedDate = ANT_heart_rate.BS1; break; case 2: this.SpeedDate = ANT_heart_rate.BS2; break; case 3: this.SpeedDate = ANT_heart_rate.BS3; break; case 4: this.SpeedDate = ANT_heart_rate.BS4; break; case 5: this.SpeedDate = ANT_heart_rate.BS5; break; case 6: this.SpeedDate = ANT_heart_rate.BS6; break; case 7: this.SpeedDate = ANT_heart_rate.BS7; break; } this.bs = this.SpeedDate; bool flag11 = this.bstemp == this.bs; if (flag11) { this.bscount++; } else { this.bscount = 0; } bool flag12 = this.SpeedDate == null; if (flag12) { this.speed = 0.0; } else { try { this.speed = Convert.ToDouble(this.SpeedDate); this.bstemp = this.speed.ToString(); } catch { this.speed = 0.0; } bool flag13 = this.bscount >= 5; if (flag13) { this.speed = 0.0; ANT_heart_rate.BS0 = null; this.bstemp = this.speed.ToString(); } } } } bool flag14 = this.speed != 0.0; if (flag14) { bool connectflag2 = GlobalData.Connectflag; if (connectflag2) { this.power = GlobalData.getPower(this.speed, this.gear); } else { this.power = GlobalData.getPowerYZ(this.speed) * 0.84; bool flag15 = XMLHelper.UsersInforGetNum() > 0; if (flag15) { this.weight = Convert.ToInt32(XMLHelper.UsersInforReader("Information", 6)); } else { bool flag16 = GlobalData.weight != null; if (flag16) { this.weight = Convert.ToInt32(GlobalData.weight); } else { this.weight = 75; } } this.power1 = (double)(this.weight * 4); bool flag17 = this.power1 > this.power; if (flag17) { this.power = GlobalData.getPowerYZ(this.speed) * 0.84; } else { this.power = this.power1; } } } else { this.power = 0.0; } this.powerBox.Content = this.power.ToString("#0.0"); bool flag18 = !GlobalData.Connectflag; if (flag18) { bool flag19 = XMLHelper.UsersInforGetNum() > 0; if (flag19) { this.weight = Convert.ToInt32(XMLHelper.UsersInforReader("Information", 6)); } else { bool flag20 = GlobalData.weight != null; if (flag20) { this.weight = Convert.ToInt32(GlobalData.weight); } else { this.weight = 75; } } this.Horizontal = 9.8067 * Math.Cos(Math.Atan(this.slope / 100.0)) * (double)(this.weight + 7) * 0.005; this.x = Math.Atan(this.slope / 100.0); this.Friction = 9.8067 * (double)(this.weight + 7) * Math.Sin(this.x); this.Friction2 = -9.8067 * (double)(this.weight + 7) * Math.Sin(this.x); this.speed2 = 0.0; this.speed3 = 15.0; while (Math.Abs(this.speed3 - this.speed2) > 1.0) { bool flag21 = this.speed > 0.0; if (flag21) { bool flag22 = this.gear < 3; if (flag22) { this.DownSlopeResistance = 0.19657071 * (this.speed3 / 3.6) * (this.speed3 / 3.6); this.speed2 = 3.6 * (this.power + this.Friction2 * this.speed3 / 3.6) / (this.DownSlopeResistance + this.Horizontal); bool flag23 = this.speed2 > 75.0 || this.speed2 < 0.0; if (flag23) { this.speed2 = 75.0; } } else { this.UpSlopeResistance = 0.19657071 * (this.speed3 / 3.6) * (this.speed3 / 3.6); this.speed2 = 3.6 * this.power / (this.UpSlopeResistance + this.Horizontal + this.Friction); } bool flag24 = this.speed2 <= 0.0; if (flag24) { this.speed2 = 0.0; } } else { this.speed2 = 0.0; } bool flag25 = this.power == 0.0; if (flag25) { this.speed2 = 0.0; } this.speed3 = ((this.speed3 - this.speed2 > 0.0) ? (this.speed3 - 0.1) : (this.speed3 + 0.1)); } } bool flag26 = Math.Abs(this.oldspeed2 - this.speed2) > 5.0; if (flag26) { this.speed2 = 0.5 * (this.oldspeed2 + this.speed2); } this.oldspeed2 = this.speed2; this.speed = this.speed2; this.speedBox.Content = this.speed.ToString("#0.0"); this.distance += this.speed * 10.0 * 25.0 / 9.0 / 100000.0; bool flag27 = this.C_distance > this.distance; if (flag27) { double C_Left = this.C_distanceBox.Margin.Left; double P_Left = this.P_distanceBox.Margin.Left; double C_Top = this.C_distanceBox.Margin.Top; double P_Top = this.P_distanceBox.Margin.Top; double C_Left2 = this.C_image.Margin.Left; double P_Left2 = this.P_image.Margin.Left; double C_Top2 = this.C_image.Margin.Top; double P_Top2 = this.P_image.Margin.Top; bool flag28 = P_Top == 246.0; if (flag28) { this.P_distanceBox.Margin = new Thickness(P_Left, P_Top + 30.0, 0.0, 0.0); this.C_distanceBox.Margin = new Thickness(C_Left, C_Top - 30.0, 0.0, 0.0); this.P_image.Margin = new Thickness(P_Left2, P_Top2 + 30.0, 0.0, 0.0); this.C_image.Margin = new Thickness(C_Left2, C_Top2 - 30.0, 0.0, 0.0); } } bool flag29 = this.C_distance < this.distance; if (flag29) { double C_Left3 = this.C_distanceBox.Margin.Left; double P_Left3 = this.P_distanceBox.Margin.Left; double C_Top3 = this.C_distanceBox.Margin.Top; double P_Top3 = this.P_distanceBox.Margin.Top; double C_Left4 = this.C_image.Margin.Left; double P_Left4 = this.P_image.Margin.Left; double C_Top4 = this.C_image.Margin.Top; double P_Top4 = this.P_image.Margin.Top; bool flag30 = P_Top3 == 276.0; if (flag30) { this.P_distanceBox.Margin = new Thickness(P_Left3, P_Top3 - 30.0, 0.0, 0.0); this.C_distanceBox.Margin = new Thickness(C_Left3, C_Top3 + 30.0, 0.0, 0.0); this.P_image.Margin = new Thickness(P_Left4, P_Top4 - 30.0, 0.0, 0.0); this.C_image.Margin = new Thickness(C_Left4, C_Top4 + 30.0, 0.0, 0.0); } } bool flag31 = this.C_distance - this.distance >= 0.2; if (flag31) { this.flog = 0.7; } bool flag32 = this.C_distance - this.distance >= 0.05 && this.C_distance - this.distance < 0.2; if (flag32) { this.flog = 0.8; } bool flag33 = this.C_distance - this.distance >= 0.0 && this.C_distance - this.distance < 0.05; if (flag33) { this.flog = 0.9; } bool flag34 = this.distance - this.C_distance >= 0.0 && this.distance - this.C_distance < 0.05; if (flag34) { this.flog = 1.1; } bool flag35 = this.distance - this.C_distance >= 0.05 && this.distance - this.C_distance < 0.2; if (flag35) { this.flog = 1.2; } bool flag36 = this.distance - this.C_distance >= 0.2; if (flag36) { this.flog = 1.3; } this.C_speed = this.speed * this.flog; this.C_distance += this.C_speed * 10.0 * 25.0 / 9.0 / 100000.0; this.distanceBox.Content = this.distance.ToString("#0.0"); this.P_distanceBox.Content = this.distance.ToString("#00.000") + "Km"; this.C_distanceBox.Content = this.C_distance.ToString("#00.000") + "Km"; GlobalData.Distance = this.distance.ToString("#0.0"); GlobalData.distance = (this.distance * 1000.0).ToString("#0"); this.velocity = this.distance * 3600.0 / (double)GlobalData.Time; GlobalData.Velocity = this.velocity.ToString("#0.0"); GlobalData.velocity = (this.velocity * 1000.0).ToString("#0"); this.energy += this.power * 0.239 / 1000.0; this.energyBox.Content = this.energy.ToString("#0.0"); bool flag37 = GlobalData.heartChannel >= 0 && GlobalData.heartChannel < 8; if (flag37) { switch (GlobalData.heartChannel) { case 0: this.HeartRate = ANT_heart_rate.HR0; break; case 1: this.HeartRate = ANT_heart_rate.HR1; break; case 2: this.HeartRate = ANT_heart_rate.HR2; break; case 3: this.HeartRate = ANT_heart_rate.HR3; break; case 4: this.HeartRate = ANT_heart_rate.HR4; break; case 5: this.HeartRate = ANT_heart_rate.HR5; break; case 6: this.HeartRate = ANT_heart_rate.HR6; break; case 7: this.HeartRate = ANT_heart_rate.HR7; break; } this.hr = this.HeartRate; bool flag38 = this.hrtemp == this.hr; if (flag38) { this.hrcount++; } else { this.hrcount = 0; } } bool flag39 = this.HeartRate == null; if (flag39) { this.heart = 0.0; } else { try { this.heart = Convert.ToDouble(this.HeartRate); this.hrtemp = this.heart.ToString(); } catch { this.heart = 0.0; } bool flag40 = this.hrcount >= 10; if (flag40) { this.heart = 0.0; ANT_heart_rate.HR2 = null; this.hrtemp = this.heart.ToString(); } } this.heartBox.Content = this.heart.ToString("#0"); bool flag41 = GlobalData.cadenceChannel >= 0 && GlobalData.cadenceChannel < 8; if (flag41) { switch (GlobalData.cadenceChannel) { case 0: this.TrampDate = ANT_heart_rate.BC0; break; case 1: this.TrampDate = ANT_heart_rate.BC1; break; case 2: this.TrampDate = ANT_heart_rate.BC2; break; case 3: this.TrampDate = ANT_heart_rate.BC3; break; case 4: this.TrampDate = ANT_heart_rate.BC4; break; case 5: this.TrampDate = ANT_heart_rate.BC5; break; case 6: this.TrampDate = ANT_heart_rate.BC6; break; case 7: this.TrampDate = ANT_heart_rate.BC7; break; } this.bc = this.TrampDate; bool flag42 = this.bctemp == this.bc; if (flag42) { this.bccount++; } else { this.bccount = 0; } } bool flag43 = this.TrampDate == null; if (flag43) { this.tramp = 0.0; } else { try { this.tramp = Convert.ToDouble(this.TrampDate); this.bctemp = this.tramp.ToString(); } catch { this.tramp = 0.0; } bool flag44 = this.bccount >= 10; if (flag44) { this.tramp = 0.0; ANT_heart_rate.BC1 = null; this.bctemp = this.tramp.ToString(); } } this.tramptBox.Content = this.tramp.ToString("#0"); }
private void SaveQueryCondition() { if (this.CbSaveConditions.IsChecked == true) { //循环找出是否有重名的,有的话覆盖资料 string conditionName = this.ComboQueryConditions.Text; if (conditionName.Trim() == string.Empty) { CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("6101N0006", "Name cannot be Empty.")); return; } long queryCode = 0; List <string> ListSaveDatas = new List <string>(); QueryCondition SaveCondition = new QueryCondition(); bool Flag = false; for (int i = 0; i < mListQueryConditions.Count; i++) { if (mListQueryConditions[i].Name == conditionName) { SaveCondition.IsUse = mListQueryConditions[i].IsUse; SaveCondition.mName = mListQueryConditions[i].Name; SaveCondition.mDescription = mListQueryConditions[i].Description; SaveCondition.Priority = mListQueryConditions[i].Priority; SaveCondition.QueryCode = mListQueryConditions[i].QueryCode; SaveCondition.UserID = mListQueryConditions[i].UserID; SaveCondition.ReportCode = mListQueryConditions[i].ReportCode; SaveCondition.SetTime = mListQueryConditions[i].SetTime; SaveCondition.LastUseTime = mListQueryConditions[i].LastUseTime; SaveCondition.Source = mListQueryConditions[i].Source; Flag = true; break; } } if (!Flag)//没找到,要新建 { SaveCondition.QueryCode = 0; SaveCondition.UserID = CurrentApp.Session.UserID; SaveCondition.ReportCode = 61010000 + Rnumber; SaveCondition.SetTime = DateTime.Now; SaveCondition.Source = 'S'; SaveCondition.LastUseTime = DateTime.Now; SaveCondition.mName = this.ComboQueryConditions.Text; SaveCondition.mDescription = this.ComboQueryConditions.Text; SaveCondition.Priority = mListQueryConditions.Count; SaveCondition.IsUse = true; } OperationReturn optReturn = XMLHelper.SeriallizeObject <QueryCondition>(SaveCondition); if (!optReturn.Result) { ShowException(CurrentApp.GetLanguageInfo("", "Save Fail!")); return; } ListSaveDatas.Add(optReturn.Data as string); queryCode = SaveCondition.QueryCode; //添加detail。 for (int i = 1; i <= 3; i++) { QueryConditionItem queryItem = new QueryConditionItem(); queryItem.QueryConditionCode = queryCode; queryItem.Sort = i; queryItem.Type = 0; switch (i) { case 1: //录音时间 queryItem.QueryItemCode = (long)Const6101.Query_RecordTime; queryItem.Value1 = this.UC_DateTime_Begin.Text; queryItem.Value2 = this.UC_DateTime_End.Text; queryItem.Value3 = this.CBXLoggedTime.SelectedIndex.ToString(); break; case 2: //关键词 queryItem.QueryItemCode = (long)Const6101.Query_KeyWords; break; case 3: //报表类型 queryItem.QueryItemCode = (long)Const6101.Query_ReportType; queryItem.Value1 = this.CBTypeOfReport.SelectedIndex.ToString(); break; } OperationReturn optReturnItem = XMLHelper.SeriallizeObject <QueryConditionItem>(queryItem); if (!optReturnItem.Result) { ShowException(CurrentApp.GetLanguageInfo("", "Save Fail!")); return; } ListSaveDatas.Add(optReturnItem.Data as string); } //调用函数方法保存 WebRequest webRequest = new WebRequest(); webRequest.Code = (int)WebCodes.SaveQueryCondition; webRequest.ListData = ListSaveDatas; webRequest.Session = CurrentApp.Session; Service61012Client client = new Service61012Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service61012")); WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPReportOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } S6101App.InitObjects(); InitQueryCondition(); } }
public string GetName() { return(XMLHelper.GetValue(element, "name")); }
private void iniSett() { try { _upLoadFolder = ConfigHelper.GetAppString("UploadFolder"); _upLoadSize = ConfigHelper.GetAppInt("UpLoadSize"); string _configPath = ConfigHelper.GetAppString("configpath"); if (_upLoadFolder.StartsWith("~")) { _upLoadFolder = _upLoadFolder.Substring(1); } if (!_upLoadFolder.EndsWith("/")) { _upLoadFolder += "/"; } XmlDocument doc = new XmlDocument(); doc.Load(HttpContext.Current.Server.MapPath(_configPath)); _BBSURL = XMLHelper.GetSingleNodeValue(doc, "sysconfig/BBSURL"); _BBSDBType = XMLHelper.GetSingleNodeValue(doc, "sysconfig/BBSDBType"); _BBSConnStr = XMLHelper.GetSingleNodeValue(doc, "sysconfig/BBSConnStr"); _NFCPURL = XMLHelper.GetSingleNodeValue(doc, "sysconfig/NFCPURL"); _WMSURL = XMLHelper.GetSingleNodeValue(doc, "sysconfig/WMSURL"); _OAURL = XMLHelper.GetSingleNodeValue(doc, "sysconfig/OAURL"); _TMSURL = XMLHelper.GetSingleNodeValue(doc, "sysconfig/TMSURL"); _forgetpwd = XMLHelper.GetSingleNodeValue(doc, "sysconfig/email/forgetpwd", false); _register = XMLHelper.GetSingleNodeValue(doc, "sysconfig/email/register", false); _NotPass = XMLHelper.GetSingleNodeValue(doc, "sysconfig/email/NotPass", false); _Pass = XMLHelper.GetSingleNodeValue(doc, "sysconfig/email/Pass", false); _EmailServer = XMLHelper.GetSingleNodeValue(doc, "sysconfig/emailserver"); _EmailAddress = XMLHelper.GetSingleNodeValue(doc, "sysconfig/emailaddress"); _EmailPassWord = XMLHelper.GetSingleNodeValue(doc, "sysconfig/emailpassword"); _PageTitle = XMLHelper.GetSingleNodeValue(doc, "sysconfig/PageTitle"); _DALPath = XMLHelper.GetSingleNodeValue(doc, "sysconfig/DALPath"); _DefaultPwd = XMLHelper.GetSingleNodeValue(doc, "sysconfig/defaultpwd"); _DefaultPicPath = XMLHelper.GetSingleNodeValue(doc, "sysconfig/defaultpic"); string allext = XMLHelper.GetSingleNodeValue(doc, "sysconfig/AllowExt"); _allowExt = allext.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); _WebServerEmail = XMLHelper.GetSingleNodeValue(doc, "sysconfig/webemail"); _WebServerPhone = XMLHelper.GetSingleNodeValue(doc, "sysconfig/webphone"); _webICP = XMLHelper.GetSingleNodeValue(doc, "sysconfig/webICP"); _webkeyword = XMLHelper.GetSingleNodeValue(doc, "sysconfig/webkeyword"); _webdescription = XMLHelper.GetSingleNodeValue(doc, "sysconfig/webdescription"); } catch (Exception ex) { Log.Error(ex.Message, ex); } }
public string GetAlbumImageURL() { return(XMLHelper.GetValue(element, "image", "size", "large")); }
public void AnalysisBizFileToSubmit(string file, string pid) { DateTime?createtime = null; // 创建时间 DateTime?djsj = null; // 登记时间 DateTime?slsj = null; // 受理时间 DateTime?zxsj = null; // 注销时间 string ajzt = null; // 案件状态 string qszt = null; // 权属装填 string djxl = null; // 登记类型名称 Head head = XMLHelper.GetBizHeadInfo(file); RNANDCN rnandcn = new RNANDCN(); MSGTIMERECORD mtd = new MSGTIMERECORD(); RnandcnManager rm = new RnandcnManager(); MsgmanageManager mgr = new MsgmanageManager(); // JK库的MSGMANAGE表 MsgtimerecordManager mdr = new MsgtimerecordManager(); HolidayManager hgr = new HolidayManager(); string today = head.CreateDate.ToString("yyyyMMddhhmmss"); //string today2 = "20191018"; ICollection <RNANDCN> list = rm.Query("select * from RNANDCN where realeunum = '" + head.PreEstateNum + "' and ywh='" + head.RecFlowID + "' and to_char(createtime,'yyyyMMddhhmiss') = '" + today + "' "); MSGMANAGE msg = mgr.Query("select * from MSGMANAGE WHERE ESTATENUM ='" + head.PreEstateNum + "' and recflowid = '" + head.RecFlowID + "' and to_char(CREATEDATE,'yyyyMMddhhmiss') = '" + today + "'").ToList().FirstOrDefault(); if (msg != null) { mtd.UPTIME = msg.UPTIME; //上传时间 mtd.UPSTATUS = Convert.ToString(msg.UPSTATUS); //报文状态 } if (list.Count == 0) { InsertRNANDCN(pid, rnandcn, head, ref createtime); List <dynamic> entities = GetSmtInstance(file, head, ref djsj, ref slsj, ref zxsj, ref ajzt, ref qszt, ref djxl); string[] entityName = GetBizDataSonNodeName(file).ToArray(); int index = 0; foreach (var entity in entities) { EntityManager em = new EntityManager(); em.Insert(entityName[index], "PID", false, entity); index++; } mtd.DJSJ = djsj; mtd.SLSJ = slsj; mtd.ZXSJ = zxsj; mtd.AJZT = ajzt; mtd.QSZT = qszt; mtd.DJXL = djxl; //HOLIDAY holiday = hgr.Query("SELECT * FROM HOLIDAY WHERE TO_CHAR(DAY,'yyyyMMdd') = "+ today + "").FirstOrDefault(); //if (holiday!=null) //{ // mtd.ISHOLIDAY = holiday.STATUS; //} if ("2".Equals(qszt) && slsj != null && zxsj != null) { mtd.ISHOLIDAY = CompareDate((DateTime)slsj, (DateTime)zxsj, hgr)[0]; mtd.INTERVAL = CompareDate((DateTime)slsj, (DateTime)zxsj, hgr)[1]; mtd.DVALUE = CompareDate((DateTime)slsj, (DateTime)zxsj, hgr)[2]; } else if (slsj != null && djsj != null) { mtd.ISHOLIDAY = CompareDate((DateTime)slsj, (DateTime)djsj, hgr)[0]; mtd.INTERVAL = CompareDate((DateTime)slsj, (DateTime)djsj, hgr)[1]; mtd.DVALUE = CompareDate((DateTime)slsj, (DateTime)djsj, hgr)[2]; } InsertMSGTIMERECORD(pid, mtd, head); } else { //根据JK库报文状态,实时更新。 MSGTIMERECORD msgtd = mdr.Query("select * from MSGTIMERECORD WHERE BDCDYH ='" + head.PreEstateNum + "'and ywh = '" + head.RecFlowID + "' and to_char(CREATETIME,'yyyyMMddhhmiss') = '" + today + "'").ToList().FirstOrDefault(); if (msgtd != null) { msgtd.UPSTATUS = mtd.UPSTATUS; UpdateMSGTIMERECORD(msgtd); } } }
public void FromXML(XElement xmlElement) { Path = XMLHelper.GetSingleValue(xmlElement, "FilePath"); StartMark = int.Parse(XMLHelper.GetSingleValue(xmlElement, "StartMark", DefaultStartMark.ToString())); EndMark = int.Parse(XMLHelper.GetSingleValue(xmlElement, "EndMark", DefaultEndMark.ToString())); }
private void ModifyAlarmMessage() { try { if (AlarmItem == null) { return; } var alarmInfo = AlarmItem.Info; if (alarmInfo == null) { return; } if (string.IsNullOrEmpty(TxtName.Text)) { ShowException(CurrentApp.GetLanguageInfo("4415N003", string.Format("Name empty"))); return; } alarmInfo.Name = TxtName.Text; var typeItem = ComboType.SelectedItem as ComboItem; if (typeItem == null) { ShowException(CurrentApp.GetLanguageInfo("4415N004", string.Format("Type invalid"))); return; } alarmInfo.Type = typeItem.IntValue; alarmInfo.State = RadioStateEnable.IsChecked == true ? 0 : 2; if (TxtRank.Value == null) { ShowException(CurrentApp.GetLanguageInfo("4415N006", string.Format("Rank invalid"))); return; } int intValue = (int)TxtRank.Value; if (intValue < 0 || intValue > 10) { ShowException(CurrentApp.GetLanguageInfo("4415N006", string.Format("Rank invalid"))); return; } alarmInfo.Rank = intValue; alarmInfo.Color = TxtColor.SelectedColor.ToString(); bool isCopy = false; if (!string.IsNullOrEmpty(mAlarmIcon)) { alarmInfo.Icon = mAlarmIcon; isCopy = true; } if (TxtHoldTime.Value == null) { ShowException(CurrentApp.GetLanguageInfo("4415N007", string.Format("HoldTime invalid"))); return; } intValue = (int)TxtHoldTime.Value; if (intValue < 0) { ShowException(CurrentApp.GetLanguageInfo("4415N007", string.Format("HoldTime invalid"))); return; } alarmInfo.HoldTime = intValue; typeItem = ComboRelativeState.SelectedItem as ComboItem; if (typeItem == null) { alarmInfo.StateID = 0; } else { alarmInfo.StateID = typeItem.LongValue; } alarmInfo.Value = TxtValue.Text; alarmInfo.Content = TxtContent.Text; bool isFail = true; string strMsg = string.Empty; WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S4410Codes.SaveAlarmMessage; webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add("0"); webRequest.ListData.Add(isCopy ? "1" : "0"); webRequest.ListData.Add("1"); OperationReturn optReturn = XMLHelper.SeriallizeObject(alarmInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } webRequest.ListData.Add(optReturn.Data.ToString()); BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (s, de) => { try { Service44101Client client = new Service44101Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service44101")); WebReturn webReturn = client.DoOperation(webRequest); if (!webReturn.Result) { strMsg = string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message); return; } if (webReturn.ListData == null) { strMsg = string.Format("Fail.ListData is null"); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string str = webReturn.ListData[i]; CurrentApp.WriteLog("ModifyAlarmMessage", string.Format("{0}", str)); } isFail = false; } catch (Exception ex) { ShowException(ex.Message); } }; worker.RunWorkerCompleted += (s, re) => { worker.Dispose(); if (!isFail) { ShowInformation(CurrentApp.GetLanguageInfo("4415N009", string.Format("Modify successful"))); if (PageParent != null) { PageParent.ReloadData(); } var parent = Parent as PopupPanel; if (parent != null) { parent.IsOpen = false; } } else { ShowException(strMsg); } }; worker.RunWorkerAsync(); } catch (Exception ex) { ShowException(ex.Message); } }
public void LoadUserScoreResultList() { try { WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3103Codes.GetUserScoreSheetList; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(selTaskRecord.RecoredReference.ToString()); webRequest.ListData.Add(selTaskRecord.AgtOrExtID); webRequest.ListData.Add("1"); webRequest.ListData.Add(selTaskRecord.ScoreUserID.ToString()); //Service31031Client client = new Service31031Client(); Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031")); //WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException(string.Format("Fail.\tListData is null")); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; OperationReturn optReturn = XMLHelper.DeserializeObject <BasicScoreSheetInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicScoreSheetInfo info = optReturn.Data as BasicScoreSheetInfo; if (info == null) { ShowException(string.Format("Fail.\tBaiscScoreSheetInfo is null")); return; } long orgID = 0; var agentInfo = S3103App.mListAllObjects.FirstOrDefault(a => a.ObjType == ConstValue.RESOURCE_AGENT && a.Name == selTaskRecord.AgtOrExtName); if (agentInfo != null) { var orgInfo = agentInfo.Parent as ObjectItems; if (orgInfo != null) { if (orgInfo.ObjType == ConstValue.RESOURCE_ORG) { orgID = orgInfo.ObjID; } } } info.OrgID = orgID; BasicScoreSheetItem item = mListScoreSheetItems.FirstOrDefault(s => s.ScoreSheetID == info.ScoreSheetID); if (item != null && info.ScoreResultID == selTaskRecord.OldScoreID) { item.ScoreSheetInfo = info; item.ScoreResultID = info.ScoreResultID; item.Score = info.Score; item.Flag = 1; } } } catch (Exception ex) { ShowException(ex.Message); } }
/// <summary> /// get schedules data for reporting /// </summary> /// <param name="monthStr"></param> /// <returns></returns> public static Dictionary <string, JobsCount> GetSchedulesDataForReporint(string monthStr) { List <string> filesNames = XMLHelper.GetSchedulerReportingFiles(monthStr, "data"); return(XMLHelper.GetSchedulesForReporting(filesNames)); }
/// <summary> /// 把XML节点转换为ActivityEntity实体对象 /// </summary> /// <param name="node"></param> /// <returns></returns> internal TransitionEntity ConvertXmlTransitionNodeToTransitionEntity(XmlNode node) { //构造转移的基本属性 TransitionEntity entity = new TransitionEntity(); entity.TransitionGUID = XMLHelper.GetXmlAttribute(node, "id"); entity.FromActivityGUID = XMLHelper.GetXmlAttribute(node, "from"); entity.ToActivityGUID = XMLHelper.GetXmlAttribute(node, "to"); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(node, "direction"))) { entity.DirectionType = (TransitionDirectionTypeEnum)Enum.Parse(typeof(TransitionDirectionTypeEnum), XMLHelper.GetXmlAttribute(node, "direction")); } //构造活动节点的实体对象 entity.FromActivity = GetActivity(entity.FromActivityGUID); entity.ToActivity = GetActivity(entity.ToActivityGUID); //构造转移的条件节点 XmlNode conditionNode = node.SelectSingleNode("Condition"); if (conditionNode != null) { entity.Condition = new ConditionEntity(); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(conditionNode, "type"))) { entity.Condition.ConditionType = (ConditionTypeEnum)Enum.Parse(typeof(ConditionTypeEnum), XMLHelper.GetXmlAttribute(conditionNode, "type")); } if ((conditionNode.SelectSingleNode("ConditionText") != null) && !string.IsNullOrEmpty(XMLHelper.GetXmlNodeValue(conditionNode, "ConditionText"))) { entity.Condition.ConditionText = XMLHelper.GetXmlNodeValue(conditionNode, "ConditionText"); } } //构造转移的行为节点 XmlNode groupBehaviourNode = node.SelectSingleNode("GroupBehaviour"); if (groupBehaviourNode != null) { entity.GroupBehaviour = new GroupBehaviourEntity(); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(groupBehaviourNode, "priority"))) { entity.GroupBehaviour.Priority = short.Parse(XMLHelper.GetXmlAttribute(groupBehaviourNode, "priority")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(groupBehaviourNode, "parallelOption"))) { entity.GroupBehaviour.ParallelOption = (ParallelOptionEnum)Enum.Parse(typeof(ParallelOptionEnum), XMLHelper.GetXmlAttribute(groupBehaviourNode, "parallelOption")); } } return(entity); }
/// <summary> /// 把XML节点转换为ActivityEntity实体对象 /// </summary> /// <param name="node"></param> /// <returns></returns> internal ActivityEntity ConvertXmlActivityNodeToActivityEntity(XmlNode node) { ActivityEntity entity = new ActivityEntity(); entity.ActivityName = XMLHelper.GetXmlAttribute(node, "name"); entity.ActivityCode = XMLHelper.GetXmlAttribute(node, "code"); entity.ActivityGUID = XMLHelper.GetXmlAttribute(node, "id"); entity.ProcessGUID = ProcessEntity.ProcessGUID; //节点类型信息 XmlNode typeNode = node.SelectSingleNode("ActivityType"); entity.ActivityType = (ActivityTypeEnum)Enum.Parse(typeof(ActivityTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "type")); entity.ActivityTypeDetail = ConvertXmlNodeToActivityTypeDetail(typeNode); if (entity.ActivityType == ActivityTypeEnum.SubProcessNode) { //子流程节点 var subProcessNode = new SubProcessNode(entity); subProcessNode.SubProcessGUID = XMLHelper.GetXmlAttribute(typeNode, "subid"); entity.Node = subProcessNode; } //任务完成类型信息 XmlNode implementNode = node.SelectSingleNode("Implement"); if (implementNode != null) { entity.TaskImplementDetail = new TaskImplementDetail(); entity.TaskImplementDetail.ImplementationType = (ImplementationTypeEnum)Enum.Parse(typeof(ImplementationTypeEnum), XMLHelper.GetXmlAttribute(implementNode, "type")); //完成类型的详细信息 XmlNode contentNode = implementNode.SelectSingleNode("Content"); if (contentNode != null) { entity.TaskImplementDetail.Assembly = XMLHelper.GetXmlAttribute(contentNode, "assembly"); entity.TaskImplementDetail.Interface = XMLHelper.GetXmlAttribute(contentNode, "interface"); entity.TaskImplementDetail.Method = XMLHelper.GetXmlAttribute(contentNode, "method"); entity.TaskImplementDetail.Content = contentNode.InnerText; } } //节点的Split Join 类型 string gatewaySplitJoinType = XMLHelper.GetXmlAttribute(typeNode, "gatewaySplitJoinType"); if (!string.IsNullOrEmpty(gatewaySplitJoinType)) { entity.GatewaySplitJoinType = (GatewaySplitJoinTypeEnum)Enum.Parse(typeof(GatewaySplitJoinTypeEnum), gatewaySplitJoinType); } string gatewayDirection = XMLHelper.GetXmlAttribute(typeNode, "gatewayDirection"); //节点的路由信息 if (!string.IsNullOrEmpty(gatewayDirection)) { entity.GatewayDirectionType = (GatewayDirectionEnum)Enum.Parse(typeof(GatewayDirectionEnum), gatewayDirection); } return(entity); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { if ((xmlFileString = openFileDialog1.FileName) != null) { XMLHelper xmlHelper = new XMLHelper(xmlFileString, false, "procedures"); DataView xmlView = xmlHelper.GetData("procedures"); int number = xmlHelper.GetProcedureNumber("procedures"); number_pres = number; this.xmlViewData = xmlView; MyInitializeComponent(number); } } }
/// <summary> /// 把Xml节点转换为ActivityTypeDetail 类(用于会签等复杂类型) /// </summary> /// <param name="typeNode"></param> /// <returns></returns> private ActivityTypeDetail ConvertXmlNodeToActivityTypeDetail(XmlNode typeNode) { ActivityTypeDetail entity = new ActivityTypeDetail(); entity.ActivityType = (ActivityTypeEnum)Enum.Parse(typeof(ActivityTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "type")); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "complextype"))) { entity.ComplexType = (ComplexTypeEnum)Enum.Parse(typeof(ComplexTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "complextype")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "mergetype"))) { entity.MergeType = (MergeTypeEnum)Enum.Parse(typeof(MergeTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "mergetype")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "completeorder"))) { entity.CompleteOrder = float.Parse(XMLHelper.GetXmlAttribute(typeNode, "completeorder")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "skip"))) { var skip = Boolean.Parse(XMLHelper.GetXmlAttribute(typeNode, "skip")); var skipto = XMLHelper.GetXmlAttribute(typeNode, "to"); if (skip) { entity.SkipInfo = new SkipInfo { IsSkip = skip, Skipto = skipto }; } } return(entity); }
private void btnRegister_Click(object sender, EventArgs e) { if (!txtPassword_2.Text.ToString().Equals(txtPassword.Text.ToString())) { MessageBox.Show("Error: Passwords dont match"); return; } try { User myUser = new User(); myUser.Email = txtEmail.Text; myUser.CostPerGame = 1.0; myUser.Balance = 50; myUser.Password = txtPassword.Text; myUser.UserName = txtUsername.Text; myUser.ImageURL = Helper.GetImageDirectory() + "\\" + txtImage.Text; UserList myUserList = new UserList(); XMLHelper<UserList> myXML = new XMLHelper<UserList>(); myXML.Load(ref myUserList); if(myUserList.FindName(myUser.UserName) == -1) { myUserList.AddItem(myUser); myXML.Save(myUserList); this.Dispose(); if (WriteInHome != null) WriteInHome(); } else { MessageBox.Show("This Username has been Taken, Please Select Another Name"); } } catch (Exception ex) { MessageBox.Show("Error Occurred: " + ex.Message.ToString()); return; } }
private void GetCurrentKeyGenServer() { Service24011Client client = null; try { WebReturn webReturn = null; WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S2400RequestCode.GetCurrentKeyGenServer; webRequest.Session = CurrentApp.Session; client = new Service24011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service24011")); webReturn = client.DoOperation(webRequest); CurrentApp.MonitorHelper.AddWebReturn(webReturn); if (!webReturn.Result) { ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, CurrentApp.GetLanguageInfo(webReturn.Code.ToString(), webReturn.Message))); return; } if (webReturn.Result && string.IsNullOrEmpty(webReturn.Data)) { HasKeyGenServer = false; return; } OperationReturn optReturn = XMLHelper.DeserializeObject <KeyGenServerEntry>(webReturn.Data.ToString()); if (!optReturn.Result) { HasKeyGenServer = false; return; } KeyGenServerEntry keyGenServer = optReturn.Data as KeyGenServerEntry; //尝试连接服务 如果能连接成功 就显示可用的服务 webRequest = new WebRequest(); webRequest.Code = (int)S2400RequestCode.TryConnToKeyGenServer; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(keyGenServer.HostAddress); webRequest.ListData.Add(keyGenServer.HostPort); client = new Service24011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service24011")); webReturn = client.DoOperation(webRequest); CurrentApp.MonitorHelper.AddWebReturn(webReturn); if (!webReturn.Result) { HasKeyGenServer = false; return; } HasKeyGenServer = true; keyGenEntry = keyGenServer; } catch (Exception ex) { ShowException(ex.Message); } finally { if (client != null) { if (client.State == System.ServiceModel.CommunicationState.Opened) { client.Close(); } } } }
/// <summary> /// This is Fired when the Save Message Box is Fired /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void confirmSaveMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { //Transfer SaveTempGame (saveGame.xml) to SaveGameList SaveGame myTempGame = new SaveGame(); XMLHelper<SaveGame> TempXML = new XMLHelper<SaveGame>(); TempXML.Load(ref myTempGame); SaveGameList mySaveGameList = new SaveGameList(); XMLHelper<SaveGameList> SaveGameXML = new XMLHelper<SaveGameList>(); SaveGameXML.Load(ref mySaveGameList); mySaveGameList.AddItem(myTempGame); SaveGameXML.Save(mySaveGameList); LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }
internal void ConvertDevJsonToXml_Utility(int expectedReplicaSize, string inputFile, string outputFile, string sectionToChangeWin7, bool isSecure = false, bool testOverride = false) { Console.WriteLine("Current directory: {0}", Environment.CurrentDirectory); string clusterConfigPath = Path.Combine(DevJsonModelTest.BaseDir, inputFile); Directory.SetCurrentDirectory(DevJsonModelTest.BaseDir); Console.WriteLine("New current directory changed to: {0}", Environment.CurrentDirectory); string clusterManifestPath = Path.Combine(Path.GetTempPath(), outputFile); var clusterResource = DeploymentManagerInternal.GetClusterResource(clusterConfigPath, System.Guid.NewGuid().ToString()); var cm = clusterResource.Current.ExternalState.ClusterManifest; Assert.IsNotNull(cm, "Cluster manifest was null."); File.Delete(clusterManifestPath); XMLHelper.WriteXmlExclusive <ClusterManifestType>(clusterManifestPath, cm); List <string> machines = StandaloneUtility.GetMachineNamesFromClusterManifest(clusterManifestPath); Assert.IsNotNull(machines); Assert.AreEqual(expectedReplicaSize, ((WindowsInfrastructureType)cm.Infrastructure.Item).NodeList.ToList().Where(node => node.IsSeedNode).Count()); if (isSecure) { Assert.AreEqual(InputEndpointTypeProtocol.https, cm.NodeTypes[0].Endpoints.HttpGatewayEndpoint.Protocol); Assert.IsNotNull(cm.NodeTypes[0].Certificates.ClientCertificate, "Client certificate was null."); } foreach (SettingsOverridesTypeSection setting in cm.FabricSettings) { Assert.IsTrue(IsSectionAllowed(cm.NodeTypes.Count(), setting.Name)); if (setting.Name == StringConstants.SectionName.Setup) { foreach (SettingsOverridesTypeSectionParameter param in setting.Parameter) { Assert.AreNotEqual(StringConstants.ParameterName.IsDevCluster, param.Name); if (param.Name == StringConstants.ParameterName.FabricDataRoot) { Assert.AreEqual(Environment.ExpandEnvironmentVariables("%systemdrive%\\SfDevCluster\\Data"), param.Value); } } } if (setting.Name == StringConstants.SectionName.ClusterManager) { SettingsOverridesTypeSectionParameter TargetReplicaSetSizeParam = setting.Parameter.FirstOrDefault(x => x.Name == StringConstants.ParameterName.TargetReplicaSetSize); Assert.IsNotNull(TargetReplicaSetSizeParam, "Cannot find TargetReplicaSetSize for Cluster Manager"); Assert.AreEqual(expectedReplicaSize.ToString(), TargetReplicaSetSizeParam.Value); } if (DevJsonModel.IsWin7() && setting.Name == sectionToChangeWin7) { SettingsOverridesTypeSectionParameter isEnabledParam = setting.Parameter.FirstOrDefault(x => x.Name == StringConstants.ParameterName.IsEnabled); Assert.IsNotNull(isEnabledParam, "Cannot find isEnabled for " + sectionToChangeWin7); Assert.AreEqual("false", isEnabledParam.Value); } if (setting.Name == StringConstants.SectionName.Diagnostics && testOverride) { SettingsOverridesTypeSectionParameter isEnabledTraceSessionParam = setting.Parameter.FirstOrDefault(x => x.Name == StringConstants.ParameterName.EnableCircularTraceSession); Assert.IsNotNull(isEnabledTraceSessionParam, "Cannot find isEnabled for EnableCircularTraceSession"); Assert.AreEqual("false", isEnabledTraceSessionParam.Value); } if (setting.Name == StringConstants.SectionName.FailoverManager && expectedReplicaSize == 1) { SettingsOverridesTypeSectionParameter IsSingletonReplicaMoveAllowedDuringUpgradeParam = setting.Parameter.FirstOrDefault(x => x.Name == StringConstants.ParameterName.IsSingletonReplicaMoveAllowedDuringUpgrade); Assert.IsNotNull(IsSingletonReplicaMoveAllowedDuringUpgradeParam, "Cannot find isEnabled for EnableCircularTraceSession"); Assert.AreEqual("false", IsSingletonReplicaMoveAllowedDuringUpgradeParam.Value); } } //DevCluster should have one distinct IPaddress, i.e. localhost Assert.AreEqual(1, machines.Count); }
public static void Save(ConfigBase config) { string configFileName = config.Key + CONFIG_EXT; string configFile = Path.Combine(ConfigFolder, configFileName); XMLHelper xml = new XMLHelper(configFile, ENCRYPT); xml.Save(config); }
/// <summary> /// 取得发电量数据 /// </summary> /// <param name="plantId"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <param name="chartTitle"></param> /// <param name="unit"></param> /// <returns></returns> public static IList <KeyValuePair <string, float?> > getEnergyData(string plantId, string startDate, string endDate, string chartTitle, string unit, out float maxValue) { string startDateStr = string.Format("{0}-{1}-{2}", endDate.Substring(0, 4), endDate.Substring(4, 2), endDate.Substring(6, 2)); double cacheHour = DateTime.Parse(startDateStr) < DateTime.Now.AddDays(-1) ? 24 : 0.5; maxValue = 0f; string key = plantId + startDate + endDate; IList <KeyValuePair <string, float?> > chartData = null; DateTime lastDate = dataDateMap.ContainsKey(key) ? dataDateMap[key] : DateTime.Now; if (lastDate.AddHours(cacheHour) > DateTime.Now) { chartData = energyItemMap.ContainsKey(key) ? energyItemMap[key] : null; maxValue = maxEnergyMap.ContainsKey(key) ? maxEnergyMap[key] : 0f; } if (chartData != null) { return(chartData); } string filename = System.Environment.CurrentDirectory + "/data/energy/" + key; try { ChartData data = JsonUtil.getChartData(string.Format("/openapi/PlantMonthDayChart?pid={0}&startdate={1}&enddate={2}", plantId, startDate, endDate)); if (data == null) { maxValue = 0f; data = new ChartData(); if (File.Exists(filename)) { try { XMLHelper.DeserializerXML <ChartData>(filename, ref data); chartData = JsonUtil.DeserializeChartData(data, out chartTitle, out unit, out maxValue); } catch (Exception eee) { Console.WriteLine(eee.StackTrace); chartData = null; } } else { return(null); } } else { chartData = JsonUtil.DeserializeChartData(data, out chartTitle, out unit, out maxValue); dataDateMap[key] = DateTime.Now; energyItemMap[key] = chartData; maxEnergyMap[key] = maxValue; //写入本地缓存 try { if (chartData != null) { XMLHelper.SerializerXML <ChartData>(filename, data); } } catch (Exception eee) { Console.WriteLine(eee.StackTrace); } } } catch (Exception e2) { LogUtil.error("getEnergyData error:" + e2.Message); return(null); } return(chartData); }
private void btnLogin_Click(object sender, EventArgs e) { String Username = txtFirstUser.Text; String Password = txtFirstPassword.Text; if (Username.ToUpper().Equals("SA") && Password.ToUpper().Equals("SA")) { if (SALogin != null) { this.Dispose(); SALogin(); } } else { //Verify Username and Password from UserList myUserXML.Load(ref myUserList); Boolean UserFound = false; for (int i = 0; i < myUserList.myUsers.Length; i++) { if (myUserList.myUsers[i].UserName.ToUpper().Equals(Username.ToUpper()) && myUserList.myUsers[i].Password.ToUpper().Equals(Password.ToUpper())) { if (myUserList.myUsers[i].IsApproved == false) { MessageBox.Show("User has not been approved by SA yet"); return; } if (LoginSuccessful != null) { UserFound = true; UserOne = myUserList.myUsers[i]; myPRHome = new Main_XNA_Game.GUI.PR.frmHome(UserOne); GamePlayers myGamePlayers = new GamePlayers(); XMLHelper<GamePlayers> myXMLGame = new XMLHelper<GamePlayers>(); myGamePlayers.AddItem(UserOne); myXMLGame.Save(myGamePlayers); //myPRHome.Visible = true; this.Dispose(); LoginSuccessful(UserOne); break; } break; } } if (!UserFound) MessageBox.Show("Login Unsuccessful"); } }
/// <summary> /// 取得电站信息 /// </summary> /// <param name="plantId"></param> /// <returns></returns> public static PlantVO getPlantInfo(string plantId) { PlantVO pvo = null; DateTime lastDate = dataDateMap.ContainsKey(plantId) ? dataDateMap[plantId] : DateTime.Now; if (lastDate.AddMinutes(30) > DateTime.Now) { pvo = dataItemMap.ContainsKey(plantId) ? dataItemMap[plantId] : null; } if (pvo != null) { return(pvo); } string filename = System.Environment.CurrentDirectory + "/data/info/" + plantId; try { string jsonStr = JsonUtil.loadJsonStr(string.Format("/openapi/plantinfo?pid={0}", plantId), "en-us"); pvo = JsonUtil.Deserialize <PlantVO>(jsonStr); if (pvo == null) { pvo = new PlantVO(); if (File.Exists(filename)) { try { XMLHelper.DeserializerXML <PlantVO>(filename, ref pvo); } catch (Exception eee) { Console.WriteLine(eee.StackTrace); pvo = null; } } else { return(null); } } else { dataDateMap[plantId] = DateTime.Now; dataItemMap[plantId] = pvo; //写入本地缓存 try { if (pvo != null) { XMLHelper.SerializerXML <PlantVO>(filename, pvo); } } catch (Exception eee) { Console.WriteLine(eee.StackTrace); } } } catch (Exception e2) { LogUtil.error("getPlantInfo error:" + e2.StackTrace); return(null); } return(pvo); }
void myProgram_GameEnded(Object obj) { if (this.InvokeRequired) { this.Invoke(new MethodInvoker(delegate { this.Visible = true; })); txtPass2.Invoke(new MethodInvoker(delegate { txtPass2.Text = ""; })); String Msg = "At this point ControlPasses back to the main Form, along with an object which represents the updated list of the two players that were playing the game"; MessageBox.Show(Msg); GamePlayers myGame = new GamePlayers(); UserList myUserList = new UserList(); XMLHelper<GamePlayers> myXMLGame = new XMLHelper<GamePlayers>(); XMLHelper<UserList> myXMLUser = new XMLHelper<UserList>(); myXMLGame.Load(ref myGame); myXMLUser.Load(ref myUserList); if (myGame.myPlayers.Length > 0) { int one = myUserList.FindName(myGame.myPlayers[0].UserName); int two = myUserList.FindName(myGame.myPlayers[1].UserName); myUserList.myUsers[one].TotalWins = myUserList.myUsers[one].TotalWins + myGame.myPlayers[0].TotalWins; myUserList.myUsers[one].TotalGames = myUserList.myUsers[one].TotalGames + myGame.myPlayers[0].TotalGames; myUserList.myUsers[two].TotalWins = myUserList.myUsers[two].TotalWins + myGame.myPlayers[1].TotalWins; myUserList.myUsers[two].TotalGames = myUserList.myUsers[two].TotalGames + myGame.myPlayers[1].TotalGames; myXMLUser.Save(myUserList); } } }
private EConnectCreateOrderResponse ProcessRequest(List<RFIDPassMediaReissueDetailStage> orderDetails) { string xmlRequestCreateOrder = ""; string xmlRequestFulfillOrder = ""; XMLHelper xmlHelper = new XMLHelper(); EConnectCreateOrderResponse createOrderResponse = null; EConnectFulfillOrderResponse fulfillOrderResponse = null; //Asssemble XML request xmlRequestCreateOrder = orderDetails.Count == 1 ? xmlHelper.AssembleOneUserCreateOrderRequest(orderDetails[0]) : xmlHelper.AssembleMultiUserCreateOrderRequest(orderDetails); //Create Order createOrderResponse = ExecuteConnectCreateOrder(xmlRequestCreateOrder); //Fulfill Order if (createOrderResponse.ResponseCode == 0) { xmlRequestFulfillOrder = xmlHelper.AssembleFulfillOrderRequest(orderDetails, createOrderResponse.DistributorOrderID); fulfillOrderResponse = ExecuteConnectFulfillOrder(xmlRequestFulfillOrder); createOrderResponse.ResponseCode = fulfillOrderResponse.ResponseCode; createOrderResponse.ResponseMessage = fulfillOrderResponse.ResponseMessage; createOrderResponse.TransactionId = fulfillOrderResponse.TransactionId; createOrderResponse.EConnectFulfillOrderResponse = fulfillOrderResponse; } return createOrderResponse; }