Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

binding entry text and web service

$
0
0

hi developer

## i want to send my data to web service (id , name , phone, usertype)
##  how can i do that with this code 


    readonly ICommand _deleteCommand;
        readonly contactclass _employee;

            StackLayout inputStack = new StackLayout
            {
                Spacing = 0,
                   Children = {
                      new StackLayout
                        {
                            Spacing = 0,
                            Orientation = StackOrientation.Horizontal,
                            Children =
                            {
                                { CreateLabelFor ("Id")},
                                 new Label {
                                    VerticalOptions = LayoutOptions.Center,
                                    FontSize = 20,
                                    Text = "id" }
                            }
                       },

                     new StackLayout
                    {
                        Spacing = 0,
                            Orientation = StackOrientation.Horizontal,
                        Children =
                                {
                                    { CreateEntryFor ("Name")},
                                    new Label {
                                        VerticalOptions = LayoutOptions.Center,
                                        FontSize = 20,
                                        Text = "nameemployees" }
                                }
                    },
                      new StackLayout
                        {
                            Spacing = 0,
                            Orientation = StackOrientation.Horizontal,
                            Children =
                            {
                                { CreateEntryFor ("phone")},
                                new Label {
                                    VerticalOptions = LayoutOptions.Center,
                                    FontSize = 20,
                                    Text = "phone " }
                            }
                       },

                     new StackLayout
                    {
                        Spacing = 0,
                            Orientation = StackOrientation.Horizontal,
                        Children =
                                {
                                {CreateEntryFor ("usertype")},
                                    new Label {

                                    VerticalOptions = LayoutOptions.Center,
                                    FontSize = 20,
                                    Text = "type" }
                                }
                    },
                }
            };

            Content = new StackLayout
            {
                Children = {
                    employeeImage,
                    inputStack,
                    buttonsLayout
                }
            };
        }

        View CreateSaveButton()
        {
            Button saveButton = new Button
            {
                Text = "edit",
                BorderRadius = 5,
                TextColor = Color.White,
            };

            saveButton.Clicked += SaveButton_Clicked;
            return saveButton;
        }

        private void SaveButton_Clicked(object sender, EventArgs e)
        {
            ServiceReference2.WebServiceDBSoapClient ws = new ServiceReference2.WebServiceDBSoapClient();

            ws.UpdateEmployeesAsync(); <<****** here i want to send value to web server******
        }

        View CreateEntryFor(string propertyName)
        {
            Entry input = new Entry
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = 20,
            };
            input.SetBinding(Entry.TextProperty, propertyName);
            return input;
        }
        View CreateLabelFor(string propertyName)
        {
            Label inputlabel = new Label
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = 20,
            };
            inputlabel.SetBinding(Label.TextProperty, propertyName);
            return inputlabel;
        } 

thanks in advance


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>