Ejemplo n.º 1
0
 public TicketVM()
 {
     error = "";
     types = TicketType.GetTicketTypes();
     ticket = new Ticket();
     typeList = new SelectList(types, "ID", "Name", SelectedType);
 }
Ejemplo n.º 2
0
 public static void EditTicket(Ticket FormTicket)
 {
     Database.ModifyData("UPDATE tbl_ticket SET TicketHolder=@holder,TicketHolderEmail=@holderemail,TicketType=@type,Amount=@amount WHERE ID=@id",
         Database.AddParameter("@holder",FormTicket.TicketHolder),
         Database.AddParameter("@holderemail",FormTicket.TicketHolderEmail),
         Database.AddParameter("@type",FormTicket.TicketType.ID),
         Database.AddParameter("@amount",FormTicket.Amount),
         Database.AddParameter("@id",FormTicket.ID)
         );
 }
Ejemplo n.º 3
0
 public static void AddTicket(Ticket FormTicket)
 {
     if (FormTicket.EntryName == "" || FormTicket.EntryName == null)
     {
         FormTicket.EntryName = "Admin";
     }
     Database.ModifyData("INSERT INTO tbl_ticket (TicketHolder,TicketHolderEmail,TicketType,EntryName,Amount,OrderDate) VALUES (@holder,@holderemail,@type,@entryname,@amount,@date)",
         Database.AddParameter("@holder",FormTicket.TicketHolder),
         Database.AddParameter("@holderemail",FormTicket.TicketHolderEmail),
         Database.AddParameter("@type",FormTicket.TicketType.ID),
         Database.AddParameter("@entryname",FormTicket.EntryName),
         Database.AddParameter("@amount",FormTicket.Amount),
         Database.AddParameter("@date",DateTime.Now)
         );
 }
Ejemplo n.º 4
0
 public static void DeleteTicket(Ticket SelectedTicket)
 {
     Database.ModifyData("DELETE FROM tbl_ticket WHERE ID=@id", Database.AddParameter("@id", SelectedTicket.ID));
 }