Пример #1
0
        private async void AddresstoCoordinatesReturnFunction(object sender, ServiceReference1.AddresstoCoordinatesCompletedEventArgs e)
        {
            double lat = 0.00;
            double lng = 0.00;
            int count = 0;
            String latlngCoordinates = e.Result;
            string[] coordinates = latlngCoordinates.Split(':');
            count = 0;
            foreach (string singleCoordinate in coordinates)
            {
                if (count == 0)
                {
                    lat = Convert.ToDouble(singleCoordinate);
                    count++;
                }
                else if (count == 1)
                {
                    lng = Convert.ToDouble(singleCoordinate);
                }
            }

            MainPage.bookingData.lat = lat;
            MainPage.bookingData.lng = lng;
            //MainPage.bookingData.are.Set();

            GeoCoordinate geo = new GeoCoordinate(MainPage.bookingData.lat, MainPage.bookingData.lng);

            MainPage.bookingData.isDesSet = true;
            MainPage.bookingData.desitnation_location = geo;
            NavigationService.Navigate(new Uri("/SelectDestination.xaml", UriKind.Relative));
        }
Пример #2
0
        public void TestCallback(object sender, ServiceReference1.RateDriverCompletedEventArgs e)
        {

            MessageBox.Show("Rating submitted successfully!");

            NavigationService.Navigate(new Uri("/MainMenu.xaml", UriKind.Relative));
        }
Пример #3
0
 void c_getajokeCompleted(object sender, ServiceReference1.getajokeCompletedEventArgs e)
 {
     //throw new NotImplementedException();
     if (e.Cancelled != true)
         textBlock1.Text = e.Result;
     else
         MessageBox.Show("Error with service");
 }
Пример #4
0
 void w_getModuleListCompleted(object sender, ServiceReference1.getModuleListCompletedEventArgs e)
 {
     var x = e.Result;
     foreach (string s in x)
     {
         moduleBox.Items.Add(s);
     }
   }
Пример #5
0
 void client_GetVersionCompleted(object sender, ServiceReference1.GetVersionCompletedEventArgs e)
 {
     if (e.Result.Version > logicLayer.GetVersion())
     {
         logicLayer.UpdateShopList(e.Result);
         RefreshView();
     }
 }
Пример #6
0
 public InfoPersonne convertJavaPersonneToCSharp(ServiceReference1.infoPersonne jip)
 {
     InfoPersonne ip = new InfoPersonne();
     ip.Nom = jip.nom;
     ip.Prenom = jip.prenom;
     ip.Sexe = jip.sexe;
     ip.DateNaissance = jip.dateNaissance;
     return ip;
 }
Пример #7
0
        private void CalculateOperationView(ServiceReference1.EnumOperationBi operation)
        {
            kudvenkat.ServiceReference1.WebServiceCalculatorSoapClient client2 = new ServiceReference1.WebServiceCalculatorSoapClient();
            float restul = client2.ExecuteOperation((float)Convert.ToDouble(TextFirstNumber.Text), (float)Convert.ToDouble(TextSecondNumber.Text), operation);

            LabelResult.Text = restul.ToString();

            SetCalculations(client2);
        }
Пример #8
0
 void client_InserNumSerie(object sender, ServiceReference1.InsertNumSerieCompletedEventArgs e)
 {
     if (e.Error == null)
     {
        MessageBox.Show(e.Result +" Lignes insérées avec succés");
     }
     else
         MessageBox.Show(e.Error.ToString());
 }
Пример #9
0
        private static async Task DoWork(ServiceReference1.HelloClient client)
        {
            await client.SlowAsync(5);

            Console.WriteLine("First call ready");
            client.Slow(4);

            Console.WriteLine("Second call ready");
        }
Пример #10
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ServiceReference1 client = new ServiceReference1();

            // Use the 'client' variable to call operations on the service.

            client.
            // Always close the client.
            client.Close();
        }
Пример #11
0
 void Snmp_SearchTpCompleted(object sender, ServiceReference1.SearchTpCompletedEventArgs e)
 {
     List<string> Tp = JsonConvert.DeserializeObject<List<string>>(e.Result);
         foreach (string b in Tp)
         {
             tr.Nodes.Add(b);
         }
         treeView.Nodes.Add(tr);
         treeView.ExpandAll();
 }
