//TICKETS public static Ticket DevuelveTicket(int idTicket) { ticketsTabla = ticketsAdapter.GetData(); DataSet1.TicketsRow regTicket = ticketsTabla.FindByidTicket(idTicket); return(new Ticket(regTicket.idTicket, regTicket.Codigo, regTicket.Fecha, regTicket.UsuarioId)); }
public static DataSet1.TicketsDataTable TablaTickets(string ticket) { ticketsTabla = ticketsAdapter.GetDataByCodigo(ticket); return(ticketsTabla); }
protected void btnAceptar_Click(object sender, EventArgs e) { if (!Page.IsValid) { return; } bool Repetido = false; ticket = new Ticket(((Ticket)Session["Ticket"]).IdTicket, txtCodigo.Text, fechaTicket.SelectedDate, Convert.ToInt32(ddlUsuario.SelectedValue)); String codigo; String codigoA = ((Ticket)Session["Ticket"]).Codigo; ticketsTabla = ticketsAdapter.GetData(); for (int i = 0; i < ticketsTabla.Count; i++) { codigo = ticketsTabla[i].Codigo; if (txtCodigo.Text == codigoA) { i++; Repetido = true; } else { if (txtCodigo.Text == codigo) { Repetido = true; } } } if (Repetido) { Response.Write("<script>alert('YA EXISTE ESE TICKET')</script>"); } LNyAD.ModificaTicket(ticket); Page.ClientScript.RegisterStartupScript(this.GetType(), "myCloseScript", "window.close()", true); }