コード例 #1
0
        private String CodiceToNome(Tabella Table, String Code)
        {
            for (int i = 0; i < Table.List.Length; i++)
            {
                if (Code == Table.List[i].Codice)
                {
                    return(Table.List[i].Nome);
                }
            }

            return(" ");
        }
コード例 #2
0
        public bool Copri(int num, int premio)
        {
            int col = num / 10;

            if (num == 90)
            {
                col = 8;
            }
            int rig = -1;

            for (int i = 0; i < Tabella.GetLength(0); i++)
            {
                if (Tabella[i, col] == num)
                {
                    Caselle[i, col].Copri();
                    Tabella[i, col] = 0;
                    Coperte[i]++;
                    rig = i;
                    break;
                }
            }
            if (rig != -1)
            {
                if (premio < 4 && Coperte[rig] == premio + 2)
                {
                    return(true);
                }
                else
                {
                    int coperte = 0;
                    for (int i = 0; i < Tabella.GetLength(0); i++)
                    {
                        if (Coperte[i] == 5)
                        {
                            coperte++;
                        }
                    }
                    if (coperte == 3)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
コード例 #3
0
        public void LoadDataSource(ref XmlDataProviderManager x, string ID, string _IDTree, string IDCliente, string IDSessione)
        {
            _x = x;

            Tabella.Load(ID, "", _IDTree, "", IDCliente, IDSessione);
        }
コード例 #4
0
ファイル: Decodifica.cs プロジェクト: gipasoft/Sfera
	    /// <summary>
	    /// Imposta un elemento di tabella. Se già esiste un elemento con la stessa chiave quest'ultimo viene sostituito
	    /// </summary>
	    /// <param name="codiceTabella">Codice della tabella</param>
	    /// <param name="codiceElemento">Codice dell'elemento</param>
	    /// <param name="tabella"></param>
	    public void SetElement(string codiceTabella, string codiceElemento, Tabella tabella)
		{
			var tabelleHash = GetTable(codiceTabella);
			tabella.CodiceElemento = codiceElemento;
			tabella.CodiceTabella = codiceTabella;
			tabelleHash.SetItem(codiceElemento, tabella);
		}
コード例 #5
0
ファイル: Decodifica.cs プロジェクト: gipasoft/Sfera
		/// <summary>
		/// Decodifica un singolo codice elemento di una tabella
		/// </summary>
		/// <param name="codiceTabella">Codice della tabella</param>
		/// <param name="codiceElemento">Codice dell'elemento</param>
		/// <returns>Struttura tabella identificante l'elemento cercato</returns>
		public Tabella GetElement(string codiceTabella, string codiceElemento)
		{
			var tabella = new Tabella(codiceTabella, codiceElemento, codiceElemento, 0, string.Empty, string.Empty);

			var tabelleHash = GetTable(codiceTabella);
            if (tabelleHash != null && !string.IsNullOrEmpty(codiceElemento))
			{
				object tabellaObj = tabelleHash.GetItem(codiceElemento);
				if(tabellaObj != null) tabella = (Tabella) tabellaObj;
			}

			return tabella;
		}
コード例 #6
0
ファイル: Decodifica.cs プロジェクト: gipasoft/Sfera
	    /// <summary>
	    /// Carica un singolo elemento di tabella
	    /// </summary>
	    /// <param name="codiceTabella">Codice della tabella</param>
	    /// <param name="codiceElemento">Codice dell'elemento</param>
	    /// <param name="iterElemento"></param>
	    /// <returns></returns>
	    private static Tabella loadElemento(string codiceTabella, string codiceElemento, XPathNodeIterator iterElemento)
		{
			var tabella = new Tabella(codiceTabella, codiceElemento);
			//XPathNodeIterator iterElemento = xNav.SelectDescendants(XPathNodeType.Element, false); 
			
			while(iterElemento.MoveNext())
			{
				if(iterElemento.Current.Name == "descrizione") tabella.Descrizione = iterElemento.Current.Value; 
				if(iterElemento.Current.Name == "fieldNum") tabella.ValoreNumerico = Double.Parse(iterElemento.Current.Value); 
				if(iterElemento.Current.Name == "fieldStr") tabella.ValoreStringa = iterElemento.Current.Value; 
				if(iterElemento.Current.Name == "nota") tabella.Nota = iterElemento.Current.Value; 
			}

			return tabella;
		}
コード例 #7
0
ファイル: ListaHash.cs プロジェクト: gipasoft/Sfera
        private int CompareByValue(Tabella x, Tabella y)
        {
            int valoreX = int.MinValue;
            int valoreY = int.MinValue;

            if (int.TryParse(x.CodiceElemento.ToString(), out valoreX))
                if (int.TryParse(y.CodiceElemento.ToString(), out valoreY))
                    return valoreX.CompareTo(valoreY);

            return x.CodiceElemento.ToString().CompareTo(y.CodiceElemento.ToString());
        }