예제 #1
0
        private async Task ExecuteOnEdit()
        {
            if (Drugs != null)
            {
                if (Drugs.Duration < 1 & !Drugs.Indeterminer)
                {
                    DependencyService.Get <IMessage>().ShortAlert("Invalid Duration !");
                    return;
                }
                if (!string.IsNullOrEmpty(Drugs.Drug) & !string.IsNullOrEmpty(Drugs.Taking_Time) & Times_List.Count > 0 & Drugs.Dose > 0)
                {
                    if (await DependencyService.Get <IDialog>().AlertAsync("", Resources["EditMessage"], Resources["Yes"], Resources["No"]))
                    {
                        Drugs.Times_List   = Times_List.ToList();
                        Drugs.PicturePathe = PicturePath;
                        DataStore.UpdateDrugs(Drugs);

                        MessagingCenter.Send(this, "DataUpdated");
                        RappelService.SetRappel();
                        await Navigation.PopModalAsync();
                    }
                }
                else
                {
                    DependencyService.Get <IMessage>().ShortAlert("Invalid Data !");
                }
            }
        }
예제 #2
0
        private async Task ExecuteOnSave()
        {
            if (Drugs.Duration < 1 & !Drugs.Indeterminer)
            {
                DependencyService.Get <IMessage>().ShortAlert("Invalid Duration !");
                return;
            }
            if (!string.IsNullOrEmpty(Drugs.Drug) & index >= 0 & Times_List.Count > 0 & Drugs.Dose > 0)
            {
                if (await DependencyService.Get <IDialog>().AlertAsync("", "Voulez Vous Enregistrer ?", "Oui", "Non"))
                {
                    Drugs.Times_List = Times_List.ToList();
                    switch (Index)
                    {
                    case 0: Drugs.Taking_Time = "unimportant"; break;

                    case 1: Drugs.Taking_Time = "without food"; break;

                    case 2: Drugs.Taking_Time = "preparandial"; break;

                    case 3: Drugs.Taking_Time = "postparandial"; break;
                    }
                    Drugs.PicturePathe = PicturePath;
                    DataStore.AddDrugs(Drugs);
                    MessagingCenter.Send(this, "DataUpdated");
                    RappelService.SetRappel();
                    await Navigation.PopModalAsync();
                }
            }
            else
            {
                DependencyService.Get <IMessage>().ShortAlert("Invalide Data !");
            }
        }
예제 #3
0
        public override void OnReceive(Context context, Intent intent)
        {
            var stepServiceIntent = new Intent(context, typeof(StepCounter));

            context.StartService(stepServiceIntent);
            RappelService.ReRappel();
            RappelService.SetRappel();
        }