コード例 #1
0
        private void InitializeView(int?Id)
        {
            if (Id != null)
            {
                var result = classScheduleServices.GetById((int)Id);
                if (result != null)
                {
                    LblClassScheduleReview.Content = result.NameBranchOffice + " - " + result.Day + " - " +
                                                     result.Subject;

                    LblHoraInicio.Content = "Hora Inicio (" + result.StartHour + "):";
                    LblHoraFin.Content    = "Hora Fin (" + result.EndHour + "):";
                    mkbHoraInicio.Value   = result.StartHour;
                    mkbHoraFin.Value      = result.EndHour;
                    LblIdTrainer.Content  = result.IdTrainer.ToString();
                    LblIdClass.Content    = Id.ToString();
                    _huella1 = result.HuellaTrainer1;
                    _huella2 = result.HuellaTrainer2;
                    if (result.WeekDay != null)
                    {
                        _DayOfWeek = (int)result.WeekDay;
                    }
                }

                #region Fill CmbTRainer // CmbStaf

                var result0 = _trainer.GetAll().Where(a => a.Active == true).ToList();
                CmbTrainer.ItemsSource = result0;

                result0.Insert(0, new TrainerModel {
                    Id = 0, Name = null
                });

                if (result.IdTrainer != null)
                {
                    CmbTrainer.SelectedValue = result.IdTrainer.ToString();
                }
                else
                {
                    CmbTrainer.SelectedIndex = 0;
                }


                var result1 = _staff.GetAll().Where(a => a.Active == true).ToList();
                result1.Insert(0, new StaffModel {
                    Id = 0, Name = "Seleccione Staff"
                });
                CmbStaf.ItemsSource = result1;


                #endregion

                TxtObservacion.Focus();
            }
        }
コード例 #2
0
        private void InitializedWindow(int Id)
        {
            var result = _services.GetById(Id);

            LblId.Content      = Id.ToString();
            mkbHoraInicio.Text = result.StartHour;
            mkbHoraFin.Text    = result.EndHour;

            HourStart = result.StarBranchOffice;
            HourEnd   = result.EndBranchOffice;

            if (!(bool)result.Active)
            {
                CmbActive.SelectedIndex = 1;
            }
            else
            {
                CmbActive.SelectedIndex = 0;
            }

            FillCombos(result.IdBranchOffice, result.IdWorkout, result.WeekDay, result.IdTrainer);
        }