Пример #1
0
 public RegistryMovementTypeList GetRegistryMovementTypesList()
 {
     try
     {
         using (MySqlDataAdapter dbAdapter = new MySqlDataAdapter())
         {
             dbAdapter.SelectCommand             = new MySqlCommand();
             dbAdapter.SelectCommand.CommandType = CommandType.Text;
             dbAdapter.SelectCommand.CommandText = SQL.RegistryScripts.GetRegistryMovementTypeList;
             dbAdapter.SelectCommand.Connection  = new MySqlConnection(DAFconnection.GetConnectionType());
             DataTable dt = new DataTable();
             dbAdapter.Fill(dt);
             RegistryMovementTypeList RMTL = new RegistryMovementTypeList();
             foreach (DataRow dr in dt.Rows)
             {
                 RegistryMovementType RMT = new RegistryMovementType();
                 RMT.Id_tipo_movimento   = (int)dr.Field <uint>("id_tipo_movimento");
                 RMT.Desc_tipo_movimento = dr.Field <string>("desc_Movimento");
                 RMTL.Add(RMT);
             }
             return(RMTL);
         }
     }
     catch (MySqlException err)
     {
         throw new Exception(err.Message);
     }
     catch (Exception err)
     {
         throw new Exception(err.Message);
     }
 }
Пример #2
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);
            }
        }
Пример #3
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");
            }
        }