Example #1
0
        protected void SbmBtn_Click(object sender, EventArgs e)
        {
            CrusadersService.Ticket tic = new CrusadersService.Ticket();
            tic.Type = TypeSlc.Value;
            tic.Price = TxtPrice.Text;
            tic.Description = TxtDesc.Text;
            tic.AgeOrType = AgeSlc.Value;

            db.AddToTickets(tic);
            db.SaveChanges();
            setCreatedMessage();
            Response.Redirect("Show.aspx");

        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];
            if (!string.IsNullOrEmpty(id))
            {
                if (!IsPostBack)
                {
                    db = Global.CrusadersEntitiesDB();

                    ticket = db.Tickets.Where(x => x.id == int.Parse(id)).First();

                    TypeSlc.Value = ticket.Type;
                    TxtPrice.Text = ticket.Price;
                    TxtDesc.Text = ticket.Description;
                    AgeSlc.Value = ticket.AgeOrType;
                }
            }
            else
            {
                Response.Redirect("Show.aspx");
            }
        }