Пример #1
0
 public DayAdapter(Activity context, List <Day> list)
 {
     _context = context;
     _list    = list;
     db       = new RegisterDayRepository();
     var tttt = db.GetAllRegisterDay();
 }
Пример #2
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
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.HistoryDaylayout);

            db       = new RegisterDayRepository();
            ListView = FindViewById <ListView>(Resource.Id.lstHistoryDay);
            List <Schedule> listd = new List <Schedule>();
            var             list  = db.GetLatestRegisterDay(20);

            foreach (var item in list)
            {
                listd.Add(new Schedule()
                {
                    Exercise = item.Exercise + "------" + item.Date.ToPersianDateString()
                });
            }
            ListView.Adapter = new ScheduleAdapter(this, listd);
            // Create your application here
        }
Пример #4
0
 public ScheduleAdapter(Activity context, List <Schedule> list)
 {
     _context = context;
     _list    = list;
     db       = new RegisterDayRepository();
 }