/// <summary>Gets the properties list hash code for quick comparsion.</summary>
        /// <param name="listToHash">The List To Hash.</param>
        /// <returns>The hash code representing the properties list.</returns>
        public int GetPropertiesHashCode(BindingList <PresentedProperties> listToHash)
        {
            var propertiesString = listToHash.Aggregate(
                string.Empty, (current, presentedProperties) => current + presentedProperties.ToString());

            return(propertiesString.GetHashCode());
        }
Ejemplo n.º 2
0
        public string GetUploadData()
        {
            var raidData   = _raid.ShowExportedData();
            var memberData = Members.Aggregate("", (current, raidMember) => current + (raidMember.ShowExportData() + "\r\n"));
            var lootData   = LootItems.Aggregate("", (current, LootItem) => current + (LootItem.ShowExportData() + "\r\n"));

            return(raidData + memberData + lootData);
        }
        public ListControlGridViewModel(ObservableCollection<ControlView> properties,
            BindingList<IntWrappper> arrayIndexes,
            Type fieldType,
            ControlView baseTypeProperties
            )
        {
            Properties = properties;
            ArrayIndexes = arrayIndexes;
            FieldType = fieldType;
            _baseTypeProperties = baseTypeProperties;

            int x = 1;
            if (ArrayIndexes.Count == 1) x = 1;
            else if (ArrayIndexes.Count > 1)
            {
                for (var i = 0; i < ArrayIndexes.Count - 1; i++)
                {
                    x = x * ArrayIndexes[i].Int;
                }
            }
            int y = ArrayIndexes[ArrayIndexes.Count - 1].Int;

            _listOfListItemGrid = new List<List<ArrayItem>>();

            int totalElementsInList = arrayIndexes.Aggregate(1, (current, iw) => current * iw.Int);
            if (Properties.Count < totalElementsInList)
            {
                for (int i = Properties.Count; i < totalElementsInList; i++)
                {
                    Properties.Add(Controller.DeepCopy(_baseTypeProperties));
                }
            }

            var indexCount = 0;
            List<ArrayItem> l = new List<ArrayItem>();
            List<int> arrayIndexesInt = arrayIndexes.Select(o => o.Int).ToList();
            for (var j = 0; j < x * y; j++)
            {
                if (j % y == 0)
                {
                    l = new List<ArrayItem>();
                    _listOfListItemGrid.Add(l);
                }

                List<int> indexes = new List<int>();

                for (int ir = 0; ir < arrayIndexesInt.Count; ir++)
                {
                    TestHelper.GetArrayIndexesFromLinearIndex(arrayIndexesInt, ir, indexes, j);
                }

                l.Add(new ArrayItem()
                {
                    Index = Convert.ToString(indexCount),
                    DisplayIndex = string.Join(",", indexes.ToArray())
                });
                indexCount++;
            }

            NotifyOfPropertyChange(() => ListOfListItemGrid);
        }
Ejemplo n.º 4
0
 public int Run(int current, BindingList <int> pl)
 {
     return(pl.Aggregate((x, y) => Math.Abs(x - current) < Math.Abs(y - current) ? x : y));
 }
Ejemplo n.º 5
0
        public ListControlGridViewModel(ObservableCollection <ControlView> properties,
                                        BindingList <IntWrappper> arrayIndexes,
                                        Type fieldType,
                                        ControlView baseTypeProperties
                                        )
        {
            Properties          = properties;
            ArrayIndexes        = arrayIndexes;
            FieldType           = fieldType;
            _baseTypeProperties = baseTypeProperties;

            int x = 1;

            if (ArrayIndexes.Count == 1)
            {
                x = 1;
            }
            else if (ArrayIndexes.Count > 1)
            {
                for (var i = 0; i < ArrayIndexes.Count - 1; i++)
                {
                    x = x * ArrayIndexes[i].Int;
                }
            }
            int y = ArrayIndexes[ArrayIndexes.Count - 1].Int;

            _listOfListItemGrid = new List <List <ArrayItem> >();

            int totalElementsInList = arrayIndexes.Aggregate(1, (current, iw) => current * iw.Int);

            if (Properties.Count < totalElementsInList)
            {
                for (int i = Properties.Count; i < totalElementsInList; i++)
                {
                    Properties.Add(Controller.DeepCopy(_baseTypeProperties));
                }
            }

            var indexCount     = 0;
            List <ArrayItem> l = new List <ArrayItem>();
            List <int>       arrayIndexesInt = arrayIndexes.Select(o => o.Int).ToList();

            for (var j = 0; j < x * y; j++)
            {
                if (j % y == 0)
                {
                    l = new List <ArrayItem>();
                    _listOfListItemGrid.Add(l);
                }

                List <int> indexes = new List <int>();

                for (int ir = 0; ir < arrayIndexesInt.Count; ir++)
                {
                    TestHelper.GetArrayIndexesFromLinearIndex(arrayIndexesInt, ir, indexes, j);
                }

                l.Add(new ArrayItem()
                {
                    Index        = Convert.ToString(indexCount),
                    DisplayIndex = string.Join(",", indexes.ToArray())
                });
                indexCount++;
            }

            NotifyOfPropertyChange(() => ListOfListItemGrid);
        }
