// Set The Initial position of the Row using Server JSON Data void setIntialPositionOfRobo() { try { //call webservice to get Json data from server var result = CallWebService.GetSweepingAreaDetails(); if (result != null && result.isSuccess == true) { var cmd_Instruction = result.Data; MaxNumberOfCommand = cmd_Instruction.NumberOfCommands; Current_XPosition = cmd_Instruction.Start_XPositiom; Current_YPosition = cmd_Instruction.Start_YPositiom; //Place the robo at starting position placeImageAtInitianPosition(cmd_Instruction.Start_XPositiom, cmd_Instruction.Start_YPositiom, img_sweeper); } else { ShowValidationMessage(result.Messasge); } } catch (Exception ex) { } }
private void Save(CallWebService callWebService) { var noticeTargets = mySqlNoticeTargetContainer.GetSelectedValues(); var name = window.MySql_Name.Text.Trim(); var host = window.MySql_Host.Text.Trim(); var port = window.MySql_Port.Text.Trim(); var user = window.MySql_User.Text.Trim(); var password = window.MySql_Password.Text.Trim(); var database = window.MySql_Database.Text.Trim(); var validate = new Validate(); validate.AddCmd(new ValidateCmd(name, "监控名称为空")); validate.AddCmd(new ValidateCmd(host, "主机地址为空")); validate.AddCmd(new ValidateCmd(port, "端口号为空")); validate.AddCmd(new ValidateCmd("端口号必须为数字", () => Validate.IsInteger(port))); validate.AddCmd(new ValidateCmd(user, "用户为空")); validate.AddCmd(new ValidateCmd(password, "密码为空")); validate.AddCmd(new ValidateCmd(database, "数据库名为空")); validate.AddCmd(new ValidateCmd("通知人员未选择", () => noticeTargets.Count > 0)); if (!validate.Execute()) { return; } var result = callWebService(host, port, user, password, database, name, string.Join(",", noticeTargets)); MsgBox.Alert(result.Message); if (result.Code == ServerResult <object> .CODE_SUCCESS) { this.InitMySqlList(); TreeViewReset(); } }
/// <summary> /// 检测远程服务器连接状态 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Web_Service_Status_DoWork(object sender, DoWorkEventArgs e) { //检测联网状态 while (true) { pingReply = ping.Send(ConfigurationManager.AppSettings["service_ip"]); if (pingReply.Status == IPStatus.Success) { PubFlag.online = true; service_status.Image = Properties.Resources.connected; service_status.Text = "【已联网】"; get_gun.Enabled = true; //return_gun.Enabled = true; another_task.Enabled = true; //通知者,联网状态下调webservice接口 CallWebService.call(); } else { PubFlag.online = false; service_status.Image = Properties.Resources.unconnected; service_status.Text = "【未联网】"; get_gun.Enabled = false; //return_gun.Enabled = false; another_task.Enabled = false; } //每隔五秒检测一次网络 System.Threading.Thread.Sleep(5000); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { string inputUrl = "http://localhost:59568/Api/Home/Post"; UserPages objdata = new UserPages(); objdata.username = drpUsers.SelectedValue.ToString(); objdata.page1 = Page1LinkToggle.Checked; objdata.page2 = Page2LinkToggle.Checked; objdata.page3 = Page3LinkToggle.Checked; string data = JsonConvert.SerializeObject(objdata); string result = CallWebService.POST(inputUrl, data); if (result == "inserted") { lblresult.InnerText = "Saved Successfully!!!"; } else if (result == "updated") { lblresult.InnerText = "Updated Successfully!!!"; } else { lblresult.InnerText = "Error"; } lblresult.Style.Add("display", "block"); } catch (Exception ex) { throw ex; } }
public EmployeeReconciliationService( ExitSurveyAdminContext context, CallWebService callWeb, EmployeeInfoLookupService infoLookupService ) { this.context = context; this.callWeb = callWeb; this.infoLookupService = infoLookupService; }
private static void update_users(Guid applicationId) { try { string res = CallWebService.CallWebMethod("http://wsrefahicard.isfahan.ir/RefahService.asmx", "GetknowledgemanagementEmployeeWithArg", "knowledgemanagement", "EmpknowledgemanageWebService@128", new Dictionary <string, string>()); XmlDocument doc = new XmlDocument(); doc.LoadXml(res); XmlNodeList nodes = doc.GetElementsByTagName("Personel"); List <ExchangeUser> users = new List <ExchangeUser>(); foreach (XmlNode nd in nodes) { string un = nd.SelectSingleNode("MelliCode").InnerText.Trim(); if (!string.IsNullOrEmpty(un)) { string pass = un; while (pass.Length < 5) { pass += un; } users.Add(new ExchangeUser() { //UserName = nd.SelectSingleNode("empno").InnerText.Trim(), UserName = un, FirstName = PublicMethods.verify_string(nd.SelectSingleNode("Name").InnerText.Trim()), LastName = PublicMethods.verify_string(nd.SelectSingleNode("Family").InnerText.Trim()), Password = new Password(pass) }); } } for (int i = 0; i < users.Count;) { List <ExchangeUser> exLst = new List <ExchangeUser>(); for (int j = 0; j < 200 && i < users.Count; ++j) { exLst.Add(users[i++]); } DEController.update_users(applicationId, exLst); } } catch (Exception ex) { LogController.save_error_log(applicationId, null, "job_updateusers_esf_webservice", ex, ModuleIdentifier.Jobs); } }
static void Main(string[] args) { CallWebService webService = new CallWebService(); string xmlRequestContent = $"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tip=\"http://www.dsc.com.tw/tiptop/TIPTOPServiceGateWay\"><soapenv:Header/><soapenv:Body><tip:GetProductInfoRequest><tip:request> <Request><Access><Authentication user=\"tiptop\" password=\"tiptop\" /><Connection application=\"PLM\" source=\"192.168.1.2\" /><Organization name=\"YI\" /><Locale language=\"zh_tw\" /></Access><RequestContent><Parameter><Record><Field name=\"sfb01\" value=\"xxx-00002\" /></Record></Parameter> </RequestContent></Request> </tip:request> </tip:GetProductInfoRequest> </soapenv:Body></soapenv:Envelope>"; //string xmlRequestContent = $"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tip=\"http://www.dsc.com.tw/tiptop/TIPTOPServiceGateWay\"><soapenv:Header/><soapenv:Body><tip:GetProductInfoRequest><tip:request> <Request><Access><Authentication user=\"tiptop\" password=\"tiptop\" /><Connection application=\"PLM\" source=\"192.168.1.2\" /><Organization name=\"YI\" /><Locale language=\"zh_tw\" /></Access><RequestContent><Parameter><Record><Field name=\"sfb01\" value=\"xxx-00002\" /></Record></Parameter> </RequestContent></Request> </tip:request> </tip:GetProductInfoRequest> </soapenv:Body></soapenv:Envelope>"; string returnValue = webService.SendRequest("http://211.22.185.46:5280/web/ws/r/aws_ttsrv2_toptest", "", xmlRequestContent, escaped: false); Console.WriteLine(returnValue); Console.ReadLine(); }
public EmployeesController( ExitSurveyAdminContext context, SieveProcessor sieveProcessor, EmployeeInfoLookupService employeeInfoLookup, EmployeeReconciliationService employeeReconciler, CallWebService callWebService, LoggingService loggingService ) { this.context = context; SieveProcessor = sieveProcessor; EmployeeInfoLookup = employeeInfoLookup; EmployeeReconciler = employeeReconciler; this.callWebService = callWebService; logger = loggingService; }
protected void drpUsers_SelectedIndexChanged(object sender, EventArgs e) { try { string inputUrl = "http://localhost:59568/Api/Home/Get"; string resultJson = CallWebService.GET(inputUrl + "/user=" + drpUsers.SelectedValue.ToString()); if (!string.IsNullOrEmpty(resultJson)) { List <UserPages> objpages = JsonConvert.DeserializeObject <List <UserPages> >(resultJson); Page1LinkToggle.Checked = objpages[0].page1; Page2LinkToggle.Checked = objpages[0].page2; Page3LinkToggle.Checked = objpages[0].page3; } } catch (Exception ex) { throw ex; } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { string inputUrl = "http://localhost:59568/Api/Values/Post"; string data = "{ \"username\": " + '"' + txtUsername.Text + '"' + " ,\"email\":" + '"' + txtEmailid.Text.ToString() + '"' + ",\"password\":" + '"' + txtPassword.Text.ToString() + " }"; string result = CallWebService.POST(inputUrl, data); if (result == "success") { lblresult.Style.Add("display", "block"); } else { lblresult.InnerText = "New User Registration Error"; lblresult.Style.Add("display", "block"); } } catch (Exception ex) { throw ex; } }
private static void update_chart(Guid applicationId) { try { string depTypeAddId = "6"; string res = CallWebService.CallWebMethod("http://wsrefahicard.isfahan.ir/RefahService.asmx", "GetknowledgeManagementEmpChartWithArg", "knowledgemanagement", "EmpknowledgemanageWebService@128", new Dictionary <string, string>()); XmlDocument doc = new XmlDocument(); doc.LoadXml(res); XmlNodeList nodes = doc.GetElementsByTagName("Personel"); List <ExchangeNode> exNodes = new List <ExchangeNode>(); List <ExchangeMember> exMembers = new List <ExchangeMember>(); Dictionary <string, bool> ids = new Dictionary <string, bool>(); foreach (XmlNode nd in nodes) { string id = nd.SelectSingleNode("ChartId").InnerText.Trim(); string parentId = nd.SelectSingleNode("parentid").InnerText.Trim(); string title = nd.SelectSingleNode("title").InnerText.Trim(); string username = nd.SelectSingleNode("melicode").InnerText.Trim(); string isAdmin = nd.SelectSingleNode("IsManagement").InnerText.Trim(); long val = 0; if (!long.TryParse(id, out val) || val <= 0) { id = null; } if (!long.TryParse(parentId, out val) || val <= 0) { parentId = null; } if (!long.TryParse(username, out val) || val <= 0) { username = string.Empty; } if (!long.TryParse(isAdmin, out val) || val <= 0) { isAdmin = string.Empty; } if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(title) && !exNodes.Any(u => u.AdditionalID == id)) { exNodes.Add(new ExchangeNode() { AdditionalID = id, ParentAdditionalID = parentId, Name = title }); } if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(username) && !exMembers.Any(u => u.NodeAdditionalID == id && u.UserName == username)) { exMembers.Add(new ExchangeMember() { NodeTypeAdditionalID = depTypeAddId, NodeAdditionalID = id, UserName = username, IsAdmin = !string.IsNullOrEmpty(isAdmin) && isAdmin != "0" }); } } List <Guid> nIds = new List <Guid>(); DEController.update_nodes(applicationId, exNodes, null, depTypeAddId, Guid.Parse("6B9E8414-C1EA-4E59-8AA8-34B4BCEB74E7"), ref nIds); for (int i = 0; i < exMembers.Count;) { List <ExchangeMember> exLst = new List <ExchangeMember>(); for (int j = 0; j < 200 && i < exMembers.Count; ++j) { exLst.Add(exMembers[i++]); } DEController.update_members(applicationId, exLst); } } catch (Exception ex) { LogController.save_error_log(applicationId, null, "job_update_dep_and_members_esf_webservice", ex, ModuleIdentifier.Jobs); } }
void Start() { DataService C = new DataService("DatiCliente.db"); if (false) { ContentCreator.ClienteRegistrato = C.CheckDatiCliente(); if (ContentCreator.ClienteRegistrato) { ContentCreator.ClienteTKy = C.GetTipoDati(); ContentCreator.ClienteRegMin = C.GetRegMin(); IEnumerable <DatiCliente> Dci = C.GetDatiCliente(); foreach (DatiCliente D in Dci) { if (D.Id == 1) { ContentCreator.datiCliente.Nome = D.Nome; ContentCreator.datiCliente.Cognome = D.Cognome; ContentCreator.datiCliente.Tel = D.Tel; ContentCreator.datiCliente.Email = D.Email; ContentCreator.datiCliente.Indirizzo = D.Indirizzo; ContentCreator.datiCliente.Citta = D.Citta; ContentCreator.datiCliente.CAP = D.CAP; } } } } //Update(); if ((seat == "" && sala == "") || (seat == "X" || sala == "X") || (seat == null && sala == null)) { SelectionPanel.gameObject.SetActive(true); } if (Db == 0) { //loadtext.text = ("Db= " + Db + "Utenza =" + Utenza + "Restaurant =" + Restaurant); if (urlLocali == null) { urlLocali = "https://safemenu.altervista.org/wp-content/MolRa/Locale.xml"; Restaurant = "MolRa"; seat = "T0"; Db = 0; } Locali lc = Locali.Load(urlLocali); foreach (Locale locale in lc.CollezioneLocali) { NomeLocaleLong = locale.s_nomeLocale; hideTotal = locale.s_HideTotal; if (hideTotal) { Color col = new Color(0, 0, 0, 0); Comanda.C5.Totale.color = col; Comanda.C5.text_Totale.color = col; } else { Color col = new Color(0, 0, 0, 1); Comanda.C5.Totale.color = col; Comanda.C5.text_Totale.color = col; } ColorController.ColoreSfondi = hexToColor(locale.s_ColorTheme); ColorController.ColoreRiquadri = hexToColor(locale.s_ColorFrame); print(locale.s_Landing); print(locale.s_ShortName); print(locale.s_Base); if (locale.s_ShortName == Restaurant) { welcome.text = locale.s_Landing; //Key = "AaK1Dsz3z2xqhYs2JaHOXQpxUxxdO3ZYihg0IuebKVxUwU2xh4vS0BThdSz4rG4uSi-QU6gMXFy_QsNE";// locale.s_CID; //secret = "EBjXni131N_Ci2795OXE2qc11ndEncytbujnbHTK2Ez4o9HszD0ra2Rw8F_O03pluGxYWiZ46jwwsYiY"; // locale.s_SKE; Key = locale.s_CID; secret = locale.s_SKE; consInt = locale.s_consegnaInterna; Tky = locale.s_TakeAway; Dlv = locale.s_Delivery; Base = locale.s_Base; bool MD = locale.s_EnableMD; SelectionBtnRoot.transform.GetChild(0).gameObject.SetActive(MD); SelectionBtnRoot.transform.GetChild(1).gameObject.SetActive(Base); SelectionBtnRoot.transform.GetChild(2).gameObject.SetActive(Tky); SelectionBtnRoot.transform.GetChild(3).gameObject.SetActive(Dlv); SelectionBtnRoot.transform.GetChild(4).gameObject.SetActive(consInt); if (seat == "Tky" || seat == "Dlv") { welcome.text = locale.s_LandingGen; CodeUniversal = true; Comanda.C5.Invia_Button_Text.text = "Vai al pagamento"; Comanda.C5.ComandaText.text = "procedere con il pagamento?"; Comanda.Pay = true; currentMode = seat; } } } const string glyphs = "abcdefghijklmnopqrstuvwxyz0123456789"; //add the characters you want int charAmount = UnityEngine.Random.Range(8, 12); //set those to the minimum and maximum length of your string for (int i = 0; i < charAmount; i++) { myString += glyphs[UnityEngine.Random.Range(0, glyphs.Length)]; } token = myString; myString += "GKtsh!hdisa's^nlaoek"; md5 = GetHash(myString); if (Restaurant != null) { urlMenu = preUrl1 + Restaurant + "/Menu4.json"; //urlMenu = preUrl + Restaurant + "&token="+token+"&md5="+md5; LogoData = new c_Data() { imageUrl = preUrl1 + Restaurant + "/Logo.png", imageDimensions = new Vector2(643f, 227f) }; } else { urlMenu = "https://aruba.streetshot.it/pinapp/get.php?item=MolRa.menu.json&token=k6dduaqb1&md5=039e8a640a0d15b99641b7e3a2e08340"; LogoData = new c_Data() { imageUrl = "https://aruba.streetshot.it/pinapp/get.php?item=MolRa.Logo.png&token=k6dduaqb1&md5=039e8a640a0d15b99641b7e3a2e08340", imageDimensions = new Vector2(643f, 227f) }; } SetData(LogoData); //ColorController.CController.CambiaColori(); menu = Menu_Ristorante.LoadMenu(urlMenu, Db); Loader.gameObject.SetActive(false); if (!loadFromCache) { AggiungiLocale(); } } else if (Db == 1) { //menuSS = CallWebService.LoadSSMenu(Utenza, Restaurant); CallWebService.LoadSSMenu(Restaurant, Utenza); } }
private void Awake() { MMS = this; }