Ejemplo n.º 1
0
        private async void send_byemail_ClickedAsync(object sender, EventArgs ea)
        {
            var currentpage = new LoadingAlert();
            await PopupNavigation.PushAsync(currentpage);


            Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
            Match match = regex.Match(obj.email);

            //

            if (match.Success)
            {
                string emailres = Controller.InstanceCreation().SaleOrderConfirm("sale.order", "send_by_mail_from_app", saleoder_id);

                if (emailres == "true")
                {
                    await DisplayAlert("Alert", "Email Sent Successfully", "Ok");
                }

                else
                {
                    await DisplayAlert("Alert", "Please Try again", "Ok");
                }
            }

            else
            {
                await DisplayAlert("Alert", "Customer Email Invalid", "Ok");
            }

            await PopupNavigation.PopAsync();
        }
Ejemplo n.º 2
0
        private async void Convertbtn_ClickedAsync(object sender, EventArgs e)
        {
            var currentpage = new LoadingAlert();
            await PopupNavigation.PushAsync(currentpage);

            vals["type"] = "opportunity";
            string updated = Controller.InstanceCreation().UpdateLeadCreationConvertData("crm.lead", "write", obj.id, vals);

            if (App.NetAvailable == false)
            {
                await DisplayAlert("Alert", "Need Internet Connection", "Ok");
            }

            else
            {
                if (updated == "Odoo Error")
                {
                    // App.Current.MainPage = new MasterPage(new CrmTabbedPage());
                    // Navigation.PushPopupAsync(new MasterPage(  );
                    await  DisplayAlert("Alert", "Please try again", "Ok");

                    Loadingalertcall();
                }
                else
                {
                    //  DisplayAlert("Alert", "Created Successfull", "Ok");
                    App.oppo_rpc         = true;
                    App.lead_rpc         = true;
                    App.Current.MainPage = new MasterPage(new CrmTabbedPage("tab2"));
                    await Navigation.PopAllPopupAsync();

                    //  Loadingalertcall();
                }
            }
        }
Ejemplo n.º 3
0
    protected override void OnActivate()
    {
        base.OnActivate();

        LoadingAlert.FinishLoading();
        SoundManager.Instance.StopMusic();
    }
Ejemplo n.º 4
0
    void BuyBalloon()
    {
        SoundManager.Instance.PlaySoundEffect(SoundType.BALLOON_PURCHASE);

        LoadingAlert.Present();
        StartCoroutine(SendAmmoBuyToServer(AmmoType.BALLOON, BALLOON_COST));
    }
Ejemplo n.º 5
0
    public void SwitchAmmo(AmmoDisplay ammoDisplay)
    {
        if (_movingAmmo)
        {
            //Debug.Log("switch ammoDisplay = " + ammoDisplay.Type + " with movingAmmoDisplay = " + _movingAmmoDisplay.Type);
            //_lastAmmoDisplayEntered.ShowImage();
            DeactivateMovingAmmo();
            AmmoType ammoType = ammoDisplay.Type;
            ammoDisplay.Initialize(_movingAmmoDisplay.Type);
            _movingAmmoDisplay.Initialize(ammoType);
            _movingAmmo        = false;
            _movingAmmoDisplay = null;

            for (int i = 0; i < AmmoDisplayArray.Length; i++)
            {
                if (AmmoDisplayArray[i].Set)
                {
                    Avatar.Instance.Ammo.AmmoList[i] = AmmoDisplayArray[i].Type;
                }
            }

            LoadingAlert.Present();
            StartCoroutine(SendAmmoArrangeToServer());
        }
    }
Ejemplo n.º 6
0
        private async void ButtonMarkWon_ClickedAsync(object sender, EventArgs e)
        {
            List <CRMLead> crmLeadData1 = Controller.InstanceCreation().crmLeadData();

            if (App.NetAvailable == true)
            {
                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                bool updated = Controller.InstanceCreation().UpdateMarkWon(obj.id);

                if (updated)
                {
                    await DisplayAlert("Alert", "State successfully moved", "Ok");

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

                    App.Current.MainPage = new MasterPage(new CrmTabbedPage());
                    Loadingalertcall();
                }

                else
                {
                    await DisplayAlert("Alert", "Please try again", "Ok");

                    Loadingalertcall();
                }
            }
            else
            {
                await DisplayAlert("Alert", "Internet Connection Needed", "Ok");
            }
        }
