Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Dayslayout);
            DateTime tt = DateTime.Now;

            db = new ScheduleRepository();
            if (!db.HaveAnySchedule())
            {
                db.InsertSchedule(new Schedule()
                {
                    Id = 1, Exercise_FK = 0, Exercise = "", Time = "", Set = 0, Count = 0, Program = 1, Day = -3, Enable = true
                });
            }


            //exerciseRepository g = new exerciseRepository();
            //var t = g.GetExerciseById(3);
            //var tt= g.GetExerciseById(4);
            //db.InsertSchedule(new Schedule() { Exercise_FK = t.Id, Exercise = t.name, Time = "", Set = 3, Count = 6, Program = 1, Day = 1, Enable = true });
            // db.InsertSchedule(new Schedule() {  Exercise_FK = tt.Id, Exercise = tt.name, Time = "", Set = 4, Count = 12, Program = 1, Day = 1 ,Enable = true });
            //var y = db.GetAllSchedule();
            UpdateList();
            ListView.ItemClick += ListView_ItemClick;

            // Create your application here
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.PerDaylayout);

            db = new ScheduleRepository();

            day = Intent.GetIntExtra("personId", 0);


            lblNameDay = FindViewById <TextView>(Resource.Id.lblNameDay);


            switch (day)
            {
            case 1:
                lblNameDay.Text = " روز اول";
                break;

            case 2:
                lblNameDay.Text = " روز دوم";
                break;

            case 3:
                lblNameDay.Text = "روز سوم";
                break;

            case 4:
                lblNameDay.Text = "روز چهارم";
                break;

            case 5:
                lblNameDay.Text = "روز پنجم";
                break;

            case 6:
                lblNameDay.Text = "روز ششم";
                break;

            case 7:
                lblNameDay.Text = "روز هفتم";
                break;

            default:
                lblNameDay.Text = "-1";
                break;
            }

            ListView = FindViewById <ListView>(Resource.Id.lstPerDay);

            schedules = db.Where(p => p.Program == program & p.Day == day).ToList();

            ListView.Adapter = new ScheduleAdapter(this, schedules);

            lblNameDay.Click   += LblNameDay_Click;
            ListView.ItemClick += ListView_ItemClick;
            // Create your application here
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.PerExerciselayout);

            id = Intent.GetIntExtra("Id", 0);

            db  = new RegisterDayRepository();
            dbb = new ScheduleRepository();

            TextView lblShowPerExercise = FindViewById <TextView>(Resource.Id.lblShowPerExercise);
            TextView lblShowPerSet      = FindViewById <TextView>(Resource.Id.lblShowPerSet);
            TextView lblWeightt         = FindViewById <TextView>(Resource.Id.lblWeightt);

            txtWeight = FindViewById <EditText>(Resource.Id.txtWeight);
            btnPassed = FindViewById <Button>(Resource.Id.btnPassed);
            btnNotNow = FindViewById <Button>(Resource.Id.btnNotNow);
            schedule  = dbb.Find(p => p.Id == id);
            StringBuilder d = new StringBuilder();


            var lastWeight = db.GiveMe(schedule.Exercise_FK);

            if (lastWeight != null)
            {
                if (lastWeight.Time == "")
                {
                    d.AppendLine("آخرین وزنه ای که زده شد:     " + lastWeight.weight + "  کیلوگرم");
                }

                else
                {
                    lblWeightt.Text = "دقیقه";
                    d.AppendLine(schedule.Time + "  دقیقه");
                    d.AppendLine();
                    d.AppendLine("آخرین زمان:     " + lastWeight.weight + " دقیقه");
                }
            }

            lblShowPerExercise.Text = schedule.Exercise;
            lblShowPerSet.Text      = d.ToString();

            btnNotNow.Click += BtnNotNow_Click;
            btnPassed.Click += BtnPassed_Click;

            // Create your application here
        }
Пример #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.AddExerciselayout);

            db  = new exerciseRepository();
            dbb = new ScheduleRepository();

            Id      = Intent.GetIntExtra("id", 0);
            day     = Intent.GetIntExtra("day", 0);
            program = Intent.GetIntExtra("program", 0);

            exercise = db.Find(p => p.Id == Id);

            TextView lblShowExercise = FindViewById <TextView>(Resource.Id.lblShowExercise);

            txtSet         = FindViewById <EditText>(Resource.Id.txtSet);
            txtCount       = FindViewById <EditText>(Resource.Id.txtCount);
            txtMin         = FindViewById <EditText>(Resource.Id.txtMin);
            btnAddExersice = FindViewById <Button>(Resource.Id.btnAddExersice);

            LinearLayout liner1 = FindViewById <LinearLayout>(Resource.Id.liner1);
            LinearLayout liner2 = FindViewById <LinearLayout>(Resource.Id.liner2);

            if (exercise.cardio)
            {
                liner1.Visibility = ViewStates.Invisible;
            }
            else
            {
                liner2.Visibility = ViewStates.Invisible;
            }

            lblShowExercise.Text  = exercise.name;
            btnAddExersice.Click += BtnAddExersice_Click;
            // Create your application here
        }