Beispiel #1
0
 private IEnumerator<IResult> GetDepartmentsWithAny()
 {
     if (UILib.IsDesignMode())
         yield break;
     GetDepartmentsRequest getDepartmentsRequest = new GetDepartmentsRequest(true);
     yield return getDepartmentsRequest;
     if (getDepartmentsRequest.Error != null)
     {
         yield return new HandleExceptionResult(getDepartmentsRequest.Error);
         yield break;
     }
     Instance.DepartmentsWithAny = getDepartmentsRequest.Result.Clone();
 }
        public IEnumerable<IResult> LoadViewDepartments()
        {
            if (this.HasLoadedDepartments)
                yield break;

            GetDepartmentsRequest getDepartmentsRequest = new GetDepartmentsRequest();
            yield return getDepartmentsRequest;
            if (getDepartmentsRequest.Error != null) {
                yield return new HandleExceptionResult(getDepartmentsRequest.Error);
            }
            this.Departments = getDepartmentsRequest.Result;
            DepartmentsView.DepartmentGrid.Enable(defaultFocusDelegate);
            DepartmentsView.DepartmentData.Disable();
            NotifyOfPropertyChange(() => AssistantDepartmentMode);
            this.HasLoadedDepartments = true;
        }