示例#1
0
        private void SetUpData()
        {
            try
            {
                ListMovimenti = new RegistryMovementTypeList();
                ListGestioni  = new RegistryOwnersList();
                ListConti     = new RegistryLocationList();
                ListValute    = new RegistryCurrencyList();
                TipoSoldis    = new TipoSoldiList();
                RegistryMovementTypeList listaOriginale = new RegistryMovementTypeList();
                listaOriginale = _registryServices.GetRegistryMovementTypesList();
                var RMTL = from movimento in listaOriginale
                           where (movimento.Id_tipo_movimento == (int)TipologiaMovimento.Cedola ||
                                  movimento.Id_tipo_movimento == (int)TipologiaMovimento.InsertVolatili ||
                                  movimento.Id_tipo_movimento == (int)TipologiaMovimento.Giroconto) ||
                           movimento.Id_tipo_movimento == (int)TipologiaMovimento.Costi ||
                           movimento.Id_tipo_movimento == (int)TipologiaMovimento.CambioValuta ||
                           movimento.Id_tipo_movimento == (int)TipologiaMovimento.AcquistoTitoli ||
                           movimento.Id_tipo_movimento == (int)TipologiaMovimento.VenditaTitoli
                           select movimento;
                foreach (RegistryMovementType registry in RMTL)
                {
                    ListMovimenti.Add(registry);
                }
                ListValute = _registryServices.GetRegistryCurrencyList();
                RegistryOwnersList ListaInvestitoreOriginale = new RegistryOwnersList();
                ListaInvestitoreOriginale = _registryServices.GetGestioneList();
                var ROL = from gestione in ListaInvestitoreOriginale
                          where (gestione.Tipologia == "Gestore")
                          select gestione;
                _TabControl.TabStripPlacement = Dock.Left;
                foreach (RegistryOwner registryOwner in ROL)
                {
                    // per ogni gestione acquisisco is dati per la sintesi soldi
                    TabItem tabItem = new TabItem();
                    tabItem.Header  = registryOwner.Nome_Gestione;
                    tabItem.Content = new TabControlSintesiView(new TabControlSintesiViewModel(_liquidAssetServices.GetCurrencyAvailable(registryOwner.Id_gestione)));
                    _TabControl.Items.Add(tabItem);
                    ListGestioni.Add(registryOwner);
                }
                ListConti  = _registryServices.GetRegistryLocationList();
                TipoSoldis = _registryServices.GetTipoSoldiList();
                SharesList = new ObservableCollection <RegistryShare>(_registryServices.GetRegistryShareList());
                _Filter    = new Predicate <object>(Filter);

                BirdsListView = _registryServices.GetSharesByFirms(typeOfShares);
            }
            catch (Exception err)
            {
                throw new Exception("Errore nel setup." + Environment.NewLine + err.Message);
            }
        }
 /// <summary>
 /// E' l'evento di edit nella cella di descrizione della gestione
 /// se il modello ha un valore di id vuol dire che è in modifica
 /// se il valore è zero vuol dire che è un inserimento di nuova gestione
 /// </summary>
 /// <param name="sender">la cella di descrizione</param>
 /// <param name="e">la conferma o meno della modifica</param>
 public void CellChanged(object sender, DataGridCellEditEndingEventArgs e)
 {
     try
     {
         if (e.EditAction == DataGridEditAction.Commit)
         {
             Owner = ((RegistryOwner)e.Row.Item);
             if (Owner.Id_gestione > 0)
             {
                 _services.UpdateGestioneName(Owner);
             }
             else
             {
                 _services.AddGestione(Owner.Nome_Gestione, Owner.Tipologia);
                 OwnerList = new ObservableCollection <RegistryOwner>(_services.GetGestioneList());
             }
         }
     }
     catch (Exception err)
     {
         MessageBox.Show("Errore nell'aggiornamento dei dati: " + err.Message);
     }
 }
 /// <summary>
 /// costruttore
 /// </summary>
 /// <param name="services">la gestione dei dati verso il database</param>
 public RegistryOwnerViewModel(IRegistryServices services)
 {
     _services = services ?? throw new ArgumentNullException("RegistryOwnerViewModel With No Services");
     try
     {
         OwnerList = new ObservableCollection <RegistryOwner>(services.GetGestioneList());
         OwnerList.CollectionChanged += CollectionHasChanged;
     }
     catch (Exception err)
     {
         MessageBox.Show("Errore nella richiesta dei dati." + Environment.NewLine + err.Message, "DAF-C Lista Gestioni");
     }
     CloseMeCommand = new CommandHandler(CloseMe);
 }