Ejemplo n.º 7
0
    void BuyBomb()
    {
        SoundManager.Instance.PlaySoundEffect(SoundType.BOMB_PURCHASE);

        LoadingAlert.Present();
        StartCoroutine(SendAmmoBuyToServer(AmmoType.BOMB, BOMB_COST));
    }
Ejemplo n.º 8
0
        private async void update_clickedAsync(object sender, EventArgs ea)
        {
            Dictionary <string, dynamic> vals = new Dictionary <string, dynamic>();


            vals["name"]    = name_entry.Text;
            vals["email"]   = email_entry.Text;
            vals["mobile"]  = mobile_No_entry.Text;
            vals["street"]  = street_entry.Text;
            vals["city"]    = city_entry.Text;
            vals["zip"]     = zip_entry.Text;
            vals["website"] = web_text_entry.Text;


            var currentpage = new LoadingAlert();
            await PopupNavigation.PushAsync(currentpage);

            var updated = Controller.InstanceCreation().UpdateCustomerData("res.partner", "write", cusobj.id, vals);

            if (updated)
            {
                App.Current.MainPage = new MasterPage(new CustomersPage());
            }
            else
            {
                await DisplayAlert("Alert", "Please try again", "Ok");
            }

            Loadingalertcall();
        }
Ejemplo n.º 9
0
        public SalesOrderListviewDetail(SalesOrder item)
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            //    App.orderLineList = item.order_line;

            Cus.Text = item.customer;
            CD.Text  = item.DateOrder;
            PT.Text  = item.payment_term;
            SP.Text  = item.sales_person;
            ST.Text  = item.sales_team;
            CR.Text  = item.customer_reference;
            FP.Text  = item.fiscal_position;

            orderListview.ItemsSource = item.order_line;

            var backImgRecognizer = new TapGestureRecognizer();

            backImgRecognizer.Tapped += async(s, e) => {
                // handle the tap

                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                // Navigation.PopAllPopupAsync();
                App.Current.MainPage = new MasterPage(new CrmTabbedPage());
                //  orderListview.ItemsSource = null;
                Loadingalertcall();
            };
            backImg.GestureRecognizers.Add(backImgRecognizer);
        }
Ejemplo n.º 10
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();
            }
        }
Ejemplo n.º 11
0
        private async void CancelSignout_ClickedAsync(object sender, EventArgs e)
        {
            var updated = Controller.InstanceCreation().clearGPSData("calendar.event", "cancel_sign_out", editobj.id);

            // await RetrieveLocationForSignOut();

            MyMap1.MoveToRegion(
                MapSpan.FromCenterAndRadius(
                    new Position(0, 0), Distance.FromMiles(0.05)));

            var position1 = new Position(0, 0);

            var pin1 = new Pin
            {
                Type     = PinType.Place,
                Position = position1,
                Label    = "Your Address",
                Address  = "",
            };

            MyMap1.Pins.Add(pin1);

            var currentpage = new LoadingAlert();
            await PopupNavigation.PushAsync(currentpage);

            await DisplayAlert("Alert", "Location Successfully Updated", "Ok");

            Loadingalertcall();

            signout_loc.IsVisible    = true;
            cancel_signout.IsVisible = false;

            //   await RetrieveLocationForSignOut();
        }
Ejemplo n.º 12
0
        public SalesTargetDetailPage(SalesTarget item)
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            //tar_name.Text = item.name;
            //tar_type.Text = item.target_type;

            //orderListview.ItemsSource = item.brand;
            //ProductCatListview.ItemsSource = item.category;

            var backImgRecognizer = new TapGestureRecognizer();

            backImgRecognizer.Tapped += async(s, e) =>
            {
                // handle the tap
                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                Application.Current.MainPage = new MasterPage(new SalesTargetPage());
                //  orderListview.ItemsSource = null;
                Loadingalertcall();
            };
            backImg.GestureRecognizers.Add(backImgRecognizer);
        }
Ejemplo n.º 13
0
 void RequestFailure()
 {
     //Debug.Log("request failure");
     _requestFailure = true;
     LoadingAlert.FinishLoading();
     HTTPAlert.Present("HTTP Error", "Could not connect to the game server. Check your internet connection", null, null, true);
 }
Ejemplo n.º 14
0
 static void GetInstance()
 {
     if (_instance == null)
     {
         _instance = Load("Alerts/LoadingAlert", UIAlertController.Instance.CanvasRect) as LoadingAlert;
     }
 }
Ejemplo n.º 15
0
    void BuyArrow()
    {
        SoundManager.Instance.PlaySoundEffect(SoundType.ARROW_PURCHASE);

        LoadingAlert.Present();
        StartCoroutine(SendAmmoBuyToServer(AmmoType.ARROW, ARROW_COST));
    }
