コード例 #1
0
        public void InsertDrawDate(LotteryDrawResult lotteryDrawResult)
        {
            using (OleDbConnection conn = DatabaseConnectionFactory.GetDataSource())
                using (OleDbCommand command = new OleDbCommand())
                {
                    command.CommandType = CommandType.Text;
                    command.CommandText = " INSERT INTO draw_results (draw_date,jackpot_amt,winners,game_cd,num1,num2,num3,num4,num5,num6) " +
                                          " VALUES (@draw_date,@jackpot_amt,@winners,@game_cd,@num1,@num2,@num3,@num4,@num5,@num6)";
                    command.Parameters.AddWithValue("@draw_date", lotteryDrawResult.GetDrawDate());
                    command.Parameters.AddWithValue("@jackpot_amt", lotteryDrawResult.GetJackpotAmt());
                    command.Parameters.AddWithValue("@winners", lotteryDrawResult.GetWinnersCount());
                    command.Parameters.AddWithValue("@game_cd", lotteryDrawResult.GetGameCode());
                    command.Parameters.AddWithValue("@num1", lotteryDrawResult.GetNum1());
                    command.Parameters.AddWithValue("@num2", lotteryDrawResult.GetNum2());
                    command.Parameters.AddWithValue("@num3", lotteryDrawResult.GetNum3());
                    command.Parameters.AddWithValue("@num4", lotteryDrawResult.GetNum4());
                    command.Parameters.AddWithValue("@num5", lotteryDrawResult.GetNum5());
                    command.Parameters.AddWithValue("@num6", lotteryDrawResult.GetNum6());
                    command.Connection = conn;
                    conn.Open();
                    OleDbTransaction transaction = conn.BeginTransaction();
                    command.Transaction = transaction;
                    int result = command.ExecuteNonQuery();

                    if (result < 0)
                    {
                        transaction.Rollback();
                        throw new Exception(ResourcesUtils.GetMessage("lot_dao_impl_msg9"));
                    }
                    transaction.Commit();
                }
        }
コード例 #2
0
        private void SelectDrawResultAndOpenMatchMakingForm()
        {
            LotteryDrawResult drawResult = (LotteryDrawResult)objListVwWinningNum.SelectedObject;

            if (drawResult == null)
            {
                return;
            }
            OpenBetsAndDrawResultMatchMakingForm(drawResult.GetDrawDate(), 0);
        }
        protected override DateTime GetDrawDateEquivalent(Object lotteryObject)
        {
            LotteryDrawResult result = (LotteryDrawResult)lotteryObject;

            return(result.GetDrawDate());
        }