private void LoadOtherFinancialAccruals(int issueId, DateTime date)
        {
            var getVendorsTask = DatabaseLoader.GetVendors();
            var getSystemReferencesTask = DatabaseLoader.GetSystemReferences(issueId);
            var getOtherFinancialAccrualsTask = DatabaseLoader.GetOtherFinancialAccruals(issueId, date);

            var tasks = new List<Task>
            {
                getVendorsTask,
                getSystemReferencesTask,
                getOtherFinancialAccrualsTask
            };

            Task.Factory.ContinueWhenAll(tasks.ToArray(), xx =>
            {
                CMS.UiFactory.StartNew(() =>
                {
                    mVendors = getVendorsTask.Result;

                    mWbsElements = getSystemReferencesTask.Result.Where(x => x.SystemReferenceType.Code == CommonUtils.SystemReferenceTypeCode.PRJWBS.ToString()).ToList();
                    mProjectDefinition = getSystemReferencesTask.Result.FirstOrDefault(x => x.SystemReferenceType.Code == CommonUtils.SystemReferenceTypeCode.PRJDEF.ToString());
                    AddButtonCommand.RaiseCanExecuteChanged(); // we have loaded mProjectDefinition so reload the permission to click
                    RemoveButtonCommand.RaiseCanExecuteChanged();
                    OkButtonCommand.RaiseCanExecuteChanged();
                    CancelButtonCommand.RaiseCanExecuteChanged();

                    //Get OtherAccruals
                    foreach (var issueFinancialOtherAccrual in getOtherFinancialAccrualsTask.Result)
                    {
                        PurchaseOrderOtherAccureModel purchaseOrderOtherAccureModel = new PurchaseOrderOtherAccureModel(
                            issueFinancialOtherAccrual, mWbsElements, mVendors, View);
                        OtherAccruals.Add(purchaseOrderOtherAccureModel);
                    }
                    RaisePropertyChanged("OtherAccruals");
                    RaisePropertyChanged("LastImportedByUserDate");

                });
            });

            //CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
            //{
            //    cmsWebServiceClient.GetPropertyListNamesCompleted += (s2, e2) =>
            //    {
            //        //Get Vendors
            //        mVendors = e2.Result;
            //        cmsWebServiceClient.GetSystemReferencesCompleted += (s3, e3) =>
            //        {
            //            //Get WbsElements
            //            mWbsElements = e3.Result.Where(x => x.SystemReferenceType.Code == CommonUtils.SystemReferenceTypeCode.PRJWBS.ToString()).ToList();
            //            mProjectDefinition = e3.Result.FirstOrDefault(x => x.SystemReferenceType.Code == CommonUtils.SystemReferenceTypeCode.PRJDEF.ToString());
            //            AddButtonCommand.RaiseCanExecuteChanged(); // we have loaded mProjectDefinition so reload the permission to click
            //            RemoveButtonCommand.RaiseCanExecuteChanged();
            //            OkButtonCommand.RaiseCanExecuteChanged();
            //            CancelButtonCommand.RaiseCanExecuteChanged();

            //            cmsWebServiceClient.GetOtherFinancialAccrualsCompleted += (s1, e1) =>
            //            {
            //                //Get OtherAccruals
            //                foreach (var issueFinancialOtherAccrual in e1.Result)
            //                {
            //                    PurchaseOrderOtherAccureModel purchaseOrderOtherAccureModel = new PurchaseOrderOtherAccureModel(
            //                        issueFinancialOtherAccrual, mWbsElements, mVendors, View);
            //                    OtherAccruals.Add(purchaseOrderOtherAccureModel);
            //                }
            //                RaisePropertyChanged("OtherAccruals");
            //                RaisePropertyChanged("LastImportedByUserDate");
            //            };

            //            cmsWebServiceClient.GetOtherFinancialAccrualsAsync(issueId, date);
            //        };
            //        cmsWebServiceClient.GetSystemReferencesAsync(issueId); //hardcoded
            //    };
            //    cmsWebServiceClient.GetPropertyListNamesAsync("Vendors");
            //}
        }
        private void AddButtonCommandHandler(object parameter)
        {
            IssueFinancialOtherAccrual otherAccrual = new IssueFinancialOtherAccrual
            {
                ProjectDefinition = mProjectDefinition.Number,
                Date = mDate,
                LastModifiedDate = DateTime.Now,
                LastModifiedById = CMS.User.Id
            };

            PurchaseOrderOtherAccureModel purchaseOrderOtherAccureModel = new PurchaseOrderOtherAccureModel(otherAccrual, mWbsElements, mVendors, View);
            OtherAccruals.Add(purchaseOrderOtherAccureModel);
        }