private void loadOperation_Completed(LoadOperation <DocumentManager.Web.Model.taxpayer> sender)
        {
            TaxPayerList.Clear();
            taxPayerSource.Source = sender.Entities;
            foreach (DocumentManager.Web.Model.taxpayer taxpayer in sender.Entities)
            {
                TaxPayerEntity taxPayerEntity = new TaxPayerEntity();
                taxPayerEntity.TaxPayer = taxpayer;
                taxPayerEntity.Update();

                if (taxPayerEntity.TaxPayerTypeId.HasValue)
                {
                    TaxPayerTypeEntity taxPayerTypeEntity;
                    if (TaxPayerTypeEntityDictionary.TryGetValue(taxPayerEntity.TaxPayerTypeId.Value, out taxPayerTypeEntity))
                    {
                        taxPayerEntity.TaxPayerTypeEntity = taxPayerTypeEntity;
                    }
                }


                TaxPayerList.Add(taxPayerEntity);
            }
            UpdateChanged("TaxPayerList");
            UpdateChanged("SearchInfo");
            IsBusy = false;
        }
        private void loadOperation_Completed(LoadOperation <DocumentManager.Web.Model.taxpayer> sender)
        {
            TaxPayerList.Clear();
            taxPayerSource.Source = sender.Entities;
            foreach (DocumentManager.Web.Model.taxpayer taxpayer in sender.Entities)
            {
                TaxPayerEntity taxPayerEntity = new TaxPayerEntity();
                taxPayerEntity.TaxPayer = taxpayer;
                taxPayerEntity.Update();

                if (taxPayerEntity.TaxPayerTypeId.HasValue)
                {
                    TaxPayerTypeEntity taxPayerTypeEntity;
                    if (TaxPayerTypeEntityDictionary.TryGetValue(taxPayerEntity.TaxPayerTypeId.Value, out taxPayerTypeEntity))
                    {
                        taxPayerEntity.TaxPayerTypeEntity = taxPayerTypeEntity;
                    }
                }


                TaxPayerList.Add(taxPayerEntity);
            }

            PagedCollectionView lPagedCollectionView = new PagedCollectionView(TaxPayerList);

            lPagedCollectionView.GroupDescriptions.Add(new PropertyGroupDescription("TaxPayerName"));
            TaxpayerView = lPagedCollectionView;
            TaxpayerView.Refresh();
            UpdateChanged("TaxpayerView");
            UpdateChanged("TaxPayerList");
            IsBusy = false;

            finishLoadedTaxpayer();
        }
        private void AddTaxPayer_Closed(object sender, EventArgs e)
        {
            ChildWindow lTaxPayerWindow = sender as ChildWindow;

            if (lTaxPayerWindow.DialogResult == true)
            {
                IsBusy = true;
                TaxPayerList.Add(addTaxPayerEntity);
                documentManagerContext.taxpayers.Add(addTaxPayerEntity.TaxPayer);
                Log.AddLog(documentManagerContext, addTaxPayerEntity.ToString());
                SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();
                lSubmitOperation.Completed += SubOperation_Completed;
            }
        }
示例#4
0
        private void loadOperation_Completed(LoadOperation <DocumentManager.Web.Model.taxpayer> sender)
        {
            TaxPayerList.Clear();
            taxPayerSource.Source = sender.Entities;
            foreach (DocumentManager.Web.Model.taxpayer taxpayer in sender.Entities)
            {
                TaxPayerEntity taxPayerEntity = new TaxPayerEntity();
                taxPayerEntity.TaxPayer = taxpayer;
                taxPayerEntity.Update();

                string lProjectName = taxPayerEntity.TaxPayerProject;

                if (lProjectName == null)
                {
                    continue;
                }

                decimal lTotalMoney;
                if (ProjectTotalMonay.TryGetValue(lProjectName, out lTotalMoney))
                {
                    taxPayerEntity.TotalMoney = lTotalMoney;
                }

                decimal lPartMoney;
                if (ProjectPartMoney.TryGetValue(lProjectName, out lPartMoney))
                {
                    taxPayerEntity.PartMoney = lPartMoney;
                }

                decimal lTax;
                if (ProjectTax.TryGetValue(lProjectName, out lTax))
                {
                    taxPayerEntity.TotalTax = lTax;
                }

                DateTime lDateTime;
                if (ProjectStandBookDateTime.TryGetValue(lProjectName, out lDateTime))
                {
                    taxPayerEntity.FirstStandBookDateTime = lDateTime;
                }

                TaxPayerList.Add(taxPayerEntity);
            }
            UpdateChanged("TaxPayerList");
            IsBusy = false;
        }
        void SubOperationAddProject_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                submitOperation.MarkErrorAsHandled();
                NotifyWindow notifyWindow = new NotifyWindow("错误", "保存失败");
                notifyWindow.Show();
                if (addTaxPayerEntity != null)
                {
                    TaxPayerList.Remove(addTaxPayerEntity);
                    addTaxPayerEntity = null;
                }
                IsBusy = false;
            }
            else
            {
                addTaxPayerEntity.Update();
                AutoLinkDocumentFiles(addTaxPayerEntity, SelectTaxPayerEntity);
            }
        }
        void SubOperation_Completed(object sender, EventArgs e)
        {
            SubmitOperation submitOperation = sender as SubmitOperation;

            if (submitOperation.HasError)
            {
                submitOperation.MarkErrorAsHandled();
                NotifyWindow notifyWindow = new NotifyWindow("错误", "保存失败");
                notifyWindow.Show();
                if (addTaxPayerEntity != null)
                {
                    TaxPayerList.Remove(addTaxPayerEntity);
                    addTaxPayerEntity = null;
                }
            }
            else
            {
                NotifyWindow notifyWindow = new NotifyWindow("保存成功", "保存成功!");
                notifyWindow.Show();
                addTaxPayerEntity = null;
                LoadData();
            }
            IsBusy = false;
        }