private void InitializeData()
        {
            WorkProfilePlanDataService = new WorkProfilePlanDataService();
            WorkProfilePlanDataService.WorkProfilePlanAdded += OnWorkProfilePlanAdded;

            ColumnHeaders = new List<ColumnInfo> 
            { 
                new ColumnInfo("Name",0, false), 
                new ColumnInfo("StartDate",1, false), 
                new ColumnInfo("EndDate",2, false), 
                new ColumnInfo("SelectedProfile.Name", "txtWorkProfile",3, true), 
            };

            AddCommand = new Command(Add, CanAdd);
			RefreshCommand = new Command(CreateItems);
            AddGroupCommand = new Command(Add, CanAddGroup);
			ResetCommand = new Command(Reset, CanReset);
            CreateItems(null);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkProfilePlanVm"/> class initialized with default values.
 /// </summary>
 public WorkProfilePlanVm(AccessType access, WorkProfilePlanDataService dataService)
     : base(access)
 {
     _model = dataService.CreateDefault();
     InitializeData(dataService);
 }
Beispiel #3
0
 public static WorkProfilePlan CreateNew(WorkProfilePlanDataService dataService)
 {
     int id = dataService.AddModel(dataService.CreateDefault());
     return dataService.GetSingle(id);
 }
Beispiel #4
0
        private void InitializeData(WorkProfilePlanDataService dataService)
        {
            WorkProfilePlanDataService = dataService;
            SaveCommand = new Command(Save, CanSave);

            //add all profiles
            foreach (var profile in new WorkProfileDataService().GetAll())
            {
                Profiles.Add(new WorkProfileInfo(profile));
            }
            if (_model != null)
                if (_model.WorkProfile != null)
                    SelectedProfile = Profiles.FirstOrDefault(x => x.Id == _model.WorkProfile.Id);
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkProfilePlanVm"/> class from the model.
 /// </summary>
 /// <param name="entity">The model.</param>
 /// <param name="access"></param>
 /// <param name="dataService"></param>
 public WorkProfilePlanVm(WorkProfilePlan entity, AccessType access, WorkProfilePlanDataService dataService)
     : base(access)
 {
     _model = entity;
     InitializeData(dataService);
 }