Ejemplo n.º 1
0
 public RegistryLocationList GetRegistryLocationList()
 {
     try
     {
         using (MySqlDataAdapter dbAdaptar = new MySqlDataAdapter())
         {
             dbAdaptar.SelectCommand             = new MySqlCommand();
             dbAdaptar.SelectCommand.Connection  = new MySqlConnection(DAFconnection.GetConnectionType());
             dbAdaptar.SelectCommand.CommandType = CommandType.Text;
             dbAdaptar.SelectCommand.CommandText = SQL.RegistryScripts.GetRegistryLocationList;
             DataTable dt = new DataTable();
             dbAdaptar.Fill(dt);
             RegistryLocationList RLL = new RegistryLocationList();
             foreach (DataRow dr in dt.Rows)
             {
                 RegistryLocation RL = new RegistryLocation();
                 RL.Id_Conto   = (int)dr.Field <uint>("id_conto");
                 RL.Desc_Conto = dr.Field <string>("desc_conto");
                 RL.Note       = dr.Field <string>("note");
                 RLL.Add(RL);
             }
             return(RLL);
         }
     }
     catch (MySqlException err)
     {
         throw new Exception(err.Message);
     }
     catch (Exception err)
     {
         throw new Exception(err.Message);
     }
 }
 public Dialog3CombosViewModel(string message, RegistryLocationList locationList, RegistryOwnersList ownerList, TipoSoldiList tipoSoldis,
                               RegistryLocation location = null, RegistryOwner owner = null, TipoSoldi soldi = null)
     : base(message)
 {
     RegistryLocations = locationList;
     RegistryOwners    = ownerList;
     TipoSoldis        = tipoSoldis;
     NoCommand         = new CommandHandler(OnNoClicked);
     CancelCommand     = new CommandHandler(OnCancelClicked);
     YesCommand        = new CommandHandler(OnYesClicked);
     if (location == null || owner == null || soldi == null)
     {
         Id_Location = 0;
         Id_Owner    = 0;
         Id_Soldi    = 0;
     }
     else
     {
         Id_Location = location.Id_Conto;
         Id_Owner    = owner.Id_gestione;
         Id_Soldi    = soldi.Id_Tipo_Soldi;
         Location    = new RegistryLocation()
         {
             Id_Conto = location.Id_Conto, Desc_Conto = location.Desc_Conto
         };
         Owner = new RegistryOwner()
         {
             Id_gestione = owner.Id_gestione, Nome_Gestione = owner.Nome_Gestione
         };
         Soldi = new TipoSoldi((Models.Enum.TipologiaSoldi)soldi.Id_Tipo_Soldi); // { Id_Tipo_Soldi = soldi.Id_Tipo_Soldi, Desc_Tipo_Soldi = soldi.Desc_Tipo_Soldi };
     }
 }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
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");
            }
        }