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 }
public void UpdateList() { int take = 0; try { take = db.Find(p => p.Enable == true & p.Day < 0).Day * -1; } catch (Exception) { take = 0; } Day rrr = new Day(take); ListView = FindViewById <ListView>(Resource.Id.listViewDays); ListView.Adapter = new DayAdapter(this, rrr.days()); }