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 AutoLinkDocumentFiles(TaxPayerEntity aTaxPayerEntity, TaxPayerEntity aSourceTaxpayerEntity)
 {
     using (taxPayerDocumentView.DeferRefresh())
     {
         taxPayerDocumentView.MoveToFirstPage();
     }
 }
 public TaxPayerWindowJA(TaxPayerWindowType aTaxPayerWindowType
     , TaxPayerEntity aTaxPayerEntity
     , ObservableCollection<TaxPayerTypeEntity> aTaxPayerTypeEntityList
     , int aGroupID)
 {
     InitializeComponent();
     this.DataContext = new TaxPayerWindowViewModel(this, aTaxPayerWindowType, aTaxPayerEntity, aTaxPayerTypeEntityList, aGroupID);
 }
Esempio n. 5
0
 public TaxPayerWindowZP(TaxPayerWindowType aTaxPayerWindowType
                         , TaxPayerEntity aTaxPayerEntity
                         , ObservableCollection <TaxPayerTypeEntity> aTaxPayerTypeEntityList
                         , int aGroupID)
 {
     InitializeComponent();
     this.DataContext = new TaxPayerWindowViewModel(this, aTaxPayerWindowType, aTaxPayerEntity, aTaxPayerTypeEntityList, aGroupID);
 }
        private void onAddProject()
        {
            addTaxPayerEntity = new TaxPayerEntity();
            DocumentManager.Web.Model.taxpayer taxpayer = new DocumentManager.Web.Model.taxpayer();
            addTaxPayerEntity.TaxPayer = taxpayer;
            addTaxPayerEntity.Update();
            AddProjectWindow lAddProjectWindow = new AddProjectWindow(SelectTaxPayerEntity, addTaxPayerEntity);

            lAddProjectWindow.Closed += new EventHandler(AddProjectWindow_Closed);
            lAddProjectWindow.Show();
        }
 public AddMultiDocumentViewModel(ChildWindow aChildWindow
                                  , TaxPayerEntity aTaxPayerEntity
                                  , ObservableCollection <FileTypeEntity> aFileTypeList)
 {
     childWindow              = aChildWindow;
     taxPayerEntity           = aTaxPayerEntity;
     FileTypeEntityList       = aFileTypeList;
     MutiFileUpdateEntityList = new ObservableCollection <MultiFileUpdateEntity>();
     OnUpdate = new DelegateCommand(onUpdate, canUpdate);
     OnClose  = new DelegateCommand(onClose);
 }
 public AddMultiDocumentViewModel(ChildWindow aChildWindow
                                 , TaxPayerEntity aTaxPayerEntity
                                 , ObservableCollection<FileTypeEntity> aFileTypeList)
 {
     childWindow = aChildWindow;
     taxPayerEntity = aTaxPayerEntity;
     FileTypeEntityList = aFileTypeList;
     MutiFileUpdateEntityList = new ObservableCollection<MultiFileUpdateEntity>();
     OnUpdate = new DelegateCommand(onUpdate, canUpdate);
     OnClose = new DelegateCommand(onClose);
 }
        private void onAddTaxPayer()
        {
            addTaxPayerEntity = new TaxPayerEntity();
            DocumentManager.Web.Model.taxpayer taxpayer = new DocumentManager.Web.Model.taxpayer();
            addTaxPayerEntity.TaxPayer = taxpayer;
            addTaxPayerEntity.Update();
            TaxPayerWindow lTaxPayerWindow = new TaxPayerWindow(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);

            lTaxPayerWindow.Closed += AddTaxPayer_Closed;
            lTaxPayerWindow.Show();
        }
 private void LoadOperationTaxPayerCompleted(LoadOperation <DocumentManager.Web.Model.taxpayer> aLoadOperation)
 {
     TaxPayerEntityList.Clear();
     foreach (DocumentManager.Web.Model.taxpayer taxpayer in aLoadOperation.Entities)
     {
         TaxPayerEntity taxPayerEntity = new TaxPayerEntity();
         taxPayerEntity.TaxPayer = taxpayer;
         taxPayerEntity.Update();
         TaxPayerEntityList.Add(taxPayerEntity);
     }
     UpdateChanged("TaxPayerEntityList");
     IsBusy = false;
 }
 public AddSignalDocumentViewModel(ChildWindow aChildWindow
                                   , TaxPayerEntity aTaxPayerEntity
                                   , ObservableCollection<FileTypeEntity> aFileTypeList)
 {
     childWindow = aChildWindow;
     documentManagerContext = new Web.DocumentManagerDomainContext();
     taxPayerEntity = aTaxPayerEntity;
     FileTypeEntityList = aFileTypeList;
     ShowProgress = Visibility.Collapsed;
     ShowUpdate = Visibility.Visible;
     OnUpdate = new DelegateCommand(onUpdate, canUpdate);
     OnOpenFile = new DelegateCommand(onOpenFile);
     OnCancel = new DelegateCommand(onCancel);
 }
