Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya Info Tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 86a0936b
authored
Mar 02, 2015
by
Liv Haapala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
1 parent
21017ed4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
1 deletions
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.dll
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.pdb
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.Designer.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.cs
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.resx
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.dll
View file @
86a0936
No preview for this file type
MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.pdb
View file @
86a0936
No preview for this file type
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.Designer.cs
View file @
86a0936
...
...
@@ -58,6 +58,11 @@
this
.
searchTimer
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
ImageRefreshTimer
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
panel2
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
reservedPlacesCountTextBox
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
freePlacesCountTextBox
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
placesCountTimer
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
MapPictureBox
)).
BeginInit
();
this
.
toolStrip1
.
SuspendLayout
();
this
.
TopPanel
.
SuspendLayout
();
...
...
@@ -265,6 +270,10 @@
//
// TopPanel
//
this
.
TopPanel
.
Controls
.
Add
(
this
.
freePlacesCountTextBox
);
this
.
TopPanel
.
Controls
.
Add
(
this
.
label2
);
this
.
TopPanel
.
Controls
.
Add
(
this
.
reservedPlacesCountTextBox
);
this
.
TopPanel
.
Controls
.
Add
(
this
.
label1
);
this
.
TopPanel
.
Controls
.
Add
(
this
.
label3
);
this
.
TopPanel
.
Controls
.
Add
(
this
.
MapsComboBox
);
this
.
TopPanel
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Top
;
...
...
@@ -332,6 +341,45 @@
this
.
panel2
.
Size
=
new
System
.
Drawing
.
Size
(
752
,
471
);
this
.
panel2
.
TabIndex
=
17
;
//
// label1
//
this
.
label1
.
AutoSize
=
true
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
204
,
21
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
41
,
13
);
this
.
label1
.
TabIndex
=
7
;
this
.
label1
.
Text
=
"Varattu"
;
//
// reservedPlacesCountTextBox
//
this
.
reservedPlacesCountTextBox
.
Location
=
new
System
.
Drawing
.
Point
(
251
,
18
);
this
.
reservedPlacesCountTextBox
.
Name
=
"reservedPlacesCountTextBox"
;
this
.
reservedPlacesCountTextBox
.
ReadOnly
=
true
;
this
.
reservedPlacesCountTextBox
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
20
);
this
.
reservedPlacesCountTextBox
.
TabIndex
=
8
;
//
// freePlacesCountTextBox
//
this
.
freePlacesCountTextBox
.
Location
=
new
System
.
Drawing
.
Point
(
418
,
18
);
this
.
freePlacesCountTextBox
.
Name
=
"freePlacesCountTextBox"
;
this
.
freePlacesCountTextBox
.
ReadOnly
=
true
;
this
.
freePlacesCountTextBox
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
20
);
this
.
freePlacesCountTextBox
.
TabIndex
=
10
;
//
// label2
//
this
.
label2
.
AutoSize
=
true
;
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
362
,
21
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
50
,
13
);
this
.
label2
.
TabIndex
=
9
;
this
.
label2
.
Text
=
"Vapaana"
;
//
// placesCountTimer
//
this
.
placesCountTimer
.
Interval
=
60000
;
this
.
placesCountTimer
.
Tick
+=
new
System
.
EventHandler
(
this
.
placesCountTimer_Tick
);
//
// MainForm
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
13F
);
...
...
@@ -389,6 +437,11 @@
private
System
.
Windows
.
Forms
.
Timer
ImageRefreshTimer
;
private
System
.
Windows
.
Forms
.
Panel
panel2
;
private
System
.
Windows
.
Forms
.
ToolStripButton
orgMealToolStripButton
;
private
System
.
Windows
.
Forms
.
TextBox
freePlacesCountTextBox
;
private
System
.
Windows
.
Forms
.
Label
label2
;
private
System
.
Windows
.
Forms
.
TextBox
reservedPlacesCountTextBox
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
Timer
placesCountTimer
;
}
}
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.cs
View file @
86a0936
...
...
@@ -10,6 +10,7 @@ using System.IO;
using
System.Linq
;
using
System.Net
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
...
...
@@ -51,7 +52,8 @@ namespace MoyaAdminUI
{
MessageBox
.
Show
(
ex
.
Message
+
"\r\nCannot connect to Moya.\r\nCheck Api url and key"
);
}
refreshPlacesCountTexBoxes
();
placesCountTimer
.
Start
();
}
private
void
loadPlacemap
()
...
...
@@ -779,6 +781,7 @@ namespace MoyaAdminUI
}
}
}
placesCountTimer
.
Stop
();
}
...
...
@@ -1184,6 +1187,41 @@ namespace MoyaAdminUI
{
ImageRefreshTimer
.
Stop
();
this
.
MapPictureBox
.
Refresh
();
//refreshPlacesCountTexBoxes();
}
private
void
refreshPlacesCountTexBoxes
()
{
int
free
=
0
;
int
reserved
=
0
;
foreach
(
ListViewItem
lvi
in
PlacesListView
.
Items
)
{
if
(
lvi
.
Tag
!=
null
&&
lvi
.
Tag
is
ComputerPlace
)
{
ComputerPlace
place
=
(
ComputerPlace
)
lvi
.
Tag
;
if
(
place
.
Taken
)
reserved
+=
1
;
else
if
(
place
.
Buyable
)
free
+=
1
;
}
}
if
(
freePlacesCountTextBox
.
Text
!=
free
.
ToString
())
{
freePlacesCountTextBox
.
Text
=
free
.
ToString
();
Color
color
=
freePlacesCountTextBox
.
BackColor
;
freePlacesCountTextBox
.
BackColor
=
Color
.
Yellow
;
Thread
.
Sleep
(
500
);
freePlacesCountTextBox
.
BackColor
=
color
;
Thread
.
Sleep
(
500
);
freePlacesCountTextBox
.
BackColor
=
Color
.
Yellow
;
Thread
.
Sleep
(
500
);
freePlacesCountTextBox
.
BackColor
=
color
;
}
if
(
reservedPlacesCountTextBox
.
Text
!=
reserved
.
ToString
())
{
reservedPlacesCountTextBox
.
Text
=
reserved
.
ToString
();
}
}
private
void
MainForm_SizeChanged
(
object
sender
,
EventArgs
e
)
...
...
@@ -1205,6 +1243,11 @@ namespace MoyaAdminUI
}
private
void
placesCountTimer_Tick
(
object
sender
,
EventArgs
e
)
{
refreshPlacesCountTexBoxes
();
}
}
...
...
MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.resx
View file @
86a0936
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment