Skip to content

Commit 8e7d242

Browse files
- Clear out Add Bet content Form when exiting from Pick Generator
- Implement copying of selected bet list thru ctrl+c shortcut - Implement selection of all bets on the list view thru ctrl+a shortcut - Latest Jackpot, if latest is jackpot, then show the minimum jackpot - When deleting a bet, ensure that the cancel button is focus first - Refresh the main dashboard if a bet was deleted. - Fixed saving the last opened lottery - When moving the bet dates, it will now able to save to the current date.
1 parent 7a5e839 commit 8e7d242

File tree

16 files changed

+82
-50
lines changed

16 files changed

+82
-50
lines changed

App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<value>0</value>
3333
</setting>
3434
<setting name="version_release" serializeAs="String">
35-
<value>6</value>
35+
<value>7</value>
3636
</setting>
3737
<setting name="repository_name" serializeAs="String">
3838
<value>LottoDataManager</value>

Forms/MainFrm.Designer.cs

Lines changed: 19 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Forms/MainFrm.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,19 @@ private void InitializesFormContent()
167167
{
168168
if (rowObject == null) return 0;
169169
LotteryDrawResult p = (LotteryDrawResult)rowObject;
170-
if (p.GetWinners() <= 0) return "0";
171-
return p.GetWinners();
170+
if (p.GetWinnersCount() <= 0) return "0";
171+
return p.GetWinnersCount();
172172
};
173173
this.olvColWinStamp.ImageGetter = delegate (object rowObject) {
174174
if (rowObject == null) return 0;
175175
LotteryDrawResult p = (LotteryDrawResult)rowObject;
176-
if (p.GetWinners() <= 0) return 0;
176+
if (p.GetWinnersCount() <= 0) return 0;
177177
return ImageUtils.GetStarJackpotImage(5);
178178
};
179179
this.olvColWinStamp.AspectGetter = delegate (object rowObject) {
180180
if (rowObject == null) return 0;
181181
LotteryDrawResult p = (LotteryDrawResult)rowObject;
182-
return p.GetWinners();
182+
return p.GetWinnersCount();
183183
};
184184
this.olvColWinStamp.AspectToStringConverter = delegate (object rowObject) {
185185
return String.Empty;
@@ -452,7 +452,7 @@ private void objListVwWinningNum_FormatRow(object sender, FormatRowEventArgs e)
452452
{
453453
if (e.Model == null) return;
454454
LotteryDrawResult result = (LotteryDrawResult)e.Model;
455-
if(result.GetWinners() > 0)
455+
if(result.GetWinnersCount() > 0)
456456
{
457457
e.Item.BackColor = Color.GreenYellow;
458458
e.Item.ForeColor = Color.Black;
@@ -554,6 +554,15 @@ private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
554554
objectLstVwLatestBet.SelectAll();
555555
}
556556
private void copySelectedAsLinearCSVToolStripMenuItem_Click(object sender, EventArgs e)
557+
{
558+
ObjectLstVwLatestBetClipboardCopy();
559+
}
560+
private void objectLstVwLatestBet_KeyUp(object sender, KeyEventArgs e)
561+
{
562+
if (e.Control && e.KeyCode == Keys.C) ObjectLstVwLatestBetClipboardCopy();
563+
if (e.Control && e.KeyCode == Keys.A) objectLstVwLatestBet.SelectAll();
564+
}
565+
private void ObjectLstVwLatestBetClipboardCopy()
557566
{
558567
try
559568
{
@@ -845,6 +854,7 @@ private void OnApplicationExit(object sender, EventArgs e)
845854
MessageBox.Show(ResourcesUtils.GetMessage("mainf_labels_45"));
846855
}
847856
}
857+
848858
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
849859
{
850860
this.Close();
@@ -876,12 +886,10 @@ private void MainForm_HandleCreated(object sender, EventArgs e)
876886
{
877887
DoApplicationUpdate();
878888
}
879-
880889
private void DoApplicationUpdate()
881890
{
882891
this.applicationUpdateProcessor.StartUpdate(lotteryDataServices);
883892
}
884-
885893
#endregion
886894

887895
}

Forms/Others/HitComparisonFrm.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ private void InitializesObjectListViewDataBinding()
202202
this.olvColDrawWinner.ImageGetter = delegate (object rowObject) {
203203
if (rowObject == null) return 0;
204204
LotteryDrawResult p = (LotteryDrawResult)rowObject;
205-
if (p.GetWinners() <= 0) return 0;
205+
if (p.GetWinnersCount() <= 0) return 0;
206206
return ImageUtils.GetStarJackpotImage(5);
207207
};
208208
this.olvColDrawWinner.AspectGetter = delegate (object rowObject) {
209209
if (rowObject == null) return 0;
210210
LotteryDrawResult p = (LotteryDrawResult)rowObject;
211-
return p.GetWinners();
211+
return p.GetWinnersCount();
212212
};
213213
this.olvColDrawWinner.AspectToStringConverter = delegate (object rowObject) {
214214
return String.Empty;

Forms/Ticket/AddBetFrm.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void AddBetFrm_Load(object sender, EventArgs e)
8080
dtPickPreferredDate.Visible = false;
8181

8282
//select default if no selection
83-
if(cmbSeqGenType.SelectedItem == null) SelectedSequenceGenerator = GeneratorType.PERSONAL_PICK;
83+
if (cmbSeqGenType.SelectedItem == null) SelectedSequenceGenerator = GeneratorType.PERSONAL_PICK;
8484
}
8585
private void RefreshSelectedDrawDate()
8686
{
@@ -105,6 +105,8 @@ public GeneratorType SelectedSequenceGenerator
105105
private void btnExit_Click(object sender, EventArgs e)
106106
{
107107
this.Close();
108+
textBoxDelimitersInput.Text = String.Empty;
109+
ClearTicketLayoutSelection();
108110
if (!this.hasDataBeenSave) return;
109111
ClassReflectionUtil.RefreshMainFormBets(this);
110112
}
@@ -409,6 +411,10 @@ private void AddSelectedTicketPanelNumber(Button btnNumClicked = null)
409411
lblSelectedNumber.Text = numSelected;
410412
}
411413
private void linkLblClrSelNum_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
414+
{
415+
ClearTicketLayoutSelection();
416+
}
417+
private void ClearTicketLayoutSelection()
412418
{
413419
selTcktPnlNum.Clear();
414420
AddSelectedTicketPanelNumber();

Forms/Ticket/ModifyBetDateFrm.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,16 @@ private bool IsValidated()
153153
}
154154
else if (newDateTime.CompareTo(DateTime.Now.Date) == 0) //if the same
155155
{
156-
log(ResourcesUtils.GetMessage("mdd_form_validation_msg6"));
157-
return false;
156+
if (lotteryDataServices.IsPastTicketSellingCutoffTime())
157+
{
158+
DialogResult drPassCutOfftime = MessageBox.Show(ResourcesUtils.GetMessage("mdd_form_validation_msg8"),
159+
ResourcesUtils.GetMessage("mdd_form_others_mgs7"), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
160+
if(drPassCutOfftime != DialogResult.OK)
161+
{
162+
log(ResourcesUtils.GetMessage("mdd_form_validation_msg6"));
163+
return false;
164+
}
165+
}
158166
}
159167
return true;
160168
}

Forms/Ticket/ModifyBetFrm.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,12 @@ private void btnDeleteChecked_Click(object sender, EventArgs e)
254254
private void DeleteLotteryBets()
255255
{
256256
if (objectListViewBets.CheckedObjects.Count <= 0) return;
257+
DialogResult dr = DialogResult.Cancel;
257258
try
258259
{
259-
DialogResult dr = MessageBox.Show(ResourcesUtils.GetMessage("modfy_bets_msg_7"),
260-
ResourcesUtils.GetMessage("modfy_bets_msg_8"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
260+
dr = MessageBox.Show(ResourcesUtils.GetMessage("modfy_bets_msg_7"),
261+
ResourcesUtils.GetMessage("modfy_bets_msg_8"), MessageBoxButtons.OKCancel,
262+
MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
261263
if (dr == DialogResult.OK)
262264
{
263265
toolStripProgBar.Value = 0;
@@ -272,6 +274,7 @@ private void DeleteLotteryBets()
272274
this.lotteryDataServices.DeleteLotteryBet(lotBet);
273275
Application.DoEvents();
274276
}
277+
if (totalCheckedObjects > 0) hasDataUpdates = true;
275278
}
276279
}
277280
catch (Exception ex)
@@ -283,7 +286,7 @@ private void DeleteLotteryBets()
283286
toolStripStatusLbl.Text = "";
284287
toolStripProgBar.Value = 0;
285288
toolStripProgBar.Visible = false;
286-
FillUpBetList();
289+
if (dr == DialogResult.OK) FillUpBetList();
287290
}
288291
}
289292
private void SaveLotteryBetsChanges()

Includes/Classes/Reports/DashboardReport.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ private List<DashboardReportItemSetup> GetLatestDrawResultsJackpotPerLotteryGame
423423
if (draw == null) continue;
424424
Lottery lottery = lotteriesGameList.Find((lotteryObj) => (int)lotteryObj.GetGameMode() == draw.GetGameCode());
425425
String key = lottery.GetDescription();
426-
String value = draw.GetJackpotAmtFormatted();
426+
String value = (draw.HasWinners()) ?
427+
ResourcesUtils.GetMessage("drpt_lot_draw_jackpot_winners_lbl",
428+
draw.GetJackpotAmtFormatted(), draw.GetWinnersCount().ToString()) :
429+
draw.GetJackpotAmtFormatted();
427430
DashboardReportItemSetup itm = GenModel(key, value);
428431
itm.GroupKeyName = ResourcesUtils.GetMessage("drpt_lot_draw_jackpot_lbl");
429432
itm.ReportItemDecoration.IsHyperLink = true;

Includes/Database/DAO/Impl/LotteryDrawResultDaoImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public void InsertDrawDate(LotteryDrawResult lotteryDrawResult)
207207
" VALUES (@draw_date,@jackpot_amt,@winners,@game_cd,@num1,@num2,@num3,@num4,@num5,@num6)";
208208
command.Parameters.AddWithValue("@draw_date", lotteryDrawResult.GetDrawDate());
209209
command.Parameters.AddWithValue("@jackpot_amt", lotteryDrawResult.GetJackpotAmt());
210-
command.Parameters.AddWithValue("@winners", lotteryDrawResult.GetWinners());
210+
command.Parameters.AddWithValue("@winners", lotteryDrawResult.GetWinnersCount());
211211
command.Parameters.AddWithValue("@game_cd", lotteryDrawResult.GetGameCode());
212212
command.Parameters.AddWithValue("@num1", lotteryDrawResult.GetNum1());
213213
command.Parameters.AddWithValue("@num2", lotteryDrawResult.GetNum2());

0 commit comments

Comments
 (0)