Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion App.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<value>0</value>
</setting>
<setting name="version_release" serializeAs="String">
<value>9</value>
<value>11</value>
</setting>
<setting name="repository_name" serializeAs="String">
<value>LottoDataManager</value>
Expand Down
27 changes: 12 additions & 15 deletions Includes/Classes/Reports/DashboardReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,22 +328,19 @@ private List<DashboardReportItemSetup> GetLotteryBetsInQueue()
LotteryDetails lotteryDetails = LotteryDataServices.LotteryDetails;
foreach (Lottery lottery in LotteryDataServices.GetLotteries())
{
if(lotteryDetails.GameMode != lottery.GetGameMode())
List<LotteryBet> lotteryBetList = LotteryDataServices.GetLotterybetsQueued(lottery.GetGameMode());
if (lotteryBetList.Count <= 0) continue;
foreach(LotteryBet bet in lotteryBetList)
{
List<LotteryBet> lotteryBetList = LotteryDataServices.GetLotterybetsQueued(lottery.GetGameMode());
if (lotteryBetList.Count <= 0) continue;
foreach(LotteryBet bet in lotteryBetList)
{
String key = DateTimeConverterUtils.ConvertToFormat(bet.GetTargetDrawDate(), DateTimeConverterUtils.STANDARD_DATE_FORMAT_WITH_DAYOFWEEK);
String value = bet.GetGNUFormat();
DashboardReportItemSetup dshSetup = GenModel(key, value);
dshSetup.DashboardReportItemAction = DashboardReportItemActions.OPEN_LOTTERY_GAME;
dshSetup.Tag = lottery.GetGameMode();
dshSetup.GroupTaskLabel = ResourcesUtils.GetMessage("drpt_lot_bet_group_lbl_task");
dshSetup.GroupKeyName = ResourcesUtils.GetMessage("drpt_lot_bet_group_lbl", lottery.GetDescription(), lotteryBetList.Count.ToString());
dshSetup.ReportItemDecoration.IsHyperLink = true;
itemsList.Add(dshSetup);
}
String key = DateTimeConverterUtils.ConvertToFormat(bet.GetTargetDrawDate(), DateTimeConverterUtils.STANDARD_DATE_FORMAT_WITH_DAYOFWEEK);
String value = bet.GetGNUFormat();
DashboardReportItemSetup dshSetup = GenModel(key, value);
dshSetup.DashboardReportItemAction = DashboardReportItemActions.OPEN_LOTTERY_GAME;
dshSetup.Tag = lottery.GetGameMode();
dshSetup.GroupTaskLabel = ResourcesUtils.GetMessage("drpt_lot_bet_group_lbl_task");
dshSetup.GroupKeyName = ResourcesUtils.GetMessage("drpt_lot_bet_group_lbl", lottery.GetDescription(), lotteryBetList.Count.ToString());
dshSetup.ReportItemDecoration.IsHyperLink = true;
itemsList.Add(dshSetup);
}
}
return itemsList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ namespace LottoDataManager.Includes.Classes.Reports.Templates
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class IndividualGameHTMLReportView : IndividualGameHTMLReportViewBase
{
public virtual string TransformText() { return ""; }

public virtual void Initialize() { }
}

