Exemplo n.º 1
0
        public Boolean AggiungiBuono(TicketValidationRes buono, Boolean force = false)
        {
            BuonoPasto bp = new BuonoPasto(buono);

            if (force)
            {
                this._codici.Add(bp);
                return(true);
            }
            if (!Convert.ToBoolean(config.AppSettings.Settings["isAbilitaResto"].Value))
            {
                if (this.GetTotale() + bp.ValoreTotale <= this.Totale)
                {
                    this._codici.Add(bp);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                this._codici.Add(bp);
                return(true);
            }
        }
Exemplo n.º 2
0
 //public BuonoPasto(string codice)
 //{
 //    this.CodiceABarre = codice;
 //    this.Valore = Convert.ToDecimal(codice.Substring(codice.Length - 5)) / 100;
 //    this.Scadenza = DateTime.ParseExact(codice.Substring(codice.Length - 9, 4) + DateTime.DaysInMonth(2000 + Convert.ToInt32(codice.Substring(codice.Length - 9, 2)), Convert.ToInt32(codice.Substring(codice.Length - 7, 2))), "yyMMdd", CultureInfo.InvariantCulture);
 //}
 public BuonoPasto(TicketValidationRes validationResponse)
 {
     this.CodiceABarre      = validationResponse.Rows[0].BC;
     this.Fornitore         = validationResponse.Rows[0].COMPANY.ToString();
     this.ValoreTotale      = Convert.ToDecimal(validationResponse.Rows[0].VB, new CultureInfo("en-US"));
     this.Scadenza          = DateTime.ParseExact(validationResponse.Rows[0].DTSCAD, "yyyyMMdd", CultureInfo.InvariantCulture);
     this.CodiceTransazione = validationResponse.IDTR;
 }