Пример #1
0
 public TicketVM()
 {
     error = "";
     types = TicketType.GetTicketTypes();
     ticket = new Ticket();
     typeList = new SelectList(types, "ID", "Name", SelectedType);
 }
Пример #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)
         );
 }
Пример #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)
         );
 }
Пример #4
0
 public static void DeleteTicket(Ticket SelectedTicket)
 {
     Database.ModifyData("DELETE FROM tbl_ticket WHERE ID=@id", Database.AddParameter("@id", SelectedTicket.ID));
 }