public IActionResult PostToken([FromBody] TokenDto dto) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } WebService1SoapClient client = new WebService1SoapClient( new BasicHttpBinding(BasicHttpSecurityMode.None), new EndpointAddress("http://localhost/SOAPTokenGenerator/TokenGenerator.asmx") ); var token = new Token() { Duration = 30, ClassId = dto.ClassId, CreatedDateTime = DateTime.Now, TokenValue = client.GenerateToken() }; _context.Token.Add(token); _context.SaveChanges(); return(CreatedAtAction("GetToken", new { id = token.Id }, token)); }
public ReservationForm(User user, RestaurantForm restaurantForm) { this.user = user; this.service = restaurantForm.service; this.restaurantForm = restaurantForm; InitializeComponent(); }
public FormMedico(int actual) { InitializeComponent(); client = new WebService1SoapClient(); CuentaActual = actual; actualizarDatos(); }
public ActionResult Edit(TablaViewModel model) { WebService1SoapClient client = new WebService1SoapClient(); try { if (ModelState.IsValid) { var person = client.GetPerson(model.ID_Person); person.Identification = model.Identification; person.Name = model.Name; person.Mail = model.Mail; person.Password = model.Password; person.Ind_User = model.Ind_User; person.Points = model.Points; client.UpdatePerson(model.ID_Person, model.Identification, model.Name, model.Mail, model.Password, model.Points, model.Ind_User); return(Redirect("~/Person/")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
private void getSignBtn_Click(object sender, EventArgs e) { WebService1SoapClient client = new WebService1SoapClient(); string name = inputNameBox.Text; outputBox.Text = client.GetSigns(name); }
public ActionResult Edit(TablaViewModel model) { WebService1SoapClient client = new WebService1SoapClient(); try { if (ModelState.IsValid) { var schedule = client.GetSchedule(model.ID_Schedule); schedule.ID_Schedule = model.ID_Schedule; schedule.Day = model.Day; schedule.State = model.State; client.UpdateSchedule(model.ID_Schedule, model.Day, model.State); return(Redirect("~/Schedule/")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
//Actual es paciente actual //from Doctor = true si se entra desde médico // false si se entra desde paciente public FormVacunas(int actual, bool fromDoctor) { InitializeComponent(); client = new WebService1SoapClient(); PacienteActual = actual; if (!fromDoctor) { btnAgregar.Visible = false; cbAgregar.Visible = false; lblAgregar.Visible = false; } listaVacunas = client.readVacuna().ToList(); var q = from datos in client.readPaciente().ToList() where datos.ID == PacienteActual select datos; List <Paciente> x = q.ToList(); txtPaciente.Text = x[0].nombre + " " + x[0].apellidoPaterno + " " + x[0].apellidoMaterno; load(); load_combo(); //Cargar las vacunas al cb }
public ActionResult Edit(TablaViewModel model) { WebService1SoapClient client = new WebService1SoapClient(); try { if (ModelState.IsValid) { var movie = client.GetMovie(model.ID_Movie); movie.Description_Movie = model.Description_Movie; movie.Duration = model.Duration; movie.State = model.State; client.UpdateMovie(model.ID_Movie, model.Description_Movie, model.Duration, model.State); return(Redirect("~/Movie/")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ActionResult Edit(TablaViewModel model) { WebService1SoapClient client = new WebService1SoapClient(); try { if (ModelState.IsValid) { var purchase = client.GetPurchase(model.ID_Purchase); purchase.ID_Batch = model.ID_Batch; purchase.ID_Person = model.ID_Person; purchase.Date_Purchase = model.Date_Purchase; client.UpdatePurchase(model.ID_Purchase, model.ID_Batch, model.ID_Person, model.Date_Purchase); return(Redirect("~/Purchase/")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
// GET: Default public ActionResult Index() { ServiceReference1.WebService1SoapClient obj = new WebService1SoapClient(); ViewBag.Add = obj.Add(10, 20); return(View()); }
public ActionResult Edit(TablaViewModel model) { WebService1SoapClient client = new WebService1SoapClient(); try { if (ModelState.IsValid) { var seat = client.GetSeat(model.ID_Seat); seat.ID_Room = model.ID_Room; seat.Description_Seat = model.Description_Seat; seat.Row = model.Row; seat.Number = model.Number; seat.Price = model.Price; client.UpdateSeat(model.ID_Seat, model.ID_Room, model.Description_Seat, model.Row, model.Number, model.Price); return(Redirect("~/Seat/")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void btnCallWebService_OnClick(object sender, EventArgs e) { var client = new WebService1SoapClient(); LogRecorderAndPlayer.LoggingClientBase.SetupClientBase(client, Context); txtSomeResult.Text = client.SomeFunction(txtSomeInput.Text); }
public RestaurantForm(User user, WebService1SoapClient service) { InitializeComponent(); this.user = user; this.service = service; refreshReservationsDB(); }
private void Form1_Load(object sender, EventArgs e) { alaobj = new WebService1SoapClient(); metroComboBox1.Items.Add("Rupee"); metroComboBox1.Items.Add("Dollar"); metroComboBox1.Items.Add("Euro"); metroComboBox2.Items.Add("Dollar"); metroComboBox2.Items.Add("Euro"); metroComboBox3.Items.Add("Meter"); metroComboBox3.Items.Add("Yard"); metroComboBox3.Items.Add("Foot"); metroComboBox4.Items.Add("Meter"); metroComboBox4.Items.Add("Yard"); metroComboBox4.Items.Add("Foot"); metroComboBox1.SelectedIndex = 0; metroComboBox2.SelectedIndex = 0; metroComboBox3.SelectedIndex = 0; metroComboBox4.SelectedIndex = 0; textBox2.Enabled = false; textBox3.Enabled = false; String result = alaobj.CurrencyConverter(metroComboBox1.Text, metroComboBox2.Text, textBox1.Text); textBox2.Text = result; String result1 = alaobj.LengthConverter(metroComboBox4.Text, metroComboBox3.Text, textBox4.Text); textBox3.Text = result1; }
public ActionResult Edit(TablaViewModel model) { WebService1SoapClient client = new WebService1SoapClient(); try { if (ModelState.IsValid) { var room = client.GetRoom(model.ID_Room); room.Capacity = model.Capacity; room.Description = model.Description; room.State = model.State; client.UpdateRoom(model.ID_Room, model.Description, model.Capacity, model.State); return(Redirect("~/Room/")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
private async Task <string> CallServerAsync(string serverName, string actionName) { WebService1SoapClient client = new WebService1SoapClient(); var response = await client.HelloWorldAsync(); return(response.Body.HelloWorldResult); }
protected void Page_Load(object sender, EventArgs e) { WebService1SoapClient client = new WebService1SoapClient(); int sum = client.Add(1, 4); Response.Write(sum); }
public ActionResult Index(string num1, string num2, string dropdownlist1) { var numa = num1; var numb = num2; var selectvalue =dropdownlist1; WebService1SoapClient web = new WebService1SoapClient(); var result = ""; if (selectvalue.Equals("+")) { result = (web.addition(double.Parse(numa), double.Parse(numb))).ToString(); } else if (selectvalue.Equals("-")) { result = (web.subtract(double.Parse(numa), double.Parse(numb))).ToString(); } else if (selectvalue.Equals("*")) { result = (web.multiplication(double.Parse(numa), double.Parse(numb))).ToString(); } else if (selectvalue.Equals("/")) { result = (web.division(double.Parse(numa), double.Parse(numb))).ToString(); } else { result = "非法计算方式"; } ViewBag.result = result; return View(); }
public ActionResult ShowProduct(int id) { WebService1SoapClient Product = new WebService1SoapClient(); var p = Product.GetProduct(id); return(View(p)); }
public ActionResult Delete(int id) { WebService1SoapClient client = new WebService1SoapClient(); client.DeleteSeat(id); return(Redirect("~/Seat/")); }
//Calculate subtotal for each package before tax private double CalculateSubTotalForEachPackageBeforeTax(string shipMethod, double packageWeight, string shipCompany) { //Create WebServiceSoapClient object WebService1SoapClient myClient = new WebService1SoapClient(); double subTotal = myClient.CalcTotal(shipCompany, shipMethod, packageWeight); return(subTotal); }
// GET: Employee public ActionResult Index() { WebService1SoapClient obj = new WebService1SoapClient(); ViewBag.result = obj.Add(19, 20); ServiceReference2.Service1Client obj1 = new ServiceReference2.Service1Client(); ViewBag.result2 = obj1.Add(2, 8); return(View(db.GetEmployee())); }
public WebService1SoapClient GetClientConnection() { var binding = new BasicHttpBinding(); var endpoint = new EndpointAddress(new Uri(ApplicationSettings.WS_Geno)); var WsSoapClient = new WebService1SoapClient(binding, endpoint); //WsSoapClient.Endpoint.EndpointBehaviors.Add(new InspectorBehavior(_httpContextAccessor)); return(WsSoapClient); }
private void button2_Click(object sender, EventArgs e) { var client = new WebService1SoapClient(); Data data = new Data(); data.Id = Int32.Parse(textBox1.Text); client.DelDict(data); button1_Click(null, null); }
public ActionResult Index() { WebService1SoapClient Products = new WebService1SoapClient(); ViewBag.TopProduct = Products.GetTopProduct().AsEnumerable(); ViewBag.MinProduct = Products.GetMinProduct().AsEnumerable(); Products.Close(); return(View()); }
static void TestWebService() { WebService1SoapClient client = new WebService1SoapClient(); bool b = client.CheckStudent("name", "pwd"); Console.WriteLine("用WebService验证不合法用户名: {0}", b); b = client.CheckStudent("Jim", "123"); Console.WriteLine("用WebService验证合法用户名: {0}", b); }
static void Main() { WebService1SoapClient proxy = new WebService1SoapClient(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Application.Run(new Form1(proxy)); Application.Run(new Form2()); }
static void Main(string[] args) { WebService1SoapClient AndyLemonwayWS = new WebService1SoapClient(); //Create a New console application which will call the WebService //(on your localhost) to compute the Fibonacci(10) and print the result //to Fibonacci(10) the console Console.WriteLine(AndyLemonwayWS.FibonacciService(10)); Console.ReadLine(); }
public ActionResult ProductList(int PageNum) { WebService1SoapClient Products = new WebService1SoapClient(); IEnumerable <ProductDTO> P = Products.GetProductList(PageNum); ViewBag.Pages = Products.Pages(); ViewBag.Page = PageNum + 1; Products.Close(); return(View(P)); }
//正常的方式调用 protected void Button1_Click(object sender, EventArgs e) { var soap = new WebService1SoapClient(); Label1.Text = soap.Add(1, 2).ToString(); var list = soap.NonExecuateTask(); GridView1.DataSource = list; GridView1.DataBind(); }
private void editSignBtn_Click(object sender, EventArgs e) { WebService1SoapClient client = new WebService1SoapClient(); string name = inputNameBox.Text; string sign = inputSignBox.Text; outputBox.Text = "新个性签名\r\n" + "----------------------------------------\r\n" + client.GetSigns(name) + "\r\n\r\n\r\n" + "修改反馈\r\n" + "----------------------------------------\r\n" + client.Updatesigns(name, sign); }
public void getComment(int locationId) { /* string uri = baseWebServer + "SpeechWebServices/sendLastCommentFromIdLocation?idLocation=" + locationId + "&code=wonders"; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri); var webRequest = (HttpWebRequest)HttpWebRequest.Create(uri); webRequest.BeginGetResponse(new AsyncCallback(requestCallBackSoundComment), webRequest); */ WebService1SoapClient webService = new WebService1SoapClient(); webService.getSoundCommentFromLocationAsync(locationId, "wonders"); webService.getSoundCommentFromLocationCompleted += new EventHandler<getSoundCommentFromLocationCompletedEventArgs>(webService_getSoundCommentFromLocationCompleted); }
private void btnConvert_Click(object sender, EventArgs e) { var client = new WebService1SoapClient(); string from = cbxFrom.SelectedItem.ToString(); string to = cbxTo.SelectedItem.ToString(); float value; if (!Single.TryParse(txtValue.Text, out value)) { MessageBox.Show("Please enter a valid temperature.", "Invalid Temperature"); } if (from == "Celsius" && to == "Farenheit") { txtResult.Text = client.CtoF(value).ToString(); } if (from == "Farenheit" && to == "Celsius") { txtResult.Text = client.FtoC(value).ToString(); } if (from == "Celsius" && to == "Kelvin") { txtResult.Text = client.CtoK(value).ToString(); } if (from == "Kelvin" && to == "Celsius") { txtResult.Text = client.KtoC(value).ToString(); } if (from == "Farenheit" && to == "Kelvin") { txtResult.Text = client.FtoK(value).ToString(); } if (from == "Kelvin" && to == "Farenheit") { txtResult.Text = client.KtoF(value).ToString(); } if (from == to) { txtResult.Text = txtValue.Text; } }
private void button1_Click(object sender, EventArgs e) { var client = new WebService1SoapClient(); WeatherResult.Text = client.GetTomorrowsWeather(); }
private void InvokeWebService() { // invoke service WebService1SoapClient soap = new WebService1SoapClient(); var str = soap.HelloWorld(); }
protected void Button1_Click(object sender, EventArgs e) { ServiceReference1.WebService1SoapClient client = new WebService1SoapClient(); Label1.Text = client.AddThreeNumbers(TextBox1.Text, TextBox2.Text, TextBox3.Text).ToString(); }
protected void Button1_Click(object sender, EventArgs e) { MySqlConnection connection = new MySqlConnection(); connection.ConnectionString = connectionString; connection.Open(); MySqlCommand command = connection.CreateCommand(); MySqlDataReader reader; command.CommandText = "SELECT * FROM information where id=1"; command.Prepare(); //command.Parameters.AddWithValue("@p1", item); reader = command.ExecuteReader(); reader.Read(); string name = reader["name"].ToString(); string phone = reader["phone"].ToString(); reader.Close(); connection.Close(); WebService1SoapClient client = new WebService1SoapClient(); Label1.Text = name; Label2.Text = phone; Label3.Text = client.HelloWorld(TextBox1.Text); }
public void getCommentFromLocationIdAndTypeOfComment(int locationId, int typeOfCommentId) { var client = new WebService1SoapClient( new BasicHttpBinding(BasicHttpSecurityMode.None) { MaxReceivedMessageSize = 2147483647, MaxBufferSize = 2147483647 }, new EndpointAddress("http://smartaudiocityguide.azurewebsites.net/WebServices.asmx")); WebService1SoapClient webService = new WebService1SoapClient(); client.getSoundCommentFromLocationAndTypeOfCommentAsync(locationId, typeOfCommentId, "wonders"); client.getSoundCommentFromLocationAndTypeOfCommentCompleted += new EventHandler<getSoundCommentFromLocationAndTypeOfCommentCompletedEventArgs>(webService_getSoundCommentFromLocationAndTypeOfCommentCompleted); }
public void sendCommentAndSoundToActualLocationToSave(string description, MyMicrophone myMicrophone) { Locations location; byte[] soundStream = myMicrophone.streamMicrophone.ToArray(); try { location = new Locations(globalPositionSystemForMap.actualLocation.Position.Location.Longitude, globalPositionSystemForMap.actualLocation.Position.Location.Latitude); } catch (Exception) { return; } string locationJson = location.serialize(); Comments comment = new Comments(description, false); ServicesReference.Comments commentWeb = new ServicesReference.Comments(); commentWeb.description = comment.description; commentWeb.isText = false; commentWeb.typeOfCommentsId = (Application.Current as App).idMessageType; commentWeb.archiveDescription = " "; commentWeb.sound = null; ServicesReference.Locations locationWeb = new ServicesReference.Locations(); locationWeb.latitude = location.latitude; locationWeb.longitude = location.longitude; string commentJson = comment.serialize(); var client = new WebService1SoapClient(new BasicHttpBinding(BasicHttpSecurityMode.None) { MaxReceivedMessageSize = 2147483647, MaxBufferSize = 2147483647 }, new EndpointAddress(Properties.getEndPoint())); client.addComentAndSoundToLocationAsync(locationJson, soundStream, commentWeb, "wonders"); client.addComentAndSoundToLocationCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(webService_addComentAndSoundToLocationCompleted); }
private void updateUserLocation() { string phoneId = myPhone.serializedDeviceUniqueId(); WebService1SoapClient webService = new WebService1SoapClient(); Thread thread = new Thread(new ThreadStart((Action)(() => { while (true) { Thread.Sleep(1000); webService.updateLoctionForUserAsync(phoneId, myGPS.actualLocation.Position.Location.Latitude, myGPS.actualLocation.Position.Location.Longitude); } }))); thread.Start(); }
void listBoxItem_Hold(object sender, System.Windows.Input.GestureEventArgs e) { ListBoxItem listBoxItem = (ListBoxItem)sender; Contact contact = (from con in contacts where con.DisplayName.ToLower() == ((listBoxItem.Content as Grid).Children[0] as TextBlock).Text select con).FirstOrDefault(); if (contact == null) { playSound("Contact not found."); return; } if (contact.EmailAddresses.Count() == 0) { playSound("Email address not available."); return; } WebService1SoapClient webService = new WebService1SoapClient(); updateUserLocation(); //webService.sendEmailForFolloUserByWindowsPhoneIdAsync(myPhone.serializedDeviceUniqueId(),contact.EmailAddresses.First().EmailAddress ); webService.sendEmailForFolloUserByWindowsPhoneIdAsync(myPhone.serializedDeviceUniqueId(), "*****@*****.**"); playSound("success"); }
void listBoxItem_DoubleTap() { Contact contact = (from con in contacts where con.DisplayName == itemSelected select con).FirstOrDefault(); if (contact == null) { playSound("Contact not found."); return; } if (contact.EmailAddresses.Count() == 0) { playSound("Email address not available."); return; } WebService1SoapClient webService = new WebService1SoapClient(); updateUserLocation(); //webService.sendEmailForFolloUserByWindowsPhoneIdAsync(myPhone.serializedDeviceUniqueId(),contact.EmailAddresses.First().EmailAddress ); //Moq webService.sendEmailForFolloUserByWindowsPhoneIdAsync(myPhone.serializedDeviceUniqueId(), "*****@*****.**"); playSound("success"); }
protected void Button1_Click(object sender, EventArgs e) { WebService1SoapClient soap=new WebService1SoapClient(); var data=soap.HelloWorld(); }