Exemplo n.º 1
0
 private void btUnlock_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var obj = dgOnOff.SelectedItem as CS_OnOffValidate;
         if (obj != null)
         {
             OnOffService.Update((int)obj.Id_Offer, obj.OfferNo, obj.Item, false);
             FillGrid();
         }
         else
         {
             MessageBox.Show("Escolha um registro!", "Aviso", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Erro \n" + ex.Message, "Erro", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemplo n.º 2
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                ooService = new OnOffService();

                scheduleId = Intent.GetIntExtra("Schedule", 0);
                exerciseId = Intent.GetIntExtra("Exercise", 0);
                userId     = Intent.GetStringExtra("User");
                List <Practice> practices = new List <Practice>();

                practices = await ooService.getAllPracticesAsync(userId, scheduleId, exerciseId);

                List <float> zahlen = new List <float>();
                //Dictionary<DateTime, double> daten = new Dictionary<DateTime, double>();
                foreach (var item in practices)
                {
                    zahlen.Add(Convert.ToSingle(item.Repetitions * item.NumberOfRepetitions * item.Weight));
                    //daten.Add(item.Timestamp, item.Repetitions * item.NumberOfRepetitions * item.Weight);
                }

                var data = zahlen.ToArray();
                if (data.Length != 0)
                {
                    var chart = new BarChartView(this)
                    {
                        ItemsSource = Array.ConvertAll(data, v => new BarModel {
                            Value = v
                        })
                    };
                    AddContentView(chart, new ViewGroup.LayoutParams(
                                       ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Fehler in der StatisticActivity: " + ex.StackTrace);
            }
        }
Exemplo n.º 3
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                ooService = new OnOffService();

                scheduleId = Intent.GetIntExtra("Schedule", 0);
                exerciseId = Intent.GetIntExtra("Exercise", 0);
                userId = Intent.GetStringExtra("User");
                List<Practice> practices = new List<Practice>();

                practices = await ooService.getAllPracticesAsync(userId, scheduleId, exerciseId);

                List<float> zahlen = new List<float>();
                //Dictionary<DateTime, double> daten = new Dictionary<DateTime, double>();
                foreach (var item in practices)
                {
                    zahlen.Add(Convert.ToSingle(item.Repetitions * item.NumberOfRepetitions * item.Weight));
                    //daten.Add(item.Timestamp, item.Repetitions * item.NumberOfRepetitions * item.Weight);
                }
                
                var data = zahlen.ToArray();
                if(data.Length != 0)
                {
                    var chart = new BarChartView(this)
                    {
                        ItemsSource = Array.ConvertAll(data, v => new BarModel { Value = v })
                    };
                    AddContentView(chart, new ViewGroup.LayoutParams(
                  ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));
                }
            }
            catch(Exception ex)
            {
                Console.WriteLine("Fehler in der StatisticActivity: " + ex.StackTrace);
            }
        }
Exemplo n.º 4
0
 public SettingsView()
 {
     InitializeComponent();
     onOffService = new OnOffService();
     FillGrid();
 }