Ejemplo n.º 16
0
        private async void updatecancel_clickedAsync(object sender, EventArgs ea)
        {
            var currentpage = new LoadingAlert();
            await PopupNavigation.PushAsync(currentpage);

            App.Current.MainPage = new MasterPage(new CrmTabbedPage("tab3"));

            await Navigation.PopAllPopupAsync();
        }
Ejemplo n.º 17
0
        private async void attachStackClicked(object sender, EventArgs e)
        {
            var currentpage = new LoadingAlert();
            await PopupNavigation.PushAsync(currentpage);

            attachres = Controller.InstanceCreation().getfileAtachment(crm_lead_id, "crm.lead");
            await PopupNavigation.PopAsync();

            await Navigation.PushPopupAsync(new AttachmentPopupPage(attachres, crm_lead_id));
        }
Ejemplo n.º 18
0
        private async void RetrieveLocation()
        {
            try
            {
                var locator = CrossGeolocator.Current;
                locator.DesiredAccuracy = 20;
                var position = await locator.GetPositionAsync(timeout : new TimeSpan(20000));

                String dt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                //DateTime fd =   DateTime.ParseExact(dt, "MM-dd-yyyy h:mm:ss tt", CultureInfo.InvariantCulture);

                //dt = fd.ToString("yyyy-MM-dd HH:mm:ss");

                var updated = Controller.InstanceCreation().UpdateGPSData("calendar.event", "app_get_sign_in_location", (float)position.Latitude, (float)position.Longitude, editobj.id, dt);

                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                //    App.Current.MainPage = new MasterPage(new CalendarPage());
                await DisplayAlert("Alert", "Location Successfully Updated", "Ok");

                //App.Current.MainPage = new MasterPage(new CalendarPage());

                //Loadingalertcall();

                await PopupNavigation.PopAsync();

                signin_loc.IsVisible    = false;
                cancel_signin.IsVisible = true;


                sign_time.Text = dt;

                MyMap.MoveToRegion(
                    MapSpan.FromCenterAndRadius(
                        new Position(position.Latitude, position.Longitude), Distance.FromMiles(0.05)));

                var position1 = new Position(position.Latitude, position.Longitude);

                var pin1 = new Pin
                {
                    Type     = PinType.Place,
                    Position = position1,
                    Label    = "Your Address",
                    Address  = "",
                };

                MyMap.Pins.Add(pin1);
            }
            catch (Exception ex)
            {
                await DisplayAlert("Alert", "Please Check GPS Connection", "Ok");
            }
        }
Ejemplo n.º 19
0
        private async Task OnMenuItemTappedAsync(object sender, ItemTappedEventArgs ea)
        {
            MasterPageItem masterItemObj = (MasterPageItem)ea.Item;
            string         name          = masterItemObj.Title;

            //Settings.CurrentMenu = name;

            if (name == "Sign Out")
            {
                //var alertResult = new LogoutAlert();
                //await PopupNavigation.PushAsync(alertResult);
                var data = await DisplayAlert("Logout Alert", "Are you sure you want to log out?", "OK", "Cancel");

                if (data)
                {
                    Settings.UserName           = "";
                    Settings.UserPassword       = "";
                    Settings.PrefKeyUserDetails = "";
                    App.Current.MainPage        = new NavigationPage(new LoginPage());
                }
                else
                {
                }
            }

            else
            {
                Type page = masterItemObj.TargetType;

                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                Detail = new NavigationPage((Page)Activator.CreateInstance(page))
                {
                    BarBackgroundColor = Color.FromHex("#414141")
                };

                IsPresented = false;


                //await Task.Run(() =>
                //{
                //    Device.BeginInvokeOnMainThread(() =>
                //    {
                //        Detail = new NavigationPage((Page)Activator.CreateInstance(page)) ;
                //        //{ BarBackgroundColor = Color.FromHex("#414141") }
                //        IsPresented = false;

                //    });
                //});

                Loadingalertcall();
            }
        }
Ejemplo n.º 20
0
        private async void CustomerListView_ItemTappedAsync(object sender, ItemTappedEventArgs e)
        {
            var currentpage = new LoadingAlert();
            await PopupNavigation.PushAsync(currentpage);

            CustomersModel modelObj = e.Item as CustomersModel;
            await Navigation.PushPopupAsync(new CustomerListviewDetailPage(modelObj.id));

            // PopupNavigation.PopAsync();
            //    Navigation.PushAsync(new CustomerListviewDetailPage(modelObj));
        }
