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; } }
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; }