private void AddCardToList(Entrata entrata, Ingresso ingresso) { int fascia = entrata.DataOraEntrata.Hour; DatiReport01 target = null; foreach (DatiReport01 dataReport01 in _List) { if (dataReport01.InizioFasciaOraria == fascia) { target = dataReport01; } } if (target == null) { target = new DatiReport01(); target.Museo = ingresso.Descrizione; target.InizioFasciaOraria = fascia; _List.Add(target); } //if (riga.Vendita.Struttura.Oid == _Ingresso.Struttura.Oid) if (entrata.RigaStampaIngresso.Stampa.Vendita.Struttura.Oid == ingresso.Struttura.Oid) { target.MuseoMyFE += entrata.RigaStampaIngresso.TotaleIngressi; } else { target.AltriMyFE += entrata.RigaStampaIngresso.TotaleIngressi; } target.CalcolaTotali(); }
public async Task <IActionResult> Edit(int id, [Bind("Id,NomeCliente,NroDias,ValorBasico")] Ingresso ingresso) { if (id != ingresso.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ingresso); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IngressoExists(ingresso.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ingresso)); }
private void AddToList(Ingresso ingresso, int ng, string anno) { DatiReport03 target = null; foreach (DatiReport03 datiReport03 in _List) { if (datiReport03.Museo == ingresso.Descrizione) { target = datiReport03; } } if (target == null) { target = new DatiReport03(); target.Museo = ingresso.Descrizione; target.Tipo = ingresso.DescrizioneTipo; target.Ordine = ingresso.OrdineReport01; target.Tipologia = ingresso.Tipologia; _List.Add(target); } if (anno == "ac") { target.GiorniAC += ng; } else { target.GiorniAP += ng; } target.CalcolaTotale(); }
public async Task <IActionResult> Edit(int id, [Bind("IngressoId,EventosId")] Ingresso ingresso) { if (id != ingresso.IngressoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ingresso); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IngressoExists(ingresso.IngressoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EventosId"] = new SelectList(_context.Set <Eventos>(), "EventosId", "EventosId", ingresso.EventosId); return(View(ingresso)); }
public async Task <IActionResult> PutIngresso([FromRoute] int id, [FromBody] Ingresso ingresso) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ingresso.Id) { return(BadRequest()); } _context.Entry(ingresso).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IngressoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void schedulerControl1_CustomDrawTimeCell(object sender, CustomDrawObjectEventArgs e) { SelectableIntervalViewInfo obj = e.ObjectInfo as SelectableIntervalViewInfo; if (obj != null) { e.DrawDefault(); if (obj.Resource.Id is Guid) { Ingresso ingresso = obj.Resource.GetSourceObject(this.schedulerStorage1) as Ingresso; if (ingresso != null && ingresso.VerificaCalendario) { if (calendario == null) { calendario = new XPCollection <IngressoCalendario>(this.session1); } int numero = 0; if (Trova(ingresso, obj.Interval.Start, out numero)) { e.Graphics.DrawString(numero.ToString(), font, brush_green, e.Bounds); } } } e.Handled = true; } }
public PrenotazioneIngresso(Ingresso ingresso, int persone) { Prenotazioni = new List <SingolaPrenotazione>(); Ingresso = ingresso; NumeroPersone = persone; }
public ActionResult Create([Bind(Include = "IngressoId,Valor,Tipo,ClienteId,EventoId,BilheteriaId,Free")] Ingresso ingresso) { if (ModelState.IsValid) { Cliente c = db.Clientes.Find(ingresso.ClienteId); Evento e = db.Eventoes.Find(ingresso.EventoId); // Ingresso i = db.Ingressoes.Find(ingresso.IngressoId); if (c.Idade >= 18) { if (ingresso.Tipo.ToString() == "VIP") { ingresso.Free = true; db.Ingressoes.Add(ingresso); db.SaveChanges(); return(RedirectToAction("Index")); } else { db.Ingressoes.Add(ingresso); db.SaveChanges(); return(RedirectToAction("Index")); } } if (c.Idade < 18) { ViewBag.AvisoIdade = "Cliente menor de 18 anos, entrada proibida"; } } ViewBag.BilheteriaId = new SelectList(db.Bilheterias, "BilheteriaId", "Nome", ingresso.BilheteriaId); ViewBag.ClienteId = new SelectList(db.Clientes, "ClienteId", "Nome", ingresso.ClienteId); ViewBag.EventoId = new SelectList(db.Eventoes, "EventoId", "Nome", ingresso.EventoId); return(View(ingresso)); }
private Variante FindVarianteSingoleOmaggio(UnitOfWork uow, Ingresso myin) { var ingresso = uow.GetObjectByKey <Ingresso>(myin.Oid); foreach (var p in ingresso.Percorsi) { if (p.Ingressi.Count != 1) { continue; } foreach (var b in p.BigliettiValidi) { foreach (var v in b.VariantiValide) { if (!(v.Note ?? "").Contains("[UNIFE]")) { continue; } if (v.PrezzoAttuale == null) { continue; } return(v); } } } return(null); }
public object lerPreencherUm(MySqlCommand comando) { ingressoRetorno = new Ingresso(); comando.Connection.Open(); consulta = comando.ExecuteReader(); try { if (consulta.FieldCount > 0) // caso haja algum registro no banco, o reader será chamado e mostrará, se não ele sai deste método e mostrará a mensagem de erro do bloco 'else' { while (consulta.Read()) { ingressoRetorno.Id = (long)consulta[consulta.GetName(0)]; ingressoRetorno.Codigo = (long)consulta[consulta.GetName(1)]; ingressoRetorno.IdEvento = (long)consulta[consulta.GetName(2)]; ingressoRetorno.Tipo = consulta[consulta.GetName(3)].ToString(); } } else { MessageBox.Show("Náo foi encontrado nenhum registro no banco de dados referente a sua busca"); } } catch (Exception) { throw; } comando.Connection.Close(); return(ingressoRetorno); }
public void insert(Ingresso ingresso) { try { openConnection(); var comando = conexao.CreateCommand(); comando = new MySqlCommand("INSERT INTO Ingresso(valor, formaPagamento, quantidade, fk_Pessoa_cpf, fk_Evento_id) VALUES (@valor, @formaPagamento, @quantidade, @fk_Pessoa_cpf, @fk_Evento_id)", conexao); comando.Parameters.AddWithValue("@valor", ingresso.valor); comando.Parameters.AddWithValue("@formaPagamento", ingresso.formaPagamento); comando.Parameters.AddWithValue("@quantidade", ingresso.quantidade); comando.Parameters.AddWithValue("@fk_Pessoa_cpf", ingresso.cpfPessoa); comando.Parameters.AddWithValue("@fk_Evento_id", ingresso.idEvento); comando.ExecuteNonQuery(); } catch (Exception erro) { throw erro; } finally { closeConnection(); } }
public async Task <ActionResult <Ingresso> > PostIngresso(Ingresso ingresso) { _context.Ingresso.Add(ingresso); await _context.SaveChangesAsync(); //return CreatedAtAction("GetTodoItem", new { id = todoItem.Id }, todoItem); return(CreatedAtAction(nameof(GetIngresso), new { id = ingresso.Id }, ingresso)); }
public ActionResult DeleteConfirmed(int id) { Ingresso ingresso = db.Ingressoes.Find(id); db.Ingressoes.Remove(ingresso); db.SaveChanges(); return(RedirectToAction("Index")); }
private static TipoStato CreateMsgIng(string strMsg, TipoStato stato, out Messaggio msg) { msg = MessaggioFactory.Create(strMsg); TipoComando ingresso = (TipoComando)Enum.Parse(typeof(TipoComando), strMsg.Split(' ')[0], true); Ingresso ing = IngressoFactory.Create(ingresso); TipoStato statoSuccessivo = ing.CambiaStato(stato); return(statoSuccessivo); }
public Ingresso GerarIngresso() { Ingresso ingresso = new Ingresso(); ingresso.Codcliente = cliente.Codcliente; ingresso.Codevento = evento.Codevento; ingresso.Valorinteiro = comboBoxTipoIngresso.SelectedIndex == 0; return(ingresso); }
public Evento(string titulo, string local, int lotacao, DateTime data, string duracao, int classificacao, Ingresso ingresso) { Titulo = titulo; Local = local; Lotacao = lotacao; Data = data; Duracao = duracao; Classificacao = classificacao; Ingresso = ingresso; }
public ActionResult Edit([Bind(Include = "IngressoId,Tipo")] Ingresso ingresso) { if (ModelState.IsValid) { db.Entry(ingresso).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ingresso)); }
static void Main(string[] args) { Ingresso ingresso = new Ingresso(25); Console.WriteLine(ingresso.ToString()); IngressoVip ingressoVip = new IngressoVip(25, 5); Console.WriteLine(ingressoVip.ToString()); }
public ActionResult Edit([Bind(Include = "IngressoId,EventoId,Valor")] Ingresso ingresso) { if (ModelState.IsValid) { db.Entry(ingresso).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EventoId = new SelectList(db.Eventoes, "EventoId", "Nome", ingresso.EventoId); return(View(ingresso)); }
public ActionResult Create([Bind(Include = "IngressoId,Tipo")] Ingresso ingresso) { if (ModelState.IsValid) { db.Ingressoes.Add(ingresso); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ingresso)); }
public async Task <IActionResult> Create([Bind("Id,NomeCliente,NroDias,ValorBasico")] Ingresso ingresso) { if (ModelState.IsValid) { _context.Add(ingresso); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ingresso)); }
public void Dado_um_ingresso_adicionado_o_status_deve_ser_AguardandoPagamento() { var sessao = new Sessao(DateTime.Now.AddDays(15), _espetaculo, _sala, 30M); var reserva = new Reserva(_cliente, sessao); var poltronas = sessao.Poltrona.ToList(); var ingresso = new Ingresso("Gabriel", poltronas[0]); reserva.AdicionarIngresso(ingresso); Assert.AreEqual(reserva.Status, EStatusReserva.AguardandoPagamento); }
public ActionResult Create([Bind(Include = "IngressoId,EventoId,Valor")] Ingresso ingresso) { if (ModelState.IsValid) { db.Ingressoes.Add(ingresso); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EventoId = new SelectList(db.Eventoes, "EventoId", "Nome", ingresso.EventoId); return(View(ingresso)); }
public int inserir(object obj, string tableName, tipoConsulta tipoConsulta, MySqlParameter[] parametrosWhere) { ingresso = (Ingresso)obj; comando.Parameters.AddWithValue("@codigo", ingresso.Codigo); comando.Parameters.AddWithValue("@idEvento", ingresso.IdEvento); comando.Parameters.AddWithValue("@tipo", ingresso.Tipo); con.query_string = "INSERT INTO ingressos (codigo, idEvento, tipo) VALUES ('" + " @codigo, " + " @idEvento, " + " @tipo)"; return(ExecutarSemConsultar(comando)); }
public async Task <IActionResult> PostIngresso([FromBody] Ingresso ingresso) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Ingresso.Add(ingresso); await _context.SaveChangesAsync(); return(CreatedAtAction("GetIngresso", new { id = ingresso.Id }, ingresso)); }
public ActionResult Avancar(Ingresso _ingresso) { Global.Global.IngressoSelecionado = _ingresso; if (Global.Global.Cliente == null) { return(Redirect("/LoginAlternativo/Index")); } return(RedirectToAction("Index", "Pagamento")); }
internal void Init(Ingresso ingresso, DateTime start, DateTime end) { DateStart = start; DateEnd = end; this.dateEditData.DateTime = start; this.xpCollectionPercorso.Criteria = CriteriaOperator.Parse("Ingressi[Oid=?]", ingresso.Oid); if (this.xpCollectionPercorso.Count > 0) { this.lookUpEditPercorso.EditValue = this.xpCollectionPercorso[0]; } }
public void Dado_dois_ingressos_no_valor_de_30_o_total_deve_ser_60() { var sessao = new Sessao(DateTime.Now.AddDays(15), _espetaculo, _sala, 30M); var reserva = new Reserva(_cliente, sessao); var poltronas = sessao.Poltrona.ToList(); var primeiroIngresso = new Ingresso("Gabriel", poltronas[0]); var segundoIngresso = new Ingresso("Jose", poltronas[1]); reserva.AdicionarIngresso(primeiroIngresso); reserva.AdicionarIngresso(segundoIngresso); Assert.AreEqual(reserva.Total(), 60); }
private bool Trova(Ingresso ingresso, DateTime dateTime, out int numero) { numero = 0; foreach (IngressoCalendario item in calendario) { if (item.Ingresso == ingresso && item.DataOra == dateTime) { numero = item.PaxMax; return(true); } } return(false); }
static void Main(string[] args) { Ingresso padrao = new Ingresso(); padrao.valor = 10; padrao.imprimeIngresso(); IngressoVIP vip = new IngressoVIP(); vip.valorAdicional = 5; vip.valor = 10; vip.imprimeIngressoVIP(); }