Esempio n. 1
0
        async void Connect()
        {
            string msg = "";

            if (string.IsNullOrEmpty(entryIPAdress.Text) || string.IsNullOrEmpty(entryPort.Text))
            {
                return;
            }
            try
            {
                UserDialogs.Instance.ShowLoading("Connect....");
                if (generalMethod.CheckConnection(out msg, entryIPAdress.Text.Trim(), entryPort.Text.Trim()))
                {
                    generalMethod.setConnectionDataInCollector(entryIPAdress.Text, entryPort.Text);
                    NavigationPage logIn;
                    logIn = new NavigationPage(new LogInPage())
                    {
                    };
                    await Navigation.PushModalAsync(logIn, true);
                }
                else
                {
                    DisplayAlert(ConstantsMSG.Warning, msg, "OK");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                UserDialogs.Instance.HideLoading();
            }
        }
Esempio n. 2
0
        async void getConnectionData()
        {
            try
            {
                var v = Database.GetConnectionData();

                if (v.Result.Count > 0)
                {
                    _generalMethod.setConnectionDataInCollector(v.Result[0].ServerName, v.Result[0].PortNo);
                }
                else
                {
                    _generalMethod.setConnectionDataInCollector("", "");
                }
            }
            catch (Exception ex)
            {
            }
        }