Example #1
0
 private async Task ExecuteOnAddVisitTapped()
 {
     IsBusy = true;
     if (IsFreeMission)
     {
         var ContactsPage_ViewModel = new ContactPage_ViewModel(Navigation);
         await Navigation.PushAsync(new Contatcs_View("Add_Visite", Token, ContactsPage_ViewModel.Wilaya, ContactsPage_ViewModel.All_Commune, ContactsPage_ViewModel.Speciality), true);
     }
     else
     {
         await Navigation.PushAsync(new GlobalMission_View(Token), true);
     }
     IsBusy = false;
 }
Example #2
0
        private async Task ExecuteOnAbscence()
        {
            if (Selected_Item != null)
            {
                PopUpVisible = false;
                IsBusy       = true;
                if (Selected_Item == "Focus")
                {
                    var lazem_nelgalha_hal = new ContactPage_ViewModel(Navigation);
                    await Navigation.PushAsync(new Focus_View(Token, lazem_nelgalha_hal.Wilaya, lazem_nelgalha_hal.All_Commune, lazem_nelgalha_hal.Speciality), true);

                    IsBusy = false;
                }
                else
                {
                    var _restService = new RESTService();
                    var abscence     = new Absence_mission();
                    abscence.absence = Selected_Item;
                    var json = JsonConvert.SerializeObject(abscence, Formatting.None,
                                                           new JsonSerializerSettings
                    {
                        NullValueHandling = NullValueHandling.Ignore
                    });
                    var Result = await _restService.Post_absence(json, IsFreeMission, null, null, null);

                    if (Result.Item1)
                    {
                        DependencyService.Get <IMessage>().ShortAlert("Absence Syncroniser Avec Succes !");
                    }
                    else
                    {
                        DependencyService.Get <IMessage>().ShortAlert(Result.Item2);
                    }
                    IsBusy = false;
                }
            }
            else
            {
                DependencyService.Get <IMessage>().ShortAlert("Veuillez Selectionner un Motif !");
            }
        }