Esempio n. 1
0
        public List <Planned> ReadRoutinePlanned()
        {
            Planned        p    = new Planned();
            List <Planned> list = DataLinkLayer.DBread <Planned>(p);

            return(list);
        }
Esempio n. 2
0
        public List <RoutineShow> RoutineShowSend()
        {
            Routine rt = new Routine();
            //BLRoutine r = new BLRoutine();
            //Int32 c = r.InsertRoutine(rt);

            RoutinePlanned rpd = new RoutinePlanned();
            // Int32 d = InsertRoutinePlanned(rpd);
            int d = InsertRoutinePlanned(rpd);

            List <RoutinePlanned> routinePlanned = DataLinkLayer.DBread <RoutinePlanned>(rpd);
            List <Routine>        routine        = DataLinkLayer.DBread <Routine>(new Routine());
            List <Exercise>       exercise       = DataLinkLayer.DBread <Exercise>(new Exercise());

            List <RoutineShow> myRoutine = new List <RoutineShow>();

            {
                foreach (RoutinePlanned rp in routinePlanned)
                {
                    String a = routine.Find(x => x.RoutineID == rp.RoutineID).RoutineName;
                    String b = exercise.Find(x => x.ExcerciseID == (rp.ExcertciseID)).Name;
                    myRoutine.Add(new RoutineShow {
                        RoutineName = a, ExcerciseName = b
                    });
                }
            };

            Console.WriteLine(myRoutine.ToString());

            return(myRoutine);
        }
Esempio n. 3
0
        public List <RoutineShow> RoutineShowSend()
        {
            Routine     rt              = new Routine();
            Planned     rpd             = new Planned();
            Exercise    ex              = new Exercise();
            BLExercise  addExerciseData = new BLExercise();
            BLRoutine   addRoutineData  = new BLRoutine();
            RoutineShow eachRoutineShow = new RoutineShow();

            //db.DropTable<Routine>();
            //db.CreateTable<Routine>();
            //BLRoutine bL = new BLRoutine();
            //bL.InsertRoutine(new Routine());

            //db.DropTable<Planned>();
            //db.CreateTable<Planned>();

            List <Routine>  routine  = DataLinkLayer.DBread <Routine>(new Routine());
            List <Exercise> exercise = DataLinkLayer.DBread <Exercise>(new Exercise());

            List <RoutineShow> finalList = new List <RoutineShow>();

            finalList.Clear();


            List <Planned> routinePlanned = DataLinkLayer.DBread <Planned>(rpd);

            Console.WriteLine(routinePlanned);

            RoutineShow myRoutineShow = new RoutineShow();

            foreach (Planned rp in routinePlanned)
            {
                String a = routine.Find(x => x.RoutineID == rp.RoutineID).RoutineName;
                String b = exercise.Find(x => x.ExcerciseID == (rp.ExcerciseID)).Name;
                Console.WriteLine(a + "-" + b + "-" + rp.Date);
                if (finalList.Find(x => x.RoutineName.Equals(a)) == null)
                {
                    RoutineShow routineShow = new RoutineShow();
                    routineShow.RoutineName = a;
                    routineShow.ExcerciseList.Add(b);
                    routineShow.ExTime = rp.Date;
                    routineShow.Sets.Add(rp.Sets);
                    routineShow.Reps.Add(rp.Reps);
                    routineShow.Lbs.Add(rp.Lbs);
                    finalList.Add(routineShow);
                }
                else
                {
                    finalList.Find(x => x.RoutineName.Equals(a)).ExcerciseList.Add(b);
                    finalList.Find(x => x.RoutineName.Equals(a)).ExTime = rp.Date;
                    finalList.Find(x => x.RoutineName.Equals(a)).Sets.Add(rp.Sets);
                    finalList.Find(x => x.RoutineName.Equals(a)).Reps.Add(rp.Reps);
                    finalList.Find(x => x.RoutineName.Equals(a)).Lbs.Add(rp.Lbs);
                }
            }

            return(finalList);
        }
Esempio n. 4
0
        public List <Exercise> ReadExercise()
        {
            Exercise e = new Exercise();
            // Int32 count = InsertExcercise(e);
            List <Exercise> list = DataLinkLayer.DBread <Exercise>(e);

            return(list);
        }
Esempio n. 5
0
        public Planned ReadRoutinePlanned(ExerciseShow exerciseShow)
        {
            List <Planned>  planneds     = ReadRoutinePlanned();
            List <Exercise> exerciseList = DataLinkLayer.DBread <Exercise>(new Exercise());
            List <Routine>  routineList  = DataLinkLayer.DBread <Routine>(new Routine());

            Int32 routineID  = routineList.Find(x => x.RoutineName.Equals(exerciseShow.RoutineName)).RoutineID;
            Int32 Exerciseid = exerciseList.Find(x => x.Name.Equals(exerciseShow.ExcerciseName)).ExcerciseID;


            return(planneds.Find(x => x.RoutineID == routineID && x.ExcerciseID == Exerciseid));
        }