示例#4
0
        private void SetUpViewModel()
        {
            try
            {
                OwnerList      = new RegistryOwnersList();
                CurrenciesList = _services.GetRegistryCurrencyList();

                RegistryOwnersList ListaOriginale = new RegistryOwnersList();
                ListaOriginale = _services.GetGestioneList();
                var LO = from risultato in ListaOriginale
                         where risultato.Tipologia == "Gestore"
                         select risultato;
                foreach (RegistryOwner registryOwner in LO)
                {
                    OwnerList.Add(registryOwner);
                }

                AccountList         = _services.GetRegistryLocationList();
                _selectedOwners     = new List <RegistryOwner>();
                _selectedAccount    = new List <RegistryLocation>();
                AvailableYears      = _reportServices.GetAvailableYears();
                SelectedYears       = new List <int>();
                SharesList          = new ObservableCollection <RegistryShare>(_services.GetRegistryShareList());
                _Filter             = new Predicate <object>(Filter);
                ReportSelezionato   = "";
                TitoloSelezionato   = 0;
                CanClear            = false;
                CanExport           = false;
                AttivaContoCorrente = false;
                AttivaGestioni      = false;
                YearsIsEnable       = false;
            }
            catch (Exception err)
            {
                MessageBox.Show("Errore nella richiesta dei dati." + Environment.NewLine + err.Message, "DAF-C Gestione Report");
            }
        }
示例#5
0
        private void Init()
        {
            #region start command
            CloseMeCommand     = new CommandHandler(CloseMe);
            InsertCommand      = new CommandHandler(SaveCommand, CanSave);
            ModifyCommand      = new CommandHandler(UpdateCommand, CanModify);
            InsertQuotaCommand = new CommandHandler(SaveCommand, CanSaveQuota);
            ModifyQuotaCommand = new CommandHandler(UpdateCommand, CanModifyQuota);
            EraseQuotaCommand  = new CommandHandler(DeleteCommand, CanDelete);
            ClearCommand       = new CommandHandler(CleanCommand);
            #endregion

            try
            {
                #region Inizializzazione Liste

                ListQuoteInv       = new QuoteInvList();
                ListTabQuote       = new QuoteTabList();
                ListMovementType   = new RegistryMovementTypeList();
                ListInvestitori    = new RegistryOwnersList();
                ListInvestitori2   = new RegistryOwnersList();
                ListGestioni       = new RegistryOwnersList();
                ListLocation       = new RegistryLocationList();
                ListQuoteGuadagno  = new QuotePerPeriodoList();
                ListTipoSoldi      = new TipoSoldiList();
                ListValutePrelievo = new RegistryCurrencyList();
                ListValuteVersGiro = new RegistryCurrencyList();
                ListAnni           = _managerLiquidServices.GetAnniFromGuadagni();

                #endregion

                #region liste combo
                RegistryMovementTypeList listaOriginale = new RegistryMovementTypeList();
                listaOriginale = _registryServices.GetRegistryMovementTypesList();
                foreach (RegistryMovementType registry in listaOriginale)
                {
                    if (registry.Id_tipo_movimento == 1 || registry.Id_tipo_movimento == 2)
                    {
                        ListMovementType.Add(registry);
                    }
                }

                RegistryOwnersList ListaInvestitoreOriginale = new RegistryOwnersList();
                ListaInvestitoreOriginale = _registryServices.GetGestioneList();
                foreach (RegistryOwner RO in ListaInvestitoreOriginale)
                {
                    if (RO.Tipologia == "Investitore")
                    {
                        ListInvestitori.Add(RO);
                        ListInvestitori2.Add(RO);
                    }
                    else if (RO.Tipologia == "Gestore")
                    {
                        ListGestioni.Add(RO);
                    }
                }
                #endregion

                UpdateCollection();
            }
            catch (Exception err)
            {
                MessageBox.Show("Errore nella richiesta dei dati." + Environment.NewLine + err.Message, "DAF-C Quote Investitori");
            }
        }