Пример #12
0
        private void ReturnFunction(object sender, ServiceReference1.GetBookingTimeCompletedEventArgs e)
        {
            try
            {
                DateTime BookingDateTime = e.Result;
                DateTime CurrentDate = DateTime.Now;
                TimeSpan Difference = CurrentDate - BookingDateTime;
                TimeElapsed = Convert.ToInt32(Difference.TotalMinutes);
                TimeElapsedTextBox.Text = TimeElapsed.ToString()+" Minutes";

                // Reading logged in customer details
                IsolatedStorageFile loginFile = IsolatedStorageFile.GetUserStoreForApplication();
                StreamReader Reader = null;
                String Buffer = "";

                Reader = new StreamReader(new IsolatedStorageFileStream("LoginDetails.txt", FileMode.Open, loginFile));
                Buffer = Reader.ReadLine();
                if (Buffer.Equals("Customer Logged In"))
                {
                    // Reading logged in customer's ID
                    Buffer = Reader.ReadLine();
                    String[] Token = Buffer.Split(new char[] { ':' });
                    Buffer = Token[1];
                }

                Reader.Close();

                // Displaying booking status in the text box
                if (IsolatedStorageFile.GetUserStoreForApplication().FileExists("BookingDetails" + Buffer + ".txt"))  // Reading Booking Details from isolated storage file
                {
                    IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();

                    try
                    {
                        Reader = new StreamReader(new IsolatedStorageFileStream("BookingDetails" + Buffer + ".txt", FileMode.Open, fileStorage));
                        ApproximateFare= Reader.ReadLine();
                        BookingStatusTextBox.Text = Reader.ReadLine();

                        Reader.Close();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
                else
                {
                    BookingStatusTextBox.Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #13
0
 void client_DownloadCompleted(object sender, ServiceReference1.DownloadCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         this.AddToDebug("In client_DownloadCompleted, e.Result = {0}", e.Result.Length);
     }
     else
     {
         this.AddToDebug("In client_DownloadCompleted, e.Error = {0}", e.Error);
     }
 }
Пример #14
0
 void tc_GetHistoryPadureCompleted(object sender, ServiceReference1.GetHistoryPadureCompletedEventArgs e)
 {
     Animalule an = new Animalule();
     List<HistoryPadure_Result> lista = new List<HistoryPadure_Result>();
     foreach (var c in e.Result)
     {
         lista.Add(c);
     }
     an.Aranjeaza(lista);
     md.Children.Add(an);
 }
Пример #15
0
        private void CallBackFunction2(object sender, ServiceReference1.UpdateBookingAndCabStatusCompletedEventArgs e)
        {
            if (e.Result.Equals("Statuses Updated"))
            {
                MessageBox.Show("Your availability status has been set to available");
            }
            else
            {
                MessageBox.Show(e.Result);
            }

        }
        public FavoriteWindow(ServiceReference1.WcfLogin logg2)
        {
            InitializeComponent();
            logg = logg2;
            
            textBoxGrams.Text = grams.ToString();

            listBoxes = new List<ListBox>();
            buttons = new List<Button>();

            w = new ConsumeWindow(logg);
        }
Пример #17
0
 private string ProveedorLit(ServiceReference1.Proveedor proveedor)
 {
     return "<li><a href=\"#\">Proveedor: " + proveedor.RazonSocial + "</a>" +
                            "<ul data-role=\"listview\">" +
                                "<li>Domicilio: " + proveedor.Domicilio + "</li>" +
                                "<li>Telefono: " + proveedor.Telefono + "</li>" +
                                "<li>Contacto: " + proveedor.Contacto + "</li>" +
                                "<li>Observacion: " + proveedor.Observacion + "</li>" +
                                "<a href=\"Index.aspx\" data-role=\"button\" data-icon=\"arrow-l\" data-iconpos=\"left\" data-inline=\"true\">Volver</a>" +
                            "</ul>" +
                        "</li>";
 }
Пример #18
0
 void snmp2_SearchManageCompleted(object sender, ServiceReference1.SearchManageCompletedEventArgs e)
 {
     try
     {
     BindingSource bs = new BindingSource();
     Dictionary<string, string> ggg = JsonConvert.DeserializeObject<Dictionary<string, string>>(e.Result);
     Console.Write(e.Result[1]);
     bs.DataSource = ggg;
     da1.DataSource = bs;
     }
     catch(Exception ex)
     {}
 }
Пример #19
0
        void client_InsertOpeCompleted(object sender, ServiceReference1.InsertOpeCompletedEventArgs e)
        {
            bool auth = (bool)e.Result;
             if (auth == true)
             {
             //MessageBox.Show("inserted");
             UploadFile(flname, dlg.File.OpenRead());
             }
             else
             {

             }
             this.Content = new Page_OpenDialogue(username);
        }
Пример #20
0
 private void ReturnFunction(object sender, ServiceReference1.CheckCustomerBookingsCompletedEventArgs e)
 {
     if(e.Result == -1)
     {
         MessageBox.Show("You have not made any bookings yet!");
     }
     else if(e.Result == -2)
     {
         MessageBox.Show("Exception occurred while finding bookings of the customer.");
     }
     else
     {
         // If customer has made any booking then proceed to booking cancellation page
         ForGlobalVariables.CutomerBookingDetails.BookingID = e.Result;
         NavigationService.Navigate(new Uri("/Cancel Booking.xaml", UriKind.Relative));
     }
 }
        private static object Reports(ServiceReference1.MainClient a, User usr)
        {
            var dateFrom = new DateTime(2013,7,1);
            var dateTo = new DateTime(2013, 8, 30);
            var transTypeId = 2;
            var amountFrom = 1d;
            var amountTo = 10d;

            //var result = a.ReportTransactionAmount(dateFrom, dateTo, transTypeId, amountFrom, amountTo, usr.UserId);
            //var result = a.ReportTransactionCategory(dateFrom, dateTo, transTypeId, usr.UserId);
            //var result = a.ReportTransactionNameOfPlace(dateFrom, dateTo, transTypeId, usr.UserId);
            var result = a.ReportTransactionByPeriod(dateFrom, dateTo, transTypeId, 
                                                    Const.ReportPeriod.Daily, usr.UserId);
            

            return "";
        }
Пример #22
0
 void GetAuthorsCallBack(object sender, ServiceReference1.GetAuthorsCompletedEventArgs e)
 {
     try
     {
         string[] authors = e.Result;
         for (int i = 0; i < 3; i++)
         {
             lv_dsketqua.Items.Add(authors[i].ToString());
         }
         textBox2.Text = authors[3].ToString();
         client.Close();
     }
     catch
     {
         MessageBox.Show("Lỗi ! Không Thể Load Authors", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #23
0
        void client_selectopCompleted(object sender, ServiceReference1.selectopCompletedEventArgs e)
        {
            bool auth = (bool)e.Result;
            //if (tr)
            //    MessageBox.Show("Logged");
            //    this.Content = new signup();
            if (auth == true)
            {

                this.Content = new Page_OpenDialogue(t_username.Text);

            }
            else
            {
                button1.Visibility = Visibility.Visible;
                MessageBox.Show("Enter correct username or password");
                p_password.Password = "";

            }
        }
Пример #24
0
        void client_IsAvailCompleted(object sender, ServiceReference1.IsAvailCompletedEventArgs e)
        {
            bool avail = (bool)e.Result;
            if (avail == false)
            {

                client.InsertOpeCompleted+=new EventHandler<ServiceReference1.InsertOpeCompletedEventArgs>(client_InsertOpeCompleted);
                flname = username + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond + ".jpg";
                client.InsertOpeAsync("insert into ImageList values('" + username + "','" + dlg.File.Name + "','" +flname+ "')");
            }

               else if (!msgshowf)
                {

                    MessageBox.Show("File name already exists in your name");
                    msgshowf = true;
                    this.Content = new ImageUploadPage(username);
            }
                    msgshowf = false;
        }
Пример #25
0
        private void AuthenticateReturnFunction(object sender, ServiceReference1.AuthenticateCustomerCompletedEventArgs e)
        {
            if (e.Result == -1)
            {
                MessageBox.Show("ERROR! Invalid username or password.");
            }
            else if(e.Result==-2)
            {
                MessageBox.Show("ERROR! Sorry your registration request was rejected by the administrator after review.");
            }
            else if(e.Result==-3)
            {
                MessageBox.Show("ERROR! EXCEPTION IN WEB SERVICE FUNCTION");
            }
            else
            {
                //Deleting the isolated storage file first to avoid any duplications
                using (var store = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    if (store.FileExists("LoginDetails.txt"))
                    {
                        IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication();
                        storage.DeleteFile("LoginDetails.txt");
                    }
                }
                
                ForGlobalVariables.LoginDetails.CustomerLoggedIn = true;
                ForGlobalVariables.LoginDetails.CustomerID=e.Result;
                
                //Writing isolated storage file to access in background agent
                IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
                StreamWriter Writer = new StreamWriter(new IsolatedStorageFileStream("LoginDetails.txt", FileMode.OpenOrCreate, fileStorage));
                Writer.WriteLine("Customer Logged In");
                Writer.WriteLine("CustomerID:" + e.Result.ToString());
                Writer.Close();

                MessageBox.Show("Welcome!");
                NavigationService.Navigate(new Uri("/MainMenu.xaml", UriKind.Relative));
            }

        }
Пример #26
0
        private void CabIDForDriverReturnFunction(object sender, ServiceReference1.CabIDforDriverCompletedEventArgs e)
        {
            if(e.Result != -1)
            {
                //Storing the cab ID for driver to update locations in Background agent
                ForGlobalVariables.LoginDetails.CabID = e.Result;
                if (authenticated)
                {
                    authenticated = false;

                    //Deleting the isolated storage file first to avoid any duplications
                    using (var store = IsolatedStorageFile.GetUserStoreForApplication())
                    {
                        if (store.FileExists("LoginDetails.txt"))
                        {
                            IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication();
                            storage.DeleteFile("LoginDetails.txt");
                        }
                    }

                    //Writing isolated storage file to access in background agent
                    IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
                    StreamWriter Writer = new StreamWriter(new IsolatedStorageFileStream("LoginDetails.txt", FileMode.OpenOrCreate, fileStorage));
                    Writer.WriteLine("Driver Logged In");
                    Writer.WriteLine("DriverID:" + ForGlobalVariables.LoginDetails.DriverID);
                    Writer.WriteLine("CabID:" + ForGlobalVariables.LoginDetails.CabID);
                    Writer.Close();

                    MessageBox.Show("Welcome!\nDriverID = "+ForGlobalVariables.LoginDetails.DriverID.ToString() + "\nCabID = "+ForGlobalVariables.LoginDetails.CabID.ToString());
                    NavigationService.Navigate(new Uri("/DriverMainPage.xaml", UriKind.Relative));
                }
                else
                {
                    MessageBox.Show("ERROR!");
                }
            }
            else
            {

            }
        }
Пример #27
0
        private void CallBackFunction(object sender, ServiceReference1.DetailsForCancelledBookingCompletedEventArgs e)
        {
            if(!e.Result.Contains("No Booking"))
            {
                string[] token = e.Result.Split(new char[] { '+' });
                CustomerLocationText.Text = token[0];
                DestinationTextBox.Text = token[1];
                DateTextBox.Text = token[2];
            }
            else
            {
                MessageBox.Show(e.Result);
            }

            ServiceReference1.ServiceClient clientForTesting = new ServiceReference1.ServiceClient();
                   
            clientForTesting.UpdateBookingAndCabStatusCompleted += new EventHandler<ServiceReference1.UpdateBookingAndCabStatusCompletedEventArgs>(CallBackFunction2);
            clientForTesting.UpdateBookingAndCabStatusAsync(BookingID, CabID);
            

        }
Пример #28
0
        private void CheckForCancelledBookingsReturnFunction(object sender, ServiceReference1.CheckForDriverCancelledBookingsCompletedEventArgs e)
        {
            if (e.Result != -1)
            {
                // Some booking has been cancelled
                IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication();
                if (storageFile.FileExists("BookingCancellation.txt"))
                {
                    storageFile.DeleteFile("BookingCancellation.txt");
                }
                StreamWriter Writer = new StreamWriter(new IsolatedStorageFileStream("BookingCancellation.txt", FileMode.OpenOrCreate, storageFile));
                Writer.WriteLine(e.Result.ToString());
                Writer.WriteLine(CabID.ToString());
                Writer.Close();

                // Generating toast notification
                var CancelledToast = new ShellToast { Title = DateTime.Now.ToShortTimeString(), Content = "Alert! A booking has been cancelled.", NavigationUri = new Uri("/NotifyCancelledBooking.xaml", UriKind.Relative) };
                CancelledToast.Show();
            }
            ServiceWati2.Set();

        }
Пример #29
0
 void UserdangnhapCallBack(object sender, ServiceReference1.UserdangnhapCompletedEventArgs e)
 {
     try
     {
         if (e.Result == false)
             MessageBox.Show("Đăng nhập thất bại !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         else
         {
             MessageBox.Show("Đăng nhập thành công!");
             username = tb_User.Text;
             DichVu dv = new DichVu();
             dv.Show();
             this.Hide();
         }
     }
     catch (ArgumentException exp)
     {
         MessageBox.Show(exp.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Dịch vụ Lỗi!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #30
0
 public void OnMessage(ServiceReference1.KTAMessage myMsg)
 {
     /*
     string cc = (myMsg.m_Label + ":" + myMsg.m_Data);
     //m_Results.Items.Add(cc);
     if (m_UpdateNotify != null)
     {
         m_UpdateNotify();
     }
      */
 }
Пример #31
0
 private void button1_Click(object sender, EventArgs e)
 {
     dataGridView1.DataSource = ServiceReference1.GetAllSPResponse();
 }
Пример #32
0
 void ServiceReference1__InsertNodeCompleted(object sender, ServiceReference1.InsertNodeCompletedEventArgs e)
 {
     MessageBox.Show("NODO");
 }
Пример #33
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ServiceReference1 cs = new ServiceReference1();
 }