Esempio n. 6
0
        public List<RoutineShow> RoutineShowSend()
        {
            Routine rt = new Routine();
            //BLRoutine r = new BLRoutine();
            //Int32 c = r.InsertRoutine(rt);

            Planned rpd = new Planned();
            // Int32 d = InsertRoutinePlanned(rpd);

            Exercise ex = new Exercise();
            BLExercise addExerciseData = new BLExercise();
           // int exCount = addExerciseData.InsertExcercise(ex);

            BLRoutine addRoutineData = new BLRoutine();
//            int rCount = addRoutineData.InsertRoutine(rt);


           // int d = InsertRoutinePlanned(rpd);



            List<Routine> routine = DataLinkLayer.DBread<Routine>(new Routine());
            List<Exercise> exercise = DataLinkLayer.DBread<Exercise>(new Exercise());


            List<Planned> routinePlanned = DataLinkLayer.DBread<Planned>(rpd);
            Console.WriteLine(routinePlanned);

            List<RoutineShow> myRoutine = new List<RoutineShow>();

            {
                foreach (Planned rp in routinePlanned)
                {
                    String a = routine.Find(x => x.RoutineID == rp.RoutineID).RoutineName;
                    String b = exercise.Find(x => x.ExcerciseID == (rp.ExcerciseID)).Name;
                    myRoutine.Add(new RoutineShow { RoutineName = a, ExcerciseName = b });
                    Console.WriteLine(a + "-" + b);
                }
            };


            return myRoutine;


        }
Esempio n. 7
0
        public List<Planned> ReadRoutinePlanned()
        {
            Planned rp = new Planned();
            List<Planned> list = DataLinkLayer.DBread<Planned>(rp);



            String s = "";

            foreach (Planned l in list)
            {
                s = s + "\n" + l.ToString();
            }

            Console.WriteLine(s);

            return list;
        }
Esempio n. 8
0
        public List <Profile> ReadProfile(SQLiteConnection db)
        {
            Profile        p    = new Profile();
            List <Profile> list = DataLinkLayer.DBread <Profile>(p);

            String s = "";

            foreach (Profile l in list)
            {
                s = s + "\n" + l.ToString();
            }

            Console.WriteLine(s);

            return(list);

            //await DisplayAlert(null, s, "ok");
        }
Esempio n. 9
0
        public List <Routine> ReadRoutine(SQLiteConnection db)
        {
            //ListView _list = new ListView();
            //_list.ItemsSource = db.Table<Profile>().OrderByDescending(x => x.ProfileID).ToList();
            Routine        p    = new Routine();
            List <Routine> list = DataLinkLayer.DBread <Routine>(p);



            String s = "";

            foreach (Routine l in list)
            {
                s = s + "\n" + l.ToString();
            }

            Console.WriteLine(s);

            return(list);
            //await DisplayAlert(null, s, "ok");
        }
Esempio n. 10
0
        public int RoutineShowInsert(List<RoutineShow> rsList)
        {

            Planned rp = new Planned();
            Routine routine = new Routine();
            Exercise exercise = new Exercise();
            BLRoutine bLRoutine = new BLRoutine();

            Int32 Exerciseid,routineAdded,routineID = 0;

            List<Exercise> exerciseList = DataLinkLayer.DBread<Exercise>(new Exercise());
            List<Routine> routineList = DataLinkLayer.DBread<Routine>(new Routine());

            Console.WriteLine(routineList);

            foreach (RoutineShow routineShow in rsList)
            {

                Exerciseid = exerciseList.Find(x => x.Name.Equals(routineShow.ExcerciseName)).ExcerciseID;

               // add record in Routine table
                routine.RoutineName = routineShow.RoutineName;
                routineAdded= bLRoutine.InsertRoutine(routine);

                routineList = DataLinkLayer.DBread<Routine>(new Routine());
                routineID = routineList.Find(x => x.RoutineName.Equals(routineShow.RoutineName)).RoutineID;

                if (routineAdded != 0)
                {
                    rp.ExcerciseID = Exerciseid;
                    rp.RoutineID = routineID;

                    return InsertRoutinePlanned(rp);
                }


            }

            return 0;
        }
Esempio n. 11
0
        public Int32 RoutineShowInsert(ExerciseShow exerciseShow)
        {
            List <RoutineShow> rsList = new List <RoutineShow>();

            Planned   rp        = new Planned();
            Routine   routine   = new Routine();
            Exercise  exercise  = new Exercise();
            BLRoutine bLRoutine = new BLRoutine();
            BLPlanned bLPlanned = new BLPlanned();

            Int32 Exerciseid, routineAdded, routineID = 0;

            List <Exercise> exerciseList = DataLinkLayer.DBread <Exercise>(new Exercise());
            List <Routine>  routineList  = DataLinkLayer.DBread <Routine>(new Routine());

            Exerciseid = exerciseList.Find(x => x.Name.Equals(exerciseShow.ExcerciseName)).ExcerciseID;

            // add record in Routine table
            routine.RoutineName = exerciseShow.RoutineName;
            routineAdded        = bLRoutine.InsertRoutine(routine);

            routineList = DataLinkLayer.DBread <Routine>(new Routine());

            if (routineAdded != 0)
            {
                Console.WriteLine();
                routineID      = routineList.Find(x => x.RoutineName.Equals(exerciseShow.RoutineName)).RoutineID;
                rp.ExcerciseID = Exerciseid;
                rp.RoutineID   = routineID;
                rp.Date        = exerciseShow.ExTime;
                rp.Sets        = exerciseShow.Sets;
                rp.Reps        = exerciseShow.Reps;
                rp.Lbs         = exerciseShow.Lbs;
                Console.WriteLine();

                return(bLPlanned.InsertRoutinePlanned(rp));
            }
            return(0);
        }
Esempio n. 12
0
        public List <Executed> ReadRoutineExecuted()
        {
            List <Executed> list = DataLinkLayer.DBread <Executed>(rExecuted);

            return(list);
        }