Example #1
0
        public void AddLotteryTicket(LotteryTicket ticket)
        {
            object[] ticketVals = ticket.GetTicketValuesArray();
            foreach (object val in ticketVals)
            {
                dbConnection.CheckInput(val.ToString());
            }

            dbConnection.InsertTable("LotteryTicket", "myID, LotteryID, IntervalStart, IntervalEnd,Cost, Status, UserID",
                                     new[] { "@idParam", "@lotteryParam", "@interStart", "@interEnd", "@cost", "@stat", "@user" },
                                     ticketVals);
        }
Example #2
0
 public void EditLotteryTicketInDatabase(LotteryTicket ticket)
 {
     string[] columnNames =
     {
         "myID",
         "LotteryID",
         "IntervalStart",
         "IntervalEnd",
         "Cost",
         "Status",
         "UserID"
     };
     dbConnection.CheckInput(ticket.myID);
     object[] ticketVals = ticket.GetTicketValuesArray();
     foreach (object val in ticketVals)
     {
         dbConnection.CheckInput(val.ToString());
     }
     dbConnection.UpdateTable("LotteryTicket", "myID = '" + ticket.myID + "'", columnNames,
                              new [] { "@idParam", "@lotteryParam", "@interStart", "@interEnd", "@cost", "@stat", "@user" }, ticketVals);
 }