Esempio n. 12
0
 public AddSignalDocumentViewModel(ChildWindow aChildWindow
                                   , TaxPayerEntity aTaxPayerEntity
                                   , ObservableCollection <FileTypeEntity> aFileTypeList)
 {
     childWindow            = aChildWindow;
     documentManagerContext = new Web.DocumentManagerDomainContext();
     taxPayerEntity         = aTaxPayerEntity;
     FileTypeEntityList     = aFileTypeList;
     ShowProgress           = Visibility.Collapsed;
     ShowUpdate             = Visibility.Visible;
     OnUpdate   = new DelegateCommand(onUpdate, canUpdate);
     OnOpenFile = new DelegateCommand(onOpenFile);
     OnCancel   = new DelegateCommand(onCancel);
 }
Esempio n. 13
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;
        }
        private void onAddTaxPayer()
        {
            addTaxPayerEntity = new TaxPayerEntity();
            DocumentManager.Web.Model.taxpayer taxpayer = new DocumentManager.Web.Model.taxpayer();
            addTaxPayerEntity.TaxPayer = taxpayer;
            addTaxPayerEntity.Update();
            switch (GroupID)
            {
            case 0:
            {
                TaxPayerWindow lTaxPayerWindow = new TaxPayerWindow(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                lTaxPayerWindow.Show();
            }
            break;

            case 1:
            {
                TaxPayerWindowJA lTaxPayerWindow = new TaxPayerWindowJA(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                lTaxPayerWindow.Show();
            }
            break;

            case 2:
            {
                TaxPayerWindowPP lTaxPayerWindow = new TaxPayerWindowPP(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                lTaxPayerWindow.Show();
            }
            break;

            case 3:
            {
                TaxPayerWindowZP lTaxPayerWindow = new TaxPayerWindowZP(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                lTaxPayerWindow.Show();
            }
            break;
            }
            //TaxPayerWindow lTaxPayerWindow = new TaxPayerWindow(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
            //lTaxPayerWindow.Closed += AddTaxPayer_Closed;
            //lTaxPayerWindow.Show();
        }
Esempio n. 15
0
        private void loadOperationTaxPayer_Completed(object sender, EventArgs e)
        {
            TaxPayerEntityDirectory.Clear();

            LoadOperation loadOperation = sender as LoadOperation;

            foreach (Web.Model.taxpayer taxpayer in loadOperation.Entities)
            {
                TaxPayerEntity lTaxPayerEntity = new TaxPayerEntity();
                lTaxPayerEntity.TaxPayer = taxpayer;
                lTaxPayerEntity.Update();
                TaxPayerEntityDirectory.Add(lTaxPayerEntity.TaxPayerId, lTaxPayerEntity);
            }

            LoadOperation <DocumentManager.Web.Model.standbook> loadOperationStandBook =
                documentManagerContext.Load <DocumentManager.Web.Model.standbook>(documentManagerContext.GetStandBookQuery());

            loadOperationStandBook.Completed += loadOperationStandBook_Completed;
        }
        public TaxPayerWindowViewModel(ChildWindow aChildWindow
            , TaxPayerWindowType aTaxPayerWindowType
            , TaxPayerEntity aTaxPayerEntity
            , ObservableCollection<TaxPayerTypeEntity> aTaxPayerTypeEntityList
            , int aGroupID)
        {
            childWindow = aChildWindow;
            taxPayerWindowType = aTaxPayerWindowType;
            TaxPayerEntity = aTaxPayerEntity;
            TaxPayerTypeList = aTaxPayerTypeEntityList;
            GroupID = aGroupID;

            string lGroup = "";
            switch (GroupID)
            {
                case 0:
                    lGroup = "固定户";
                    break;
                case 1:
                    lGroup = "建安代开";
                    break;
                case 2:
                    lGroup = "普票代开";
                    break;
                case 3:
                    lGroup = "专票代开";
                    break;
            }

            if (taxPayerWindowType == TaxPayerWindowType.ADD)
            {
                Title = "添加纳税人(" + lGroup + ")";
            }
            else
            {
                Title = "修改纳税人(" + lGroup + ") 名称:" + TaxPayerEntity.TaxPayerName;
                SelectTaxPayerTypeEntity = TaxPayerEntity.TaxPayerTypeEntity;
            }

            OnOK = new DelegateCommand(onOK);
            OnCancel = new DelegateCommand(onCancel);
        }
        public AddProjectWindowViewModel(ChildWindow aChildWindow
                                         , TaxPayerEntity aOldTaxPayerEntity
                                         , TaxPayerEntity aNewTaxPayerEntity)
        {
            childWindow       = aChildWindow;
            OldTaxPayerEntity = aOldTaxPayerEntity;
            NewTaxPayerEntity = aNewTaxPayerEntity;

            NewTaxPayerEntity.TaxPayerCode          = "";
            NewTaxPayerEntity.TaxPayerName          = "";
            NewTaxPayerEntity.TaxPayerRegyear       = "";
            NewTaxPayerEntity.TaxPayerProject       = "";
            NewTaxPayerEntity.TaxPayerProjectFinish = false;
            NewTaxPayerEntity.TaxPayerFtk           = false;

            Title = "添加项目 纳税人:" + OldTaxPayerEntity.TaxPayerName;

            OnOK     = new DelegateCommand(onOK);
            OnCancel = new DelegateCommand(onCancel);
        }
        public AddProjectWindowViewModel(ChildWindow aChildWindow
            , TaxPayerEntity aOldTaxPayerEntity
            , TaxPayerEntity aNewTaxPayerEntity)
        {
            childWindow = aChildWindow;
            OldTaxPayerEntity = aOldTaxPayerEntity;
            NewTaxPayerEntity = aNewTaxPayerEntity;

            NewTaxPayerEntity.TaxPayerCode = "";
            NewTaxPayerEntity.TaxPayerName = "";
            NewTaxPayerEntity.TaxPayerRegyear = "";
            NewTaxPayerEntity.TaxPayerProject = "";
            NewTaxPayerEntity.TaxPayerProjectFinish = false;
            NewTaxPayerEntity.TaxPayerFtk = false;

            Title = "添加项目 纳税人:" + OldTaxPayerEntity.TaxPayerName;

            OnOK = new DelegateCommand(onOK);
            OnCancel = new DelegateCommand(onCancel);
        }
        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;
        }
Esempio n. 21
0
 public MergeImages(TaxPayerEntity aTaxPayerEntity
                    , ObservableCollection <FileTypeEntity> aFileTypeList)
 {
     InitializeComponent();
     this.DataContext = new MergeImagesViewModel(this, aTaxPayerEntity, aFileTypeList);
 }
Esempio n. 22
0
 public AddProjectWindow(TaxPayerEntity aTaxPayerEntity, TaxPayerEntity aNewTaxPayerEntity)
 {
     InitializeComponent();
     this.DataContext = new AddProjectWindowViewModel(this, aTaxPayerEntity, aNewTaxPayerEntity);
 }
 public AddProjectWindow(TaxPayerEntity aTaxPayerEntity, TaxPayerEntity aNewTaxPayerEntity)
 {
     InitializeComponent();
     this.DataContext = new AddProjectWindowViewModel(this, aTaxPayerEntity, aNewTaxPayerEntity);
 }
        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;
        }
        private void onAddTaxPayer()
        {
            addTaxPayerEntity = new TaxPayerEntity();
            DocumentManager.Web.Model.taxpayer taxpayer = new DocumentManager.Web.Model.taxpayer();
            addTaxPayerEntity.TaxPayer = taxpayer;
            addTaxPayerEntity.Update();
            switch (GroupID)
            {
                case 0:
                    {
                        TaxPayerWindow lTaxPayerWindow = new TaxPayerWindow(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                        lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                        lTaxPayerWindow.Show();
                    }
                    break;
                case 1:
                    {
                        TaxPayerWindowJA lTaxPayerWindow = new TaxPayerWindowJA(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                        lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                        lTaxPayerWindow.Show();
                    }
                    break;
                case 2:
                    {
                        TaxPayerWindowPP lTaxPayerWindow = new TaxPayerWindowPP(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                        lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                        lTaxPayerWindow.Show();
                    }
                    break;
                case 3:
                    {
                        TaxPayerWindowZP lTaxPayerWindow = new TaxPayerWindowZP(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
                        lTaxPayerWindow.Closed += AddTaxPayer_Closed;
                        lTaxPayerWindow.Show();
                    }
                    break;

            }
            //TaxPayerWindow lTaxPayerWindow = new TaxPayerWindow(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
            //lTaxPayerWindow.Closed += AddTaxPayer_Closed;
            //lTaxPayerWindow.Show();
        }
        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();
        }
Esempio n. 27
0
        private bool CheckVaild()
        {
            bool isSuccess = true;

            // check the number
            string          lStandBookID = StandBookEntity.StandBookID;
            StandBookEntity lStandBookEntity;

            if (StandBookEntityDirectory.TryGetValue(lStandBookID, out lStandBookEntity))
            {
                StandBookEntity.ErrorText += "此受理流水号已经导入,请检查是否受理流水号重复!";
                isSuccess = false;
            }

            // check the project
            TaxPayerEntity lCurrentTaxPayerEntity = null;
            string         lProjectName           = StandBookEntity.ProjectName;

            {
                bool lHasProject = false;

                foreach (TaxPayerEntity lTaxPayerEntity in  TaxPayerEntityDirectory.Values)
                {
                    if (lTaxPayerEntity.TaxPayerProject == lProjectName)
                    {
                        lHasProject            = true;
                        lCurrentTaxPayerEntity = lTaxPayerEntity;
                        currentTaxPayerEntity  = lCurrentTaxPayerEntity;
                    }

                    /*
                     * string lTempProjectName = lTaxPayerEntity.TaxPayerProject;
                     *
                     * byte[] byteArray1 = System.Text.Encoding.UTF8.GetBytes(lTempProjectName);
                     * byte[] temp1 = System.Text.Encoding.Convert(System.Text.Encoding.UTF8, System.Text.Encoding.BigEndianUnicode, byteArray1);
                     * byte[] byteArray2 = System.Text.Encoding.UTF8.GetBytes(lProjectName);
                     * byte[] temp2 = System.Text.Encoding.Convert(System.Text.Encoding.UTF8, System.Text.Encoding.BigEndianUnicode, byteArray2);
                     *
                     * if (temp1.Length != temp2.Length)
                     * {
                     *  continue;
                     * }
                     *
                     * bool isEqu = true;
                     * for (int i = 2; i < temp1.Length; i++)
                     * {
                     *  if (temp1[i] != temp2[i])
                     *  {
                     *      isEqu = false;
                     *      break;
                     *  }
                     * }
                     *
                     * if (isEqu)
                     * {
                     *  lHasProject = true;
                     *  lCurrentTaxPayerEntity = lTaxPayerEntity;
                     *  currentTaxPayerEntity = lCurrentTaxPayerEntity;
                     *  break;
                     * }
                     */
                }

                if (!lHasProject)
                {
                    StandBookEntity.ErrorText += "该项目在系统纳税人信息中不存在,请先添加纳税人信息!";
                    isSuccess = false;
                }
                else
                {
                    if (lCurrentTaxPayerEntity != null && lCurrentTaxPayerEntity.TaxPayerName != StandBookEntity.TaxPayerName)
                    {
                        StandBookEntity.ErrorText += "该项目在系统纳税人信息, 项目与纳税人信息不匹配,请检查!";
                        isSuccess = false;
                    }
                }
            }

            // Check Old StandBook Info
            {
                foreach (StandBookEntity lStandBookEntityEm in StandBookEntityDirectory.Values)
                {
                    if (lStandBookEntityEm.ProjectName == StandBookEntity.ProjectName)
                    {
                        decimal lOldTotalMoney = lStandBookEntityEm.TotalMoney.GetValueOrDefault(0);
                        decimal lNewTotalMoney = StandBookEntity.TotalMoney.GetValueOrDefault(0);

                        if (lOldTotalMoney != lNewTotalMoney)
                        {
                            StandBookEntity.ErrorText += "该项目与以前导入金额不一致,请检查!";
                            isSuccess = false;
                        }
                    }
                }
            }

            if (isSuccess)
            {
                StandBookEntity.SuccessText = "可以导入!";
                StandBookEntity.ShowError   = Visibility.Collapsed;
                StandBookEntity.ShowSuccess = Visibility.Visible;
            }
            else
            {
                StandBookEntity.ShowError   = Visibility.Visible;
                StandBookEntity.ShowSuccess = Visibility.Collapsed;
            }

            return(isSuccess);
        }
 public AddMultiDocument(TaxPayerEntity aTaxPayerEntity
                         , ObservableCollection <FileTypeEntity> aFileTypeList)
 {
     InitializeComponent();
     this.DataContext = new AddMultiDocumentViewModel(this, aTaxPayerEntity, aFileTypeList);
 }
Esempio n. 29
0
        private void loadOperation_Completed(LoadOperation <DocumentManager.Web.Model.taxpayer> sender)
        {
            IsBusy = false;
            taxPayerSource.Source = sender.Entities;
            int lTotal   = 0;
            int lJATotal = 0;
            int lPPTotal = 0;
            int lZPTotal = 0;
            int lGDTotal = 0;

            foreach (DocumentManager.Web.Model.taxpayer taxpayer in sender.Entities)
            {
                TaxPayerEntity taxPayerEntity = new TaxPayerEntity();
                taxPayerEntity.TaxPayer = taxpayer;
                taxPayerEntity.Update();

                switch (taxPayerEntity.TaxPayerGroupId.GetValueOrDefault(-1))
                {
                case 0:
                {
                    TaxPayerEntity taxPayerEntitytemp;
                    if (!GDTaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                    {
                        GDTaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                    }
                }
                break;

                case 1:
                {
                    TaxPayerEntity taxPayerEntitytemp;
                    if (!JATaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                    {
                        JATaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                    }
                }
                break;

                case 2:
                {
                    TaxPayerEntity taxPayerEntitytemp;
                    if (!PPTaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                    {
                        PPTaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                    }
                }
                break;

                case 3:
                {
                    TaxPayerEntity taxPayerEntitytemp;
                    if (!ZPTaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                    {
                        ZPTaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                    }
                }
                break;
                }
            }

            DocumentTotal = "总户数 : " + (ZPTaxPayerEntity.Count + GDTaxPayerEntity.Count + JATaxPayerEntity.Count + PPTaxPayerEntity.Count).ToString();

            TaxPayerCalEntity lJATotalEntity = new TaxPayerCalEntity();

            lJATotalEntity.Key   = "建安代开";
            lJATotalEntity.Value = JATaxPayerEntity.Count;
            TaxPayerTotal.Add(lJATotalEntity);
            TaxPayerCalEntity lPPTotalEntity = new TaxPayerCalEntity();

            lPPTotalEntity.Key   = "普票代开";
            lPPTotalEntity.Value = PPTaxPayerEntity.Count;
            TaxPayerTotal.Add(lPPTotalEntity);
            TaxPayerCalEntity lZPTotalEntity = new TaxPayerCalEntity();

            lZPTotalEntity.Key   = "专票代开";
            lZPTotalEntity.Value = ZPTaxPayerEntity.Count;
            TaxPayerTotal.Add(lZPTotalEntity);
            TaxPayerCalEntity lGDTotalEntity = new TaxPayerCalEntity();

            lGDTotalEntity.Key   = "固定户";
            lGDTotalEntity.Value = GDTaxPayerEntity.Count;
            TaxPayerTotal.Add(lGDTotalEntity);

            int lZZFree  = 0;
            int lZZOther = 0;
            int lYYFree  = 0;
            int lYYOther = 0;

            foreach (TaxPayerEntity lTaxPayerEntity in GDTaxPayerEntity.Values)
            {
                if ("增值税纳税户" == lTaxPayerEntity.TaxPayerProject)
                {
                    if (lTaxPayerEntity.TaxPayerIsFree.HasValue && lTaxPayerEntity.TaxPayerIsFree.Value)
                    {
                        lZZFree++;
                    }
                    else
                    {
                        lZZOther++;
                    }
                }

                if ("营业税纳税户" == lTaxPayerEntity.TaxPayerProject)
                {
                    if (lTaxPayerEntity.TaxPayerIsFree.HasValue && lTaxPayerEntity.TaxPayerIsFree.Value)
                    {
                        lYYFree++;
                    }
                    else
                    {
                        lYYOther++;
                    }
                }
            }

            TaxPayerCalEntity lZZFreeTotalEntity = new TaxPayerCalEntity();

            lZZFreeTotalEntity.Key   = "增值免税户";
            lZZFreeTotalEntity.Value = lZZFree;
            TaxPayerZZTax.Add(lZZFreeTotalEntity);
            TaxPayerCalEntity lZZOtherTotalEntity = new TaxPayerCalEntity();

            lZZOtherTotalEntity.Key   = "增值纳税户";
            lZZOtherTotalEntity.Value = lZZOther;
            TaxPayerZZTax.Add(lPPTotalEntity);

            TaxPayerCalEntity lYYFreeTotalEntity = new TaxPayerCalEntity();

            lYYFreeTotalEntity.Key   = "营业免税户";
            lYYFreeTotalEntity.Value = lYYFree;
            TaxPayerYYTax.Add(lYYFreeTotalEntity);
            TaxPayerCalEntity lYYOtherTotalEntity = new TaxPayerCalEntity();

            lYYOtherTotalEntity.Key   = "营业纳税户";
            lYYOtherTotalEntity.Value = lYYOther;
            TaxPayerYYTax.Add(lYYOtherTotalEntity);



            UpdateChanged("TaxPayerTotal");
            UpdateChanged("DocumentTotal");
            UpdateChanged("TaxPayerZZTax");
            UpdateChanged("TaxPayerYYTax");
            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();

                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;
        }
        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)
        {
            IsBusy = false;
            taxPayerSource.Source = sender.Entities;
            int lTotal = 0;
            int lJATotal = 0;
            int lPPTotal = 0;
            int lZPTotal = 0;
            int lGDTotal = 0;

            foreach (DocumentManager.Web.Model.taxpayer taxpayer in sender.Entities)
            {
                TaxPayerEntity taxPayerEntity = new TaxPayerEntity();
                taxPayerEntity.TaxPayer = taxpayer;
                taxPayerEntity.Update();

                switch (taxPayerEntity.TaxPayerGroupId.GetValueOrDefault(-1))
                {
                    case 0:
                        {
                            TaxPayerEntity taxPayerEntitytemp;
                            if (!GDTaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                            {
                                GDTaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                            }
                        }
                        break;
                    case 1:
                        {
                            TaxPayerEntity taxPayerEntitytemp;
                            if(!JATaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                            {
                                JATaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                            }
                        }
                        break;
                    case 2:
                        {
                            TaxPayerEntity taxPayerEntitytemp;
                            if (!PPTaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                            {
                                PPTaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                            }
                        }
                        break;
                    case 3:
                        {
                            TaxPayerEntity taxPayerEntitytemp;
                            if (!ZPTaxPayerEntity.TryGetValue(taxPayerEntity.TaxPayerName, out taxPayerEntitytemp))
                            {
                                ZPTaxPayerEntity.Add(taxPayerEntity.TaxPayerName, taxPayerEntity);
                            }
                        }
                        break;
                }
            }

            DocumentTotal = "总户数 : " + (ZPTaxPayerEntity.Count + GDTaxPayerEntity.Count + JATaxPayerEntity.Count + PPTaxPayerEntity.Count).ToString();

            TaxPayerCalEntity lJATotalEntity = new TaxPayerCalEntity();
            lJATotalEntity.Key = "建安代开";
            lJATotalEntity.Value = JATaxPayerEntity.Count;
            TaxPayerTotal.Add(lJATotalEntity);
            TaxPayerCalEntity lPPTotalEntity = new TaxPayerCalEntity();
            lPPTotalEntity.Key = "普票代开";
            lPPTotalEntity.Value = PPTaxPayerEntity.Count;
            TaxPayerTotal.Add(lPPTotalEntity);
            TaxPayerCalEntity lZPTotalEntity = new TaxPayerCalEntity();
            lZPTotalEntity.Key = "专票代开";
            lZPTotalEntity.Value = ZPTaxPayerEntity.Count;
            TaxPayerTotal.Add(lZPTotalEntity);
            TaxPayerCalEntity lGDTotalEntity = new TaxPayerCalEntity();
            lGDTotalEntity.Key = "固定户";
            lGDTotalEntity.Value = GDTaxPayerEntity.Count;
            TaxPayerTotal.Add(lGDTotalEntity);

            int lZZFree = 0;
            int lZZOther = 0;
            int lYYFree = 0;
            int lYYOther = 0;

            foreach (TaxPayerEntity lTaxPayerEntity in GDTaxPayerEntity.Values)
            {
                if ("增值税纳税户" == lTaxPayerEntity.TaxPayerProject)
                {
                    if (lTaxPayerEntity.TaxPayerIsFree.HasValue && lTaxPayerEntity.TaxPayerIsFree.Value)
                    {
                        lZZFree++;
                    }
                    else
                    {
                        lZZOther++;
                    }
                }

                if ("营业税纳税户" == lTaxPayerEntity.TaxPayerProject)
                {
                    if (lTaxPayerEntity.TaxPayerIsFree.HasValue && lTaxPayerEntity.TaxPayerIsFree.Value)
                    {
                        lYYFree++;
                    }
                    else
                    {
                        lYYOther++;
                    }
                }
            }

            TaxPayerCalEntity lZZFreeTotalEntity = new TaxPayerCalEntity();
            lZZFreeTotalEntity.Key = "增值免税户";
            lZZFreeTotalEntity.Value = lZZFree;
            TaxPayerZZTax.Add(lZZFreeTotalEntity);
            TaxPayerCalEntity lZZOtherTotalEntity = new TaxPayerCalEntity();
            lZZOtherTotalEntity.Key = "增值纳税户";
            lZZOtherTotalEntity.Value = lZZOther;
            TaxPayerZZTax.Add(lPPTotalEntity);

            TaxPayerCalEntity lYYFreeTotalEntity = new TaxPayerCalEntity();
            lYYFreeTotalEntity.Key = "营业免税户";
            lYYFreeTotalEntity.Value = lYYFree;
            TaxPayerYYTax.Add(lYYFreeTotalEntity);
            TaxPayerCalEntity lYYOtherTotalEntity = new TaxPayerCalEntity();
            lYYOtherTotalEntity.Key = "营业纳税户";
            lYYOtherTotalEntity.Value = lYYOther;
            TaxPayerYYTax.Add(lYYOtherTotalEntity);

            UpdateChanged("TaxPayerTotal");
            UpdateChanged("DocumentTotal");
            UpdateChanged("TaxPayerZZTax");
            UpdateChanged("TaxPayerYYTax");
            IsBusy = false;
        }
 private void AutoLinkDocumentFiles(TaxPayerEntity aTaxPayerEntity, TaxPayerEntity aSourceTaxpayerEntity)
 {
     using (taxPayerDocumentView.DeferRefresh())
     {
         taxPayerDocumentView.MoveToFirstPage();
     }
 }
 public AddMultiDocument(TaxPayerEntity aTaxPayerEntity
                         , ObservableCollection<FileTypeEntity> aFileTypeList)
 {
     InitializeComponent();
     this.DataContext = new AddMultiDocumentViewModel(this, aTaxPayerEntity, aFileTypeList);
 }
 private void onAddProject()
 {
     addTaxPayerEntity = new TaxPayerEntity();
     DocumentManager.Web.Model.taxpayer taxpayer = new DocumentManager.Web.Model.taxpayer();
     addTaxPayerEntity.TaxPayer = taxpayer;
     addTaxPayerEntity.Update();
     AddProjectWindow lAddProjectWindow = new AddProjectWindow(SelectTaxPayerEntity, addTaxPayerEntity);
     lAddProjectWindow.Closed += new EventHandler(AddProjectWindow_Closed);
     lAddProjectWindow.Show();
 }
 private void LoadOperationTaxPayerCompleted(LoadOperation<DocumentManager.Web.Model.taxpayer> aLoadOperation)
 {
     TaxPayerEntityList.Clear();
     foreach (DocumentManager.Web.Model.taxpayer taxpayer in aLoadOperation.Entities)
     {
         TaxPayerEntity taxPayerEntity = new TaxPayerEntity();
         taxPayerEntity.TaxPayer = taxpayer;
         taxPayerEntity.Update();
         TaxPayerEntityList.Add(taxPayerEntity);
     }
     UpdateChanged("TaxPayerEntityList");
     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);
            }
        }
        private bool CheckVaild()
        {
            bool isSuccess = true;

            // check the number
            string lStandBookID = StandBookEntity.StandBookID;
            StandBookEntity lStandBookEntity;
            if (StandBookEntityDirectory.TryGetValue(lStandBookID, out lStandBookEntity))
            {
                StandBookEntity.ErrorText += "此受理流水号已经导入,请检查是否受理流水号重复!";
                isSuccess = false;
            }

            // check the project
            TaxPayerEntity lCurrentTaxPayerEntity = null;
            string lProjectName = StandBookEntity.ProjectName;
            {
                bool lHasProject = false;

                foreach (TaxPayerEntity lTaxPayerEntity in  TaxPayerEntityDirectory.Values)
                {
                    if (lTaxPayerEntity.TaxPayerProject == lProjectName)
                    {
                        lHasProject = true;
                        lCurrentTaxPayerEntity = lTaxPayerEntity;
                        currentTaxPayerEntity = lCurrentTaxPayerEntity;
                    }
                    /*
                    string lTempProjectName = lTaxPayerEntity.TaxPayerProject;

                    byte[] byteArray1 = System.Text.Encoding.UTF8.GetBytes(lTempProjectName);
                    byte[] temp1 = System.Text.Encoding.Convert(System.Text.Encoding.UTF8, System.Text.Encoding.BigEndianUnicode, byteArray1);
                    byte[] byteArray2 = System.Text.Encoding.UTF8.GetBytes(lProjectName);
                    byte[] temp2 = System.Text.Encoding.Convert(System.Text.Encoding.UTF8, System.Text.Encoding.BigEndianUnicode, byteArray2);

                    if (temp1.Length != temp2.Length)
                    {
                        continue;
                    }

                    bool isEqu = true;
                    for (int i = 2; i < temp1.Length; i++)
                    {
                        if (temp1[i] != temp2[i])
                        {
                            isEqu = false;
                            break;
                        }
                    }

                    if (isEqu)
                    {
                        lHasProject = true;
                        lCurrentTaxPayerEntity = lTaxPayerEntity;
                        currentTaxPayerEntity = lCurrentTaxPayerEntity;
                        break;
                    }
                    */
                }

                if (!lHasProject)
                {
                    StandBookEntity.ErrorText += "该项目在系统纳税人信息中不存在,请先添加纳税人信息!";
                    isSuccess = false;
                }
                else
                {
                    if (lCurrentTaxPayerEntity != null && lCurrentTaxPayerEntity.TaxPayerName != StandBookEntity.TaxPayerName)
                    {
                        StandBookEntity.ErrorText += "该项目在系统纳税人信息, 项目与纳税人信息不匹配,请检查!";
                        isSuccess = false;
                    }
                }
            }

            // Check Old StandBook Info
            /*{
                foreach (StandBookEntity lStandBookEntityEm in StandBookEntityDirectory.Values)
                {
                    if (lStandBookEntityEm.ProjectName == StandBookEntity.ProjectName)
                    {
                        decimal lOldTotalMoney = lStandBookEntityEm.TotalMoney.GetValueOrDefault(0);
                        decimal lNewTotalMoney = StandBookEntity.TotalMoney.GetValueOrDefault(0);

                        if (lOldTotalMoney != lNewTotalMoney)
                        {
                            StandBookEntity.ErrorText += "该项目与以前导入金额不一致,请检查!";
                            isSuccess = false;
                        }
                    }
                }
            }
             */

            if (isSuccess)
            {
                StandBookEntity.SuccessText = "可以导入!";
                StandBookEntity.ShowError = Visibility.Collapsed;
                StandBookEntity.ShowSuccess = Visibility.Visible;
            }
            else
            {
                StandBookEntity.ShowError = Visibility.Visible;
                StandBookEntity.ShowSuccess = Visibility.Collapsed;
            }

            return isSuccess;
        }
 private void onAddTaxPayer()
 {
     addTaxPayerEntity = new TaxPayerEntity();
     DocumentManager.Web.Model.taxpayer taxpayer = new DocumentManager.Web.Model.taxpayer();
     addTaxPayerEntity.TaxPayer = taxpayer;
     addTaxPayerEntity.Update();
     TaxPayerWindow lTaxPayerWindow = new TaxPayerWindow(TaxPayerWindowType.ADD, addTaxPayerEntity, TaxPayerTypeList, GroupID);
     lTaxPayerWindow.Closed += AddTaxPayer_Closed;
     lTaxPayerWindow.Show();
 }
        private void loadOperationTaxPayer_Completed(object sender, EventArgs e)
        {
            TaxPayerEntityDirectory.Clear();

            LoadOperation loadOperation = sender as LoadOperation;
            foreach (Web.Model.taxpayer taxpayer in loadOperation.Entities)
            {
                TaxPayerEntity lTaxPayerEntity = new TaxPayerEntity();
                lTaxPayerEntity.TaxPayer = taxpayer;
                lTaxPayerEntity.Update();
                if (lTaxPayerEntity.TaxPayerGroupId == 3)
                {
                    TaxPayerEntityDirectory.Add(lTaxPayerEntity.TaxPayerId, lTaxPayerEntity);
                }
            }

            LoadOperation<DocumentManager.Web.Model.standbook> loadOperationStandBook =
                documentManagerContext.Load<DocumentManager.Web.Model.standbook>(documentManagerContext.GetStandBookQuery());
            loadOperationStandBook.Completed += loadOperationStandBook_Completed;
        }