#region Base class
Expand Down
136 changes: 69 additions & 67 deletions Includes/Database/DAO/Impl/LotteryBetDaoImpl.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Includes/Database/DAO/Impl/LotteryDaoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Lottery GetLottery(GameMode gameCode)
{
command.CommandType = CommandType.Text;
command.CommandText = "SELECT * FROM lottery WHERE game_cd = @game_cd AND active = true;";
command.Parameters.AddWithValue("@game_cd", gameCode);
command.Parameters.Add("@game_cd", OleDbType.Integer).Value = gameCode;
command.Connection = conn;
conn.Open();

Expand Down
103 changes: 45 additions & 58 deletions Includes/Database/DAO/Impl/LotteryDrawResultDaoImpl.cs

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Includes/Database/DAO/Impl/LotteryOutletDaoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public LotteryOutlet GetDefaultLotteryOutlet()
{
command.CommandType = CommandType.Text;
command.CommandText = "SELECT * FROM lottery_outlet WHERE outlet_cd = @outlet_cd AND active = true ORDER BY description ASC";
command.Parameters.AddWithValue("@outlet_cd", ResourcesUtils.LotteryOutletDefaultCode);
command.Parameters.Add("@outlet_cd", OleDbType.Integer).Value = ResourcesUtils.LotteryOutletDefaultCode;
command.Connection = conn;
conn.Open();

Expand All @@ -79,9 +79,9 @@ public void UpdateDescription(LotteryOutlet updatedModel)
command.CommandType = CommandType.Text;
command.CommandText = " UPDATE lottery_outlet SET description = @description " +
" WHERE ID = @id AND outlet_cd = @outlet_cd AND active = true";
command.Parameters.AddWithValue("@description", StringUtils.Truncate(updatedModel.GetDescription(), MAX_LEN_DESCRIPTION));
command.Parameters.AddWithValue("@id", updatedModel.GetId());
command.Parameters.AddWithValue("@outlet_cd", updatedModel.GetOutletCode());
command.Parameters.Add("@description", OleDbType.Variant).Value = StringUtils.Truncate(updatedModel.GetDescription(), MAX_LEN_DESCRIPTION);
command.Parameters.Add("@id", OleDbType.Integer).Value = updatedModel.GetId();
command.Parameters.Add("@outlet_cd", OleDbType.Integer).Value = updatedModel.GetOutletCode();
command.Connection = conn;
conn.Open();
OleDbTransaction transaction = conn.BeginTransaction();
Expand All @@ -105,7 +105,7 @@ public bool IsLotteryOutletUsed(int outletCd)
command.CommandText = "SELECT count(ID) AS [total] FROM lottery_bet " +
" WHERE outlet_cd = @outlet_cd " +
" AND active = true ";
command.Parameters.AddWithValue("@outlet_cd", outletCd);
command.Parameters.Add("@outlet_cd", OleDbType.Integer).Value = outletCd;
command.Connection = conn;
conn.Open();
using (OleDbDataReader reader = command.ExecuteReader())
Expand Down Expand Up @@ -135,9 +135,9 @@ public void RemoveOutlet(LotteryOutlet modelToRemove)
command.CommandText = " UPDATE lottery_outlet SET active = false " +
" WHERE ID = @id AND outlet_cd = @outlet_cd " +
" AND description = @outlet_desc AND active = true ";
command.Parameters.AddWithValue("@id", modelToRemove.GetId());
command.Parameters.AddWithValue("@outlet_cd", modelToRemove.GetOutletCode());
command.Parameters.AddWithValue("@outlet_desc", modelToRemove.GetDescription());
command.Parameters.Add("@id", OleDbType.Integer).Value = modelToRemove.GetId();
command.Parameters.Add("@outlet_cd", OleDbType.Integer).Value = modelToRemove.GetOutletCode();
command.Parameters.Add("@outlet_desc", OleDbType.Variant).Value = modelToRemove.GetDescription();
command.Connection = conn;
conn.Open();
OleDbTransaction transaction = conn.BeginTransaction();
Expand All @@ -161,7 +161,7 @@ public bool IsDescriptionExisting(String outletDescription)
command.CommandText = "SELECT count(ID) AS [total] FROM lottery_outlet " +
" WHERE description = @outletDescription " +
" AND active = true ";
command.Parameters.AddWithValue("@outletDescription", outletDescription);
command.Parameters.Add("@outletDescription", OleDbType.Variant).Value = outletDescription;
command.Connection = conn;
conn.Open();
using (OleDbDataReader reader = command.ExecuteReader())
Expand Down Expand Up @@ -195,8 +195,8 @@ public int InsertLotteryOutlet(String outletDescription)
command.CommandType = CommandType.Text;
command.CommandText = " INSERT INTO `lottery_outlet` (`outlet_cd`, `description`, `active`) " +
" VALUES(@nextOutletCode, @outletDescription, true)";
command.Parameters.AddWithValue("@nextOutletCode", nextOutletCode);
command.Parameters.AddWithValue("@outletDescription", StringUtils.Truncate(outletDescription, MAX_LEN_DESCRIPTION));
command.Parameters.Add("@nextOutletCode", OleDbType.Integer).Value = nextOutletCode;
command.Parameters.Add("@outletDescription", OleDbType.Variant).Value = StringUtils.Truncate(outletDescription, MAX_LEN_DESCRIPTION);

command.Connection = conn;
conn.Open();
Expand Down
22 changes: 11 additions & 11 deletions Includes/Database/DAO/Impl/LotteryScheduleDaoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public LotterySchedule GetLotterySchedule(GameMode gameMode)
{
using(OleDbConnection conn = DatabaseConnectionFactory.GetDataSource())
using(OleDbCommand command = new OleDbCommand("SELECT * FROM lottery_schedule WHERE game_cd = ? AND active = true", conn)) {
command.Parameters.AddWithValue("game_cd", gameMode);
command.Parameters.Add("game_cd", OleDbType.Integer).Value = gameMode;
conn.Open();
using (OleDbDataReader reader = command.ExecuteReader())
{
Expand All @@ -48,8 +48,8 @@ public void RemoveLotterySchedule(LotterySchedule lsched)
command.CommandType = CommandType.Text;
command.CommandText = " UPDATE lottery_schedule SET active = false " +
" WHERE ID = @id AND game_cd = @game_cd AND active = true";
command.Parameters.AddWithValue("@id", lsched.GetID());
command.Parameters.AddWithValue("@game_cd", (int) lsched.GetGameMode());
command.Parameters.Add("@id", OleDbType.Integer).Value = lsched.GetID();
command.Parameters.Add("@game_cd", OleDbType.Integer).Value = (int)lsched.GetGameMode();
command.Connection = conn;
conn.Open();
OleDbTransaction transaction = conn.BeginTransaction();
Expand All @@ -74,14 +74,14 @@ public int InsertLotterySchedule(LotterySchedule lsched)
" (`game_cd`, `active`, `mon`, `tues`, `wed`, `thurs`, `fri`, `sat`, `sun`) " +
" VALUES " +
" (@game_cd, true, @isMon, @isTue, @isWed, @isThu, @isFri, @isSat, @isSun) ";
command.Parameters.AddWithValue("@game_cd", (int)lsched.GetGameMode());
command.Parameters.AddWithValue("@isMon", lsched.IsMonday());
command.Parameters.AddWithValue("@isTue", lsched.IsTuesday());
command.Parameters.AddWithValue("@isWed", lsched.IsWednesday());
command.Parameters.AddWithValue("@isThu", lsched.IsThursday());
command.Parameters.AddWithValue("@isFri", lsched.IsFriday());
command.Parameters.AddWithValue("@isSat", lsched.IsSaturday());
command.Parameters.AddWithValue("@isSun", lsched.IsSunday());
command.Parameters.Add("@game_cd", OleDbType.Integer).Value = (int)lsched.GetGameMode();
command.Parameters.Add("@isMon", OleDbType.Boolean).Value = lsched.IsMonday();
command.Parameters.Add("@isTue", OleDbType.Boolean).Value = lsched.IsTuesday();
command.Parameters.Add("@isWed", OleDbType.Boolean).Value = lsched.IsWednesday();
command.Parameters.Add("@isThu", OleDbType.Boolean).Value = lsched.IsThursday();
command.Parameters.Add("@isFri", OleDbType.Boolean).Value = lsched.IsFriday();
command.Parameters.Add("@isSat", OleDbType.Boolean).Value = lsched.IsSaturday();
command.Parameters.Add("@isSun", OleDbType.Boolean).Value = lsched.IsSunday();
command.Connection = conn;
conn.Open();
OleDbTransaction transaction = conn.BeginTransaction();
Expand Down
16 changes: 8 additions & 8 deletions Includes/Database/DAO/Impl/LotterySequenceGenDaoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public LotterySequenceGenerator GetSeqGenerator(int seqGenId)
using (OleDbConnection conn = DatabaseConnectionFactory.GetDataSource())
using (OleDbCommand command = new OleDbCommand("SELECT * FROM lottery_seq_gen WHERE seqGenId = @seqGenId AND active = true", conn))
{
command.Parameters.AddWithValue("@seqGenId", seqGenId);
command.Parameters.Add("@seqGenId", OleDbType.Integer).Value = seqGenId;
conn.Open();
using (OleDbDataReader reader = command.ExecuteReader())
{
Expand All @@ -66,7 +66,7 @@ public LotterySequenceGenerator GetSeqGeneratorByCode(int seqGenCode)
using (OleDbConnection conn = DatabaseConnectionFactory.GetDataSource())
using (OleDbCommand command = new OleDbCommand("SELECT * FROM lottery_seq_gen WHERE seqgencd = @seqGenCode AND active = true", conn))
{
command.Parameters.AddWithValue("@seqGenCode", seqGenCode);
command.Parameters.Add("@seqGenCode", OleDbType.Integer).Value = seqGenCode;
conn.Open();
using (OleDbDataReader reader = command.ExecuteReader())
{
Expand All @@ -86,9 +86,9 @@ public void UpdateDescription(LotterySequenceGenerator updatedModel)
command.CommandType = CommandType.Text;
command.CommandText = " UPDATE lottery_seq_gen SET description= @description " +
" WHERE ID = @id AND seqgencd = @seqgencd AND active = true";
command.Parameters.AddWithValue("@description", StringUtils.Truncate(updatedModel.GetDescription(), MAX_LEN_DESCRIPTION));
command.Parameters.AddWithValue("@id", updatedModel.GetID());
command.Parameters.AddWithValue("@seqgencd", updatedModel.GetSeqGenCode());
command.Parameters.Add("@description", OleDbType.Variant).Value = StringUtils.Truncate(updatedModel.GetDescription(), MAX_LEN_DESCRIPTION);
command.Parameters.Add("@id", OleDbType.Integer).Value = updatedModel.GetID();
command.Parameters.Add("@seqgencd", OleDbType.Integer).Value = updatedModel.GetSeqGenCode();
command.Connection = conn;
conn.Open();
OleDbTransaction transaction = conn.BeginTransaction();
Expand All @@ -112,7 +112,7 @@ public bool IsDescriptionExisting(String seqGenDescription)
command.CommandText = "SELECT count(ID) AS [total] FROM lottery_seq_gen " +
" WHERE description = @description " +
" AND active = true ";
command.Parameters.AddWithValue("@description", seqGenDescription);
command.Parameters.Add("@description", OleDbType.Variant).Value = seqGenDescription;
command.Connection = conn;
conn.Open();
using (OleDbDataReader reader = command.ExecuteReader())
Expand All @@ -139,8 +139,8 @@ public int InsertSequenceGenerator(LotterySequenceGenerator seqGen)
command.CommandText = " INSERT INTO `lottery_seq_gen` (`seqgencd`, `description`, `active`) VALUES(@seqgencd, @desc, true); ";

command.Connection = conn;
command.Parameters.AddWithValue("@seqgencd", seqGen.GetSeqGenCode());
command.Parameters.AddWithValue("@desc", seqGen.GetDescription());
command.Parameters.Add("@seqgencd", OleDbType.Integer).Value = seqGen.GetSeqGenCode();
command.Parameters.Add("@desc", OleDbType.Variant).Value = seqGen.GetDescription();

conn.Open();
OleDbTransaction transaction = conn.BeginTransaction();
Expand Down
2 changes: 1 addition & 1 deletion Includes/Database/DAO/Impl/LotteryTicketPanelDaoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public LotteryTicketPanel GetLotteryTicketPanel(GameMode gameMode)
using (OleDbConnection conn = DatabaseConnectionFactory.GetDataSource())
using (OleDbCommand command = new OleDbCommand("SELECT * FROM lottery_ticket_panel WHERE game_cd = ? AND active = true;", conn))
{
command.Parameters.AddWithValue("game_cd", gameMode);
command.Parameters.Add("game_cd", OleDbType.Integer).Value = gameMode;
conn.Open();
using (OleDbDataReader reader = command.ExecuteReader())
{
Expand Down
Loading