Ejemplo n.º 6
0
        public override string ToString()
        {
            string _columns = Collumns.Aggregate("", (output, collumn) => output += collumn.ToString());

            return(string.Format(Layout, Cabinet.NameSpace, Name, _columns));
        }
Ejemplo n.º 7
0
        public AziendaDTO[] GetAziendeByIDAziende(BindingList<int> idAziende)
        {
            try
            {
                var daoFactory = _windsorRepository.GetDaoFactory(_info.Azienda);
                var aziende = new AziendaDTO[idAziende.Count];

                for (var i = 0; i < idAziende.Count; i++ )
                {
                    aziende[i] = setDto(daoFactory.GetAziendaDao().GetById(idAziende[i], false));
                }

                return aziende;
            }
            catch (Exception ex)
            {
                _log.FatalFormat("Errore nel caricamento delle Aziende - {0} - aziende:{1}", ex, Utility.GetMethodDescription(), idAziende.Aggregate(string.Empty, (current, i) => current + (i + ", ")));
                throw;
            }
        }
Ejemplo n.º 8
0
 private void dataGridView1_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
 {
     _venda.Total = _itens.Aggregate(0.0, (sum, it) => sum += it.ValorSubTotal());
     inTotal.Text = _venda.Total.ToString("C");
 }
Ejemplo n.º 9
0
        public override string ToString()
        {
            string _shelfs = Shelfs.Aggregate("", (output, shelf) => output += string.Format(ShelfFormat, shelf.Name));

            return(string.Format(Layout, NameSpace, Name, _shelfs, ConnectioString));
        }
Ejemplo n.º 10
0
		public string SetConti(BindingList<ContoListaDTO> conti, UserInfo userinfo)
		{
			var windsorRep = new WindsorConfigRepository();
			try
			{
				windsorRep.BeginTransaction(userinfo);
				var repo = new ContabilitaRepository(userinfo, windsorRep);
				var item = repo.UpdateConto(conti);
				windsorRep.Commit();
				return item;
			}
			catch (Exception ex)
			{
                var idConti = conti.Aggregate(string.Empty, (current, contoListaDTO) => current + contoListaDTO.ID + ", ");
                _log.ErrorFormat("Errore il salvataggio dei conto contabili - {0} - conti:{1} - azienda:{2}", ex, Utility.GetMethodDescription(), idConti, userinfo.Azienda);
				windsorRep.Rollback();
				throw;
			}
		}
Ejemplo n.º 11
0
		public IList<RiepilogoRataSoggettoDTO> GetRiepilogoVersamentiByPersonaUnitaImmobiliari(int idEsercizio, int idPersona, BindingList<int> unitaImmobiliari, DateTime? dataLimite, UserInfo userinfo)
		{
			var windsorRep = new WindsorConfigRepository();
			try
			{
				windsorRep.BeginTransaction(userinfo);
                var versamentiService = windsorRep.GetContainer(userinfo.Azienda).Resolve<IVersamentiCondominiService>();
                var item = versamentiService.GetRiepilogoVersamentiByPersonaUnitaImmobiliari(idEsercizio, idPersona, unitaImmobiliari, dataLimite);
				windsorRep.Commit();
				return item;
			}
			catch (Exception ex)
			{
			    _log.ErrorFormat("Errore nella esecuzione della funzione - {0} - idEsercizio:{1} - idPersona:{2} - unità:{3} - azienda:{4}", ex, Utility.GetMethodDescription(), idEsercizio, idPersona, unitaImmobiliari.Aggregate(string.Empty, (current, i) => current + $"{i}, "), userinfo.Azienda);
				windsorRep.Rollback();
				throw;
			}
		}