Beispiel #1
0
        private void UserFile_FinishUpdates(object sender, EventArgs e)
        {
            ShowProgress = Visibility.Collapsed;
            taxPayerDocumentEntity.TaxPayerDocumentName     = UserFile.FileName;
            taxPayerDocumentEntity.TaxPayerDocumentTypeId   = SelectFileTypeEntity.FileTypeId;
            taxPayerDocumentEntity.TaxPayerId               = currentTaxPayerEntity.TaxPayerId;
            taxPayerDocumentEntity.TaxPayerDocumentDescript = "";
            taxPayerDocumentEntity.TaxPayerUpdateTime       = DateTime.Now;
            App app = Application.Current as App;

            taxPayerDocumentEntity.TaxPayerUpdateUserId = app.MainPageViewModel.User.UserID;
            taxPayerDocumentEntity.TaxPayerDocument     = new Web.Model.taxpayerdocument();
            taxPayerDocumentEntity.DUpdate();

            documentManagerContext.taxpayerdocuments.Add(taxPayerDocumentEntity.TaxPayerDocument);
            Log.AddLog(documentManagerContext, taxPayerDocumentEntity.ToString());

            StandBookEntity.GroupID = 1;

            StandBookEntity.StandBook = new Web.Model.standbook();
            StandBookEntity.DUpdate();
            documentManagerContext.standbooks.Add(StandBookEntity.StandBook);
            Log.AddLog(documentManagerContext, StandBookEntity.ToString());

            SubmitOperation lSubmitOperation = documentManagerContext.SubmitChanges();

            lSubmitOperation.Completed += SubOperation_Completed;
        }
        private void loadOperation_Completed(LoadOperation <DocumentManager.Web.Model.standbook> sender)
        {
            StandBookList.Clear();
            standBookSource.Source = sender.Entities;
            foreach (DocumentManager.Web.Model.standbook standBook in sender.Entities)
            {
                StandBookEntity standBookEntity = new StandBookEntity();
                standBookEntity.StandBook = standBook;
                standBookEntity.Update();

                /*
                 * string lProjectName = taxPayerEntity.TaxPayerProject;
                 *
                 * decimal lTotalMoney;
                 * if (ProjectTotalMonay.TryGetValue(lProjectName, out lTotalMoney))
                 * {
                 *  taxPayerEntity.TotalMoney = lTotalMoney;
                 * }
                 *
                 * decimal lPartMoney;
                 * if (ProjectPartMoney.TryGetValue(lProjectName, out lPartMoney))
                 * {
                 *  taxPayerEntity.PartMoney = lPartMoney;
                 * }
                 */
                StandBookList.Add(standBookEntity);
            }
            UpdateChanged("StandBookList");
            IsBusy = false;
        }
Beispiel #3
0
        private void loadOperationStandBook_Completed(object sender, EventArgs e)
        {
            StandBookEntityDirectory.Clear();

            LoadOperation loadOperation = sender as LoadOperation;

            foreach (Web.Model.standbook standbook in loadOperation.Entities)
            {
                StandBookEntity lStandBookEntity = new StandBookEntity();
                lStandBookEntity.StandBook = standbook;
                lStandBookEntity.Update();
                StandBookEntityDirectory.Add(lStandBookEntity.StandBookID, lStandBookEntity);
            }

            IsBusy = false;
        }
        private void loadOperationStandBook_Completed(object sender, EventArgs e)
        {
            ProjectTotalMonay.Clear();
            ProjectPartMoney.Clear();

            LoadOperation loadOperation = sender as LoadOperation;

            foreach (Web.Model.standbook standbook in loadOperation.Entities)
            {
                StandBookEntity lStandBookEntity = new StandBookEntity();
                lStandBookEntity.StandBook = standbook;
                lStandBookEntity.Update();

                string lProjectName = lStandBookEntity.ProjectName;

                decimal lTotalMoney;
                if (!ProjectTotalMonay.TryGetValue(lProjectName, out lTotalMoney))
                {
                    ProjectTotalMonay.Add(lProjectName, lStandBookEntity.TotalMoney.GetValueOrDefault(0));
                }

                decimal lPartMoney;
                if (ProjectPartMoney.TryGetValue(lProjectName, out lPartMoney))
                {
                    ProjectPartMoney[lProjectName] += lStandBookEntity.ThisPartMoney.GetValueOrDefault(0);
                }
                else
                {
                    ProjectPartMoney.Add(lProjectName, lStandBookEntity.ThisPartMoney.GetValueOrDefault(0));
                }


                //TaxPayerTypeEntityDictionary.Add(lTaxPayerTypeEntity.TaxPayerTypeId, lTaxPayerTypeEntity);
            }

            standBookSource = new EntityList <Web.Model.standbook>(documentManagerContext.standbooks);
            standBookLoader = new DomainCollectionViewLoader <Web.Model.standbook>(
                LoadStandBookEntities,
                loadOperation_Completed);
            standBookView = new DomainCollectionView <Web.Model.standbook>(standBookLoader, standBookSource);


            using (this.standBookView.DeferRefresh())
            {
                this.standBookView.MoveToFirstPage();
            }
        }
Beispiel #5
0
        public InputStandBookJAViewModel(ChildWindow aChildWindow)
        {
            IsBusy = false;
            TaxPayerEntityDirectory  = new Dictionary <int, TaxPayerEntity>();
            StandBookEntityDirectory = new Dictionary <string, StandBookEntity>();
            FileTypeEntityList       = new ObservableCollection <FileTypeEntity>();

            childWindow = aChildWindow;

            OnOpenStandBookFile = new DelegateCommand(onOpenStandBookFile);
            OnOK     = new DelegateCommand(onOK, canOK);
            OnCancel = new DelegateCommand(onCancel);

            StandBookEntity = new StandBookEntity();
            HasShowTemp     = Visibility.Collapsed;
            ShowProgress    = Visibility.Collapsed;
            ShowUpdate      = Visibility.Visible;

            documentManagerContext = new Web.DocumentManagerDomainContext();
            CanInput = false;
            LoadData();
        }
Beispiel #6
0
        private void LoadStandBook_Complete(LoadOperation <Web.Model.standbook> sender)
        {
            StandBookEntityList.Clear();
            standbookSource.Source = sender.Entities;
            foreach (DocumentManager.Web.Model.standbook standbook in sender.Entities)
            {
                StandBookEntity standBookEntity = new StandBookEntity();
                standBookEntity.StandBook = standbook;
                standBookEntity.Update();
                StandBookEntityList.Add(standBookEntity);
            }

            if (StandBookEntityList.Count > 0)
            {
                FirstStandBookEntity = StandBookEntityList[0];
            }
            else
            {
                FirstStandBookEntity = null;
            }
            UpdateChanged("FirstStandBookEntity");
            UpdateChanged("StandBookEntityList");
            FinishLoadings(null, null);
        }