Ejemplo n.º 21
0
    IEnumerator SendAmmoBuyToServer(AmmoType ammoType, int cost)
    {
        yield return(StartCoroutine(OnlineManager.Instance.StartBuyAmmo(ammoType.ToString().ToLower())));

        if (OnlineManager.Instance.ResponseData.Success)
        {
            Avatar.Instance.Spend(cost, 0);
            Avatar.Instance.AddAmmo(ammoType);
            AmmoBeltView.Instance.SetAmmo(_index, ammoType);
        }
        LoadingAlert.FinishLoading();
    }
Ejemplo n.º 22
0
    IEnumerator StartRefresh()
    {
        yield return(StartCoroutine(OnlineManager.Instance.StartGetPlayer(OnlineManager.Instance.PlayerID)));

        if (_state == AvatarViewState.AMMO)
        {
            AmmoBeltView.Instance.Refresh();
        }

        // remove loader
        LoadingAlert.FinishLoading();
    }
Ejemplo n.º 23
0
        private async Task RetrieveLocationForSignOut()
        {
            try
            {
                var locator = CrossGeolocator.Current;
                locator.DesiredAccuracy = 20;
                var position = await locator.GetPositionAsync(timeout : new TimeSpan(20000));

                var updated = Controller.InstanceCreation().UpdateGPSData("calendar.event", "get_sign_out_location", (float)position.Latitude, (float)position.Longitude, editobj.id);

                calresult = Controller.InstanceCreation().GetCalenderData(DateTime.Now.Month, DateTime.Now.Year);

                //if (updated == "true")
                //{
                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                // App.Current.MainPage = new MasterPage(new CalendarPage());
                await DisplayAlert("Alert", "Location Successfully Updated", "Ok");

                App.Current.MainPage = new MasterPage(new CalendarPage());

                Loadingalertcall();
                signout_loc.IsVisible = false;

                MyMap1.MoveToRegion(
                    MapSpan.FromCenterAndRadius(
                        new Position(position.Latitude, position.Longitude), Distance.FromMiles(0.05)));

                var position1 = new Position(position.Latitude, position.Longitude);

                var pin1 = new Pin
                {
                    Type     = PinType.Place,
                    Position = position1,
                    Label    = "Your Address",
                    Address  = "",
                };

                MyMap1.Pins.Add(pin1);
            }

            catch (Exception ex)
            {
                await DisplayAlert("Alert", "Please Check GPS Connection", "Ok");
            }
            //}

            //else
            //{
            //    await DisplayAlert("Alert", "Please try again", "Ok");
            //}
        }
Ejemplo n.º 24
0
    IEnumerator LogBackIn()
    {
        yield return(OnlineManager.Instance.StartGetPlayer(OnlineManager._playerID));

        yield return(StartCoroutine(OnlineManager.Instance.StartGetGear()));

        yield return(StartCoroutine(OnlineManager.Instance.StartGetGame()));

        Database.Instance.BuildAllData();
        Database.Instance.BuildGearList();
        PathManager.Instance.Initialize();

        LoadingAlert.FinishLoading();
    }
Ejemplo n.º 25
0
        //protected override void OnAppearing()
        //{
        //    base.OnAppearing();
        //    MessagingCenter.Subscribe<Dictionary<string,dynamic>, string>(vals, "NotifyMsg", (sender, arg) =>
        //    {
        //        string retarg = arg;
        //        List<CRMLead> crmLeadData = Controller.InstanceCreation().crmLeadData();
        //    });
        //}


        async Task RecordAudio()
        {
            try
            {
                if (!recorder.IsRecording) //Record button clicked
                {
                    var currentpage = new LoadingAlert();
                    await PopupNavigation.PushAsync(currentpage);

                    recorder.StopRecordingOnSilence = false;
                    //  recorder.AudioStreamDetails.SampleRate  = 0xA0000;
                    //    recorder.AudioStreamDetails.BitsPerSample =

                    await PopupNavigation.PopAsync();

                    // recorder.StopRecordingOnSilence = TimeoutSwitch.IsToggled;

                    //RecordButton.IsEnabled = false;
                    //PlayButton.IsEnabled = false;

                    //start recording audio

                    //recorder.IsRecording = true;
                    var audioRecordTask = await recorder.StartRecording();

                    //RecordButton.Text = "Stop Recording";
                    //RecordButton.IsEnabled = true;

                    //  await audioRecordTask;

                    //RecordButton.Text = "Record";
                    //PlayButton.IsEnabled = true;
                }
                else //Stop button clicked
                {
                    // RecordButton.IsEnabled = false;

                    //stop the recording...
                    await recorder.StopRecording();

                    // RecordButton.IsEnabled = true;
                }
            }
            catch (Exception ex)
            {
                //blow up the app!
                throw ex;
            }
        }
Ejemplo n.º 26
0
    IEnumerator ReplayGame()
    {
        //Debug.Log("replaygame");

        yield return(StartCoroutine(OnlineManager.Instance.StartReplayGame()));

        PathManager.Instance.Initialize();

        SetUpGameFromData();

        LoadingAlert.FinishLoading();
        UIViewController.ActivateUIView("CountdownView");
        _replay = true;
        enabled = true;
    }
Ejemplo n.º 27
0
    protected override void OnActivate()
    {
        base.OnActivate();

        if (!_loggedIn && !GameManager.Client)
        {
            _loggedIn = true;
            //Debug.Log("presenting login alert");
            //LoadingAlert.Present();

            /*
             * if (OnlineManager.Token == null || OnlineManager.Token == "")
             *  FullLoginAlert.Present();
             * else
             *  LoginAlert.Present();
             */

            // Application.ExternalCall("trySetToken");
            Application.ExternalEval("window.sendMeTheToken = true");
            FullLoginAlert.Present();
        }
        else if (GameManager.Client)
        {
            // after game replay
            LoadingAlert.Present();
            OnlineManager.Instance.SetServer();
            StartCoroutine(LogBackIn());
        }
        else
        {
            //DefaultAlert.Present(
        }

        BattleButton.Reset();
        StoreButton.Reset();
        StatsButton.Reset();
        SettingsButton.Reset();

        if (!_music)
        {
            _music = true;
            SoundManager.Instance.StartMenuMusic();
        }

        StoreRefreshButtonObj.SetActive(false);

        VersionText.Text = "Version " + VERSION;
    }
Ejemplo n.º 28
0
    IEnumerator SignIn()
    {
        OnlineManager.Instance.SetServer();

        yield return(StartCoroutine(OnlineManager.Instance.StartLogin(_username, _password)));

        //Debug.Log(OnlineManager.Token);

        if (OnlineManager.Token != null && OnlineManager.Token != "")
        {
            yield return(StartCoroutine(OnlineManager.Instance.StartGetPlayer(OnlineManager._playerID)));

            if (OnlineManager.Instance.PlayerReponseData.player.gamemaster)
            {
                GameManager.Client = false;
                SceneManager.LoadScene("Moderator");
            }

            if (!OnlineManager.Instance.GetRequestFailure)
            {
                if (OnlineManager.Instance.PlayerID == null || OnlineManager.Instance.PlayerReponseData.status != "ok")
                {
                    LoadingAlert.FinishLoading();
                    HTTPAlert.Present("Login Error", OnlineManager.Instance.Error, null, null, true);
                }
                else
                {
                    yield return(StartCoroutine(OnlineManager.Instance.StartGetGame()));

                    yield return(StartCoroutine(OnlineManager.Instance.StartGetGear()));

                    Database.Instance.BuildAllData();
                    Database.Instance.BuildGearList();
                    PathManager.Instance.Initialize();

                    if (!Avatar.Instance.Embodied)
                    {
                        UIViewController.ActivateUIView(AvatarCreationView.Load());
                        UIViewController.ActivateUIView(AvatarStatsView.Load());
                    }

                    LoadingAlert.FinishLoading();
                    Deactivate();
                }
            }
        }
    }
Ejemplo n.º 29
0
    IEnumerator RefreshBattleStatus()
    {
        yield return(StartCoroutine(OnlineManager.Instance.StartGetGame()));

        PathManager.Instance.Initialize();

        if (PathView.Instance != null)
        {
            PathView.Instance.Refresh();
        }
        if (PositionView.Instance != null)
        {
            PositionView.Instance.Refresh();
        }

        LoadingAlert.FinishLoading();
    }
Ejemplo n.º 30
0
    void DisplayError(Dictionary <string, object> dict)
    {
        _error = "";
        string message = "";

        if (dict != null)
        {
            message = dict["message"].ToString();
            _error  = dict["message"].ToString();
        }
        else
        {
            message = "Error fetching data from server";
        }
        //Debug.Log("presenting error");
        LoadingAlert.FinishLoading();
        HTTPAlert.Present("Error", message, null, null, true);
    }