Пример #1
0
        public async void SignInActionAsync(object sender, EventArgs ea)
        {
            // string dbName = "";
            loginAlert.IsVisible    = false;
            passwordAlert.IsVisible = false;
            dbPickerAlert.IsVisible = false;

            try
            {
                // UserDialogs.Instance.ShowLoading();
                // await Task.Delay(TimeSpan.FromSeconds(1));

                var currentpage = new LoadingAlert();

                await PopupNavigation.PushAsync(currentpage);

                Settings.UserName     = loginEntry.Text;
                Settings.UserPassword = passwordEntry.Text;

                //controllerObj.login("http://salesapp.hashmicro.com", "salesapp", "admin", "admin");

                await Task.Run(() => controllerObj.login("http://beta-dev2.hashmicro.com", "PNM", Settings.UserName, Settings.UserPassword));

                //   List<CRMLead> crmLeadData = Controller.InstanceCreation().crmLeadData();

                List <CRMLead> crmLeadData = Controller.InstanceCreation().crmLeadData();

                //await Task.Run(() =>
                //{
                //    List<CRMLead> crmLeadData = Controller.InstanceCreation().crmLeadData();
                //});

                Page pageRef = new CrmTabbedPage();
                App.Current.MainPage = new MasterPage(pageRef);


                //await Task.Run(() =>
                //{

                //    Device.BeginInvokeOnMainThread(() =>
                //    {
                //        Page pageRef = new CrmTabbedPage();
                //        App.Current.MainPage = new MasterPage(pageRef);
                //    });
                //});


                System.Diagnostics.Debug.WriteLine(" WWWWWWWWWWWWWWWWWWWWWWwwwwwwwwwwww ", DateTime.Now.ToLocalTime().ToString());

                Loadingalertcall();
                //UserDialogs.Instance.HideLoading();
            }
            catch
            {
                loginfailedAlert.Text      = "Invalid Username or Password.";
                loginfailedAlert.IsVisible = true;

                Loadingalertcall();
            }
        }
Пример #2
0
        public async void SignInActionAsync(object sender, EventArgs ea)
        {
            try
            {
                act_ind.IsRunning = true;

                Settings.UserName     = loginEntry.Text;
                Settings.UserPassword = passwordEntry.Text;


                Settings.UserUrlName  = "https://telering.hashmicro.com";
                dbPicker.SelectedItem = "apk15";


                Settings.UserDbName = dbPicker.SelectedItem.ToString();

                String res = await Task.Run(() => controllerObj.login(Settings.UserUrlName, Settings.UserDbName, Settings.UserName, Settings.UserPassword));


                if (res == "false")
                {
                    loginfailedAlert.Text      = "Invalid Username or Password.";
                    loginfailedAlert.IsVisible = true;

                    act_ind.IsRunning = false;
                }

                else
                {
                    loginfailedAlert.IsVisible = false;

                    MessagingCenter.Send <string, string>("MyApp", "Login", "true");
                    JObject obj = controllerObj.getuserdata("res.users", "get_user_data");

                    App.partner_id    = obj["partner_id"].ToObject <int>();
                    App.partner_name  = obj["user_name"].ToObject <string>();
                    App.partner_image = obj["image_medium"].ToObject <string>();
                    App.partner_email = obj["user_email"].ToObject <string>();

                    App.sq_rpc = true;
                    Page pageRef = new CrmTabbedPage("tab4");
                    App.Current.MainPage = new MasterPage(pageRef);


                    act_ind.IsRunning = false;
                }
            }
            catch
            {
                loginfailedAlert.Text      = "Invalid Username or Password.";
                loginfailedAlert.IsVisible = true;
                act_ind.IsRunning          = false;
                //  Loadingalertcall();
            }
        }
Пример #3
0
        public async void SignInActionAsync(object sender, EventArgs ea)
        {
            try
            {
                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                Settings.UserName     = loginEntry.Text;
                Settings.UserPassword = passwordEntry.Text;
                Settings.UserUrlName  = urlEntry.Text;
                //   Settings.UserUrlName = "http://laborindo.equip-sapphire.com";
                //  dbPicker.SelectedItem = "laborindo";

                //Settings.UserUrlName = "http://beta-dev1.hashmicro.com";
                //dbPicker.SelectedItem = "MBTurssco";

                //  dbPicker.SelectedItem = "Sales_Focus";

                Settings.UserDbName = dbPicker.SelectedItem.ToString();


                //controllerObj.login("http://salesapp.hashmicro.com", "salesapp", "admin", "admin");

                String res = await Task.Run(() => controllerObj.login(Settings.UserUrlName, Settings.UserDbName, Settings.UserName, Settings.UserPassword));

                //    await Task.Run(() => controllerObj.login("http://beta-dev2.hashmicro.com", "PNM", "admin", "admin"));

                if (res == "false")
                {
                    loginfailedAlert.Text      = "Invalid Username or Password.";
                    loginfailedAlert.IsVisible = true;

                    Loadingalertcall();
                }

                else
                {
                    Page pageRef = new CrmTabbedPage();
                    App.Current.MainPage = new MasterPage(pageRef);

                    //await Task.Run(() =>
                    //{

                    //    Device.BeginInvokeOnMainThread(() =>
                    //    {

                    //        indi.IsVisible = true;
                    //        indi.IsRunning = true;

                    //        Page pageRef = new CrmTabbedPage();
                    //        App.Current.MainPage = new MasterPage(pageRef);
                    //        indi.IsVisible = false;
                    //        indi.IsRunning = false;
                    //    });
                    //});



                    Loadingalertcall();
                }
            }
            catch
            {
                loginfailedAlert.Text      = "Invalid Username or Password.";
                loginfailedAlert.IsVisible = true;

                Loadingalertcall